[libvirt] guests and pulseaudio fighting over audio devices

Dave Allan dallan at redhat.com
Thu Sep 17 14:00:29 UTC 2009


Daniel P. Berrange wrote:
> On Tue, Sep 15, 2009 at 04:45:31PM -0400, Dave Allan wrote:
>> I noticed that when a KVM guest created with virt-manager is running on 
>> F10, sound on the physical host stops working.  When all VMs are 
>> shutdown, sound starts working again.  Removing the <sound> tag from the 
>> VM XML allows sound to work while the VM is booted.  To further 
>> complicate troubleshooting, if audio is already playing when the guest 
>> is started it keeps playing, since pulse already has the device open.
>>
>> The message in /var/log/messages when I try to play audio is:
>>
>> pulseaudio[6492]: module-alsa-sink.c: Error opening PCM device front:0: 
>> Device or resource busy
>>
>> strace of pulseaudio shows:
>>
>> open("/dev/snd/pcmC0D0p", O_RDWR|O_NONBLOCK) = -1 EBUSY (Device or 
>> resource busy)
>>
>> but fuser and lsof show nothing.  A trivial test program also sees 
>> Device or resource busy when trying to open /dev/snd/pcmC0D0p
>>
>> I am in favor of removing the <sound> tag from the default 
>> configuration, since I don't use sound from within guests and I do use 
>> sound on my desktop, but perhaps this behavior is specific to my 
>> configuration.  I haven't investigated it exhaustively.  What does 
>> everybody else think?
> 
> It is complicated :-)  In Fedora >= 11 we currently disable all use of
> sound cards, but this upsets people who want sound ;-P  I'm working
> on a new version of the patch which sets up audio-over-VNC, while for
> SDL allows the host audio backend to be used & configured.
> 
> I still need to finish my GTK-VNC patches to do the client end of 
> audio over VNC, then it'll all play correctly with desktop audio
> services via gstreamer/pulseaudio

Sounds good--I'm looking forward to it (not that I really use sound in 
VMs, but that sounds like the right way to do it.)

Dave




More information about the libvir-list mailing list