Audio cracking in qemu

Moderators: 666philb, Forum moderators

Post Reply
User avatar
mr_gs
Posts: 38
Joined: Tue Dec 14, 2021 6:39 am
Has thanked: 7 times
Been thanked: 8 times

Audio cracking in qemu

Post by mr_gs »

Recently I've created an android virtual machine(android x86 8.1 oreo) in fossapup 9.5. The performance is near native with kvm but there's some problem with audio from the vm. It's cracking.
I'm currently using pulseaudio.
(I've tried all the parameters in -soundhw but the issue still exists.)

Fossapup 9.5 64bit Kernel 5.4.53
Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz
8GB RAM
Intel (R) UHD Graphics

Clarity
Posts: 3844
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1633 times
Been thanked: 527 times

Re: Audio cracking in qemu

Post by Clarity »

2 pieces of information could help members help you:

  • Which QEMU version are you using for your VM?

  • Can you share your VM stanza for your QEMU operation?

User avatar
mr_gs
Posts: 38
Joined: Tue Dec 14, 2021 6:39 am
Has thanked: 7 times
Been thanked: 8 times

Re: Audio cracking in qemu

Post by mr_gs »

I'm using qemu 5.1.0(installed from quickpet)
Here's the command that I use to start my vm

Code: Select all

qemu-system-x86_64 -name 'android' -machine q35 -device virtio-vga,virgl=on,xres=360,yres=760 -serial mon:stdio -device ac97 -cpu host,kvm=on -device virtio-tablet -device virtio-mouse-pci -device virtio-keyboard-pci -smp cores=2,threads=4 -m 2048 -mem-prealloc -display sdl,gl=on -object iothread,id=io1 -device virtio-blk-pci,drive=disk0,iothread=io1 -drive file='/media/root/data/Linux/emulator/android.img',index=0,id=disk0,if=none,format=raw,cache=none,aio=native -net nic -net user,hostfwd=tcp::4444-:5555 -rtc base=localtime -boot c -enable-kvm

Fossapup 9.5 64bit Kernel 5.4.53
Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz
8GB RAM
Intel (R) UHD Graphics

Clarity
Posts: 3844
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1633 times
Been thanked: 527 times

Re: Audio cracking in qemu

Post by Clarity »

On my FossaPUP64, I have this PET installed

Code: Select all

root# qemu-system-x86_64 -version
QEMU emulator version 7.1.50 (v7.1.0-1-g93fac696d2)
Copyright (c) 2003-2022 Fabrice Bellard and the QEMU Project developers

Try this QEMU stanza in the terminal on your running PUP

Code: Select all

qemu-system-x86_64 -m 2048 -enable-kvm -smp 2 -device virtio-vga-gl -display sdl,gl=on -device ac97 -name 'Android64 in QEMU' -boot d -cdrom Path-to-your>.iso

Let this community know the results.

For others, I hope you know you can run any ISO for an ARM processor (like RasPI) on QEMU as well; Do it via qemu-system-aarch64 or via qemu-system-arm

Clarity
Posts: 3844
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1633 times
Been thanked: 527 times

Re: Audio cracking in qemu

Post by Clarity »

BTW: Was this happening by your booting other forum distros?

If you have not tried others, run the stanza using one of the following via the stanza and report; 2 current forum distros:

  • F96

  • KLV-Airedale

Remember to show your successful stanza used.

User avatar
mr_gs
Posts: 38
Joined: Tue Dec 14, 2021 6:39 am
Has thanked: 7 times
Been thanked: 8 times

Re: Audio cracking in qemu

Post by mr_gs »

Clarity wrote: Fri Mar 31, 2023 8:15 am

On my FossaPUP64, I have this PET installed

Code: Select all

root# qemu-system-x86_64 -version
QEMU emulator version 7.1.50 (v7.1.0-1-g93fac696d2)
Copyright (c) 2003-2022 Fabrice Bellard and the QEMU Project developers

Try this QEMU stanza in the terminal on your running PUP

Code: Select all

qemu-system-x86_64 -m 2048 -enable-kvm -smp 2 -device virtio-vga-gl -display sdl,gl=on -device ac97 -name 'Android64 in QEMU' -boot d -cdrom Path-to-your>.iso

Let this community know the results.

For others, I hope you know you can run any ISO for an ARM processor (like RasPI) on QEMU as well; Do it via qemu-system-aarch64 or via qemu-system-arm

I have installed qemu v7.1 PET from viewtopic.php?p=65732#p65732 but there's no improvement. I guess it has something to with pulseaudio.

Fossapup 9.5 64bit Kernel 5.4.53
Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz
8GB RAM
Intel (R) UHD Graphics

Clarity
Posts: 3844
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1633 times
Been thanked: 527 times

Re: Audio cracking in qemu

Post by Clarity »

mr_gs wrote: Fri Mar 31, 2023 9:08 am

... but there's no improvement...

  • Did you try either ISOs I mentioned as a test?

Trying to understand if this happens for everything from the VM on your PC or is isolated to the particular ISO you are using.

Help us, by letting us know.

User avatar
mr_gs
Posts: 38
Joined: Tue Dec 14, 2021 6:39 am
Has thanked: 7 times
Been thanked: 8 times

Re: Audio cracking in qemu

Post by mr_gs »

I have tried all above mentioned iso's. I can hear sound but there's still some disturbance :(
It's system wide and not to a particular iso.

Fossapup 9.5 64bit Kernel 5.4.53
Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz
8GB RAM
Intel (R) UHD Graphics

Clarity
Posts: 3844
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1633 times
Been thanked: 527 times

Re: Audio cracking in qemu

Post by Clarity »

As suspected. This 'may' be PC problem vs QEMU.

Next, we need to know

  • if you've seen this problem in your native FossaPUP64 media app use?

  • Can you share what sound card(s) you have in your PC? <=== this can be seen by right-clicking the taskbar speaker icon for 'Sound Card Wizard'

If there are several sound cards, is there a chance you can switch speakers to test? If you can and do, make sure FossaPUP media apps run native to the switched speaker before restarting your QEMU.

In my past, I had a couple forum distro boot to getting some continuous regular-interval popping thru the speakers in native mode (never happened with FossaPUP, though). Those 2 distros were corrected by the distro authors in the past.

And here's odd request from me. Can you record the annoying sound that you are hearing when the VM is running? By posting it, Maybe if hearing it, one of us on the forum would know a causal.

Curious

User avatar
mr_gs
Posts: 38
Joined: Tue Dec 14, 2021 6:39 am
Has thanked: 7 times
Been thanked: 8 times

Re: Audio cracking in qemu

Post by mr_gs »

I've attached the screenshot of my sound card. It shows two cards but only the first one works. I've set the first one as default.
Also there's no problem in running video/audio from mpv or vlc media player.
(I've also attached the video demonstrating the problem)

Attachments
record.mp4.tar.gz
(291.17 KiB) Downloaded 29 times
Screenshot from 2023-04-01 13-31-33.png
Screenshot from 2023-04-01 13-31-33.png (32.68 KiB) Viewed 957 times

Fossapup 9.5 64bit Kernel 5.4.53
Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz
8GB RAM
Intel (R) UHD Graphics

Clarity
Posts: 3844
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1633 times
Been thanked: 527 times

ANYONE have sound issues - Help solve Audio cracking in sound outputs

Post by Clarity »

Take a look at this QEMU soundcard page

This parm -soundhw hda might change that behavior with your host's Intel card

There is also the -soundhw all option where you select.

I did listen to that crackling noise accompanying the sound output that you posted. I've never heard that behavior before in any of my rigs.

Post your final QEMU stanza

User avatar
bigpup
Moderator
Posts: 7001
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 915 times
Been thanked: 1531 times

Re: Audio cracking in qemu

Post by bigpup »

The first card is the correct one to use in Fossapup64 9.5

The sound software in Fossapup64 has best support for analog devices.

I'm currently using pulseaudio.

Fossapup64 does not have pulseaudio, except for a few apulse files, to make programs think they are using pulseaudio, when in fact it is ALSA providing the sound.

So maybe it needs to have the full pulseaudio software package installed in Fossapup64 :idea:

To be honest that is another not so easy to do process.

The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

Clarity
Posts: 3844
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1633 times
Been thanked: 527 times

Re: Audio cracking in qemu

Post by Clarity »

RETRACTION: See Next POST
******************************

I am currently testing F96-CD_4.iso booted in a QEMU VM.

Code: Select all

qemu-system-x86_64 -enable-kvm -vga std -m 2G -smp 2 -device AC97 -name "F96 v4 via QEMU" -cdrom F96-CE_4.iso

Running an MP4 media file, I am getting feedback that I had NOT noticed on prior VMs. It is NOT isolated to a specific MP4 file. Both of the OOTB media player yield the same feedback crackling along with the video's normal sound.

Not sure how to circumvent or change.

This is considered, by me, to be consistent with what the OP reported. Anyone else getting noticeable audio feedback. Current test with KL series, today, are not yielding this noticeable issue; thus plays fine on KLA...

P.S. There are no other issues seen in F96 v4, currently.

Last edited by Clarity on Mon Apr 03, 2023 7:49 pm, edited 2 times in total.
Clarity
Posts: 3844
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1633 times
Been thanked: 527 times

Re: Audio cracking in qemu

Post by Clarity »

Strange...Today, using F96v4, I am NOT having issues. I started

  1. by booting pristine in QEMU

  2. FirstRUN setup

  3. first media test by playing an MP3 by clicking it in ROX. This played without background 'crackling'.

  4. after listening and closing the MP3 file, I played the MP4. This, too, played now without background 'crackling'.

This test is played using a FossaPUP64 bare-metal hosting the QEMU VM for F96 on an HP Intel desktop. (I would expect this same result no matter which Linux distro would be hosting the VM.)

I am not able to recreate yesterday's report from testing. ???

I RETRACT my prior test report post.

User avatar
rockedge
Site Admin
Posts: 6556
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2760 times
Been thanked: 2640 times
Contact:

Re: Audio cracking in qemu

Post by rockedge »

@Clarity around here they call it the "ghost in the machine"

User avatar
mr_gs
Posts: 38
Joined: Tue Dec 14, 2021 6:39 am
Has thanked: 7 times
Been thanked: 8 times

Re: Audio cracking in qemu

Post by mr_gs »

Today I booted puppy with pfix=ram. Then I installed qemu from quickpet. After that I started my android x86 vm and to my surprise the sound has no problem. It works! :thumbup: . It works well with ALSA.

The reason why I was using pulseaudio:
After installing firefox in puppy, I noticed that there's no audio for youtube. Then I searched in forum and I guy told me to create a bash script in /usr/local/bin/ with

Code: Select all

apulse firefox "$@"

. That issue was solved :)
But another day while running firefox and vlc, there was no audio for vlc. I closed firefox and started vlc again. This time there was audio for vlc.(The one who runs first can play audio). I searched google and found that in ALSA multiple processes can't use a sound card(They said it like that) and pulseaudio was the solution because it acts like a server. Then I installed pulseaudio from puppy package manager, did some tweaks and made it run.

Without pulseaudio is there any way solve my above problem(multiple processes to use same sound card)?

Fossapup 9.5 64bit Kernel 5.4.53
Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz
8GB RAM
Intel (R) UHD Graphics

Clarity
Posts: 3844
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1633 times
Been thanked: 527 times

Re: Audio cracking in qemu

Post by Clarity »

Try booting F96CE v4 ISO file in your VM.

2 apps with active audio experience
2 apps with active audio experience
Screenshot.png (361.58 KiB) Viewed 984 times

Hope this experience is helpful.

Post Reply

Return to “Fossapup64”