[fedora-virt] Losing sound in Win XP qemu-kvm guest

jah jah.pub at clan-rum.org
Wed Jun 2 14:49:14 UTC 2010


I'm running a Windows XP (32-bit) guest on my Fedora 13 x86_64 Gnome 
desktop system using command line qemu-kvm.  In XP I'm using the Sound 
Blaster card as the default as it has better sound.  The Intel card 
warbles and the sound breaks up.  After running the guest for a day or 
two I lose sound.  If I switch to the Intel card I get sound back but 
like I said, the Intel card doesn't work as well.  I have a multiboot 
system and when I boot into Gentoo I have the same problem if I run KVM 
as a module.   When it's compiled into the kernel I do not have this 
problem.  In Gentoo the Intel card seems to have better sound but 
switching cards after loosing sound doesn't usually restore it.  I log 
into Gnome using my non-privileged account but run qemu-kvm as root (my 
user is in the kvm and audio groups however) using this command line:

/bin/nice -n-19 /usr/bin/qemu-kvm \
  -hda ${DIR}/${IMAGE} \
  -vga std \
  -no-quit \
  -no-frame \
  -name "Windows XP" \
  -usb \
  -usbdevice tablet \
  -daemonize \
  -soundhw all \
  -localtime \
  -m 3584 \
  -mem-path /hugepages \
  -monitor telnet:127.0.0.1:4444,server,nowait \
  -net nic,vlan=0,model=virtio,macaddr=00:1b:fc:9a:75:21 \
  -net tap,vlan=0

selinux is running in permissive mode.  I have an Asus M2R32-MVP 
motherboard with integrated audio, 8gb memory and an AMD Phenom 9950 
Quad-Core Processor.  The audio device is:

00:14.2 Audio device: ATI Technologies Inc SBx00 Azalia (Intel HDA)
     Subsystem: ATI Technologies Inc SBx00 Azalia (Intel HDA)
     Flags: bus master, slow devsel, latency 64, IRQ 31
     Memory at f7bf4000 (64-bit, non-prefetchable) [size=16K]
     Capabilities: [50] Power Management version 2
     Capabilities: [60] MSI: Enable+ Count=1/1 Maskable- 64bit+
     Kernel driver in use: HDA Intel
     Kernel modules: snd-hda-intel

My script exports QEMU_AUDIO_DRV=alsa before starting the guest.  I just 
realized that I forgot to change it to QEMU_AUDIO_DRV=pa when I starting 
using Fedora.  Obviously it still works set as alsa and I doubt that is 
the cause of my problem since I have the same problem in Gentoo when 
running KVM as a module.  I'll give QEMU_AUDIO_DRV=pa a try the next 
time I restart the guest but would appreciate any info on known issues 
or advise on the best audio settings so that hopefully I won't lose my 
sound.  I have dual monitors and leave XP running all the time on the 
right monitor.  I long for the day when I don't have anything that needs 
to run in Windows and I can be Microsoft free but in the mean time 
running XP in a virtual jail is a lot better than running it natively.  
Getting sound working correctly would be nice in the mean time.

-jah



More information about the virt mailing list