I've been working on GTK-VNC to make it able to receive the audio stream from the remote VNC server, and decided to compare the quality against the current KVM host audio support. At which point I discovered that, AFAICT, the latter does not work in the slightest.
I know that when running KVM guests with VNC under libvirt, you will not get any sound because I disabled that bit of code :-) It is guests using SDL graphics I'm interested in. eg, running a really simple guest like
/usr/bin/qemu-kvm -m 700 -smp 1 -boot c -drive file=/home/berrange/f11i686.img,if=virtio,index=0,boot=on -vga cirrus -soundhw ac97 -sdl
I have tested both ac97, and es1370 sound cards. I have tested with the default QEMU host audio backend (pulseaudio), and with also tested with each of the following settings on the host
<no env set> QEMU_AUDIO_DRV=pa QEMU_AUDIO_DRV=alsa QEMU_AUDIO_DRV=sdl QEMU_AUDIO_DRV=sdl SDL_AUDIODRIVER=pa QEMU_AUDIO_DRV=sdl SDL_AUDIODRIVER=alsa
NB, they all ultimately go to pulseaudio on the host since it has its alsa proxy installed
All of them appear to be more or less just as bad as each other. Inside the guest I'm running a boring old F11 i686 guest. I removed pulseaudio inside the guest and run 'mpg321' on the native alsa drivers. If you include the '-v' flag to mpg321, it shows its playback progress. What I'm seeing is that for the first 10 seconds or so its timer runs at 1/2 the actual speed, and then it speeds up exponentially taking a mere 10 seconds for the remaining 2 minutes of the mp3.
Does anyone successfully have KVM on Fedora 12 playing audio when using the SDL display ? AFAICT, audio is just totally & utterly fubar, with SDL and any of the host audio drivers. So if anyone has it working reliably please tell me what, if any, QEMU_AUDIO_DRV / SDL_AUDIODRIVER env variables you have set, what guest OS you use, and what program you are using for playback in the guest. Also on the host, whether you have pulse audio (the default for F12), or are using native ALSA directly.
On the plus side, by comparison, my code for streaming audio to GTK-VNC is managing to playback at pretty much native speed, with only a few dropouts in buffering
Daniel
On Tue, Nov 24, 2009 at 12:13 PM, Daniel P. Berrange berrange@redhat.comwrote:
On the plus side, by comparison, my code for streaming audio to GTK-VNC is managing to playback at pretty much native speed, with only a few dropouts in buffering
Hi Daniel,
It won't answer your question, but just as a comment: I never got these things to work nicely and automatically. The only way I managed to get more or less reliable sound from my linux boxes were to have Pulseaudio inside the guest and use the host pulseaudio daemon over network.
Emre