Bug 635401

Summary: spice client not playing audio
Product: [Fedora] Fedora Reporter: Tom Horsley <horsley1953>
Component: spiceAssignee: Gerd Hoffmann <kraxel>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 14CC: alexl, jforbes, kraxel
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-09-20 07:43:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Tom Horsley 2010-09-19 12:58:29 UTC
Description of problem:

I'm running a Windows XP KVM with spice enabled, but the spice client does
not seem to make any attempt to play audio. I see libasound.so is one of
the libraries linked with spicec, and the "aplay" program also uses libasound.
I can play sounds via aplay with no problem, and the "Alsa Plugin" shows up
in the Applications tab of the Sound Preferences dialog when I do, but
nothing happens when I play sounds inside the KVM.

I'm using a wrapper program to start the spice enabled qemu process via
libvirt. The wrapper fiddles the qemu command line to disable VNC and
enable spice. Here's the command line that actually runs:

/usr/bin/qemu-kvm -S -M pc-0.13 -enable-kvm -m 1024 -smp 2,sockets=2,cores=1,threads=1 -name newxp -uuid 56bf8244-94fc-c33b-5530-1c88082e992f -nodefconfig -nodefaults -chardev socket,id=monitor,path=/var/lib/libvirt/qemu/newxp.monitor,server,nowait -mon chardev=monitor,mode=readline -rtc base=localtime -boot c -drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -drive file=/zooty/images/new-winxp.img,if=none,id=drive-ide0-0-0,boot=on -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 -device rtl8139,vlan=0,id=net0,mac=52:54:00:89:73:85,bus=pci.0,addr=0x5 -net tap,fd=46,vlan=0,name=hostnet0 -usb -device usb-tablet,id=input0 -spice port=5930,disable-ticketing -global qxl.revision=2 -vga qxl -device AC97,id=sound0,bus=pci.0,addr=0x4 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3

Version-Release number of selected component (if applicable):
spice-client-0.6.0-1.fc14.x86_64
spice-server-0.6.0-1.fc14.x86_64


How reproducible:
Tried many times, never got any sound.

Steps to Reproduce:
1.see above
2.
3.
  
Actual results:
no sound

Expected results:
spice client playing the sounds from inside the Windows XP KVM.

Additional info:

Here's the entry from the qemu log:

LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin QEMU_AUDIO_DRV=none /usr/bin/qemu-spice-wrapper -S -M pc-0.13 -enable-kvm -m 1024 -smp 2,sockets=2,cores=1,threads=1 -name newxp -uuid 56bf8244-94fc-c33b-5530-1c88082e992f -nodefconfig -nodefaults -chardev socket,id=monitor,path=/var/lib/libvirt/qemu/newxp.monitor,server,nowait -mon chardev=monitor,mode=readline -rtc base=localtime -boot c -drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -drive file=/zooty/images/new-winxp.img,if=none,id=drive-ide0-0-0,boot=on -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 -device rtl8139,vlan=0,id=net0,mac=52:54:00:89:73:85,bus=pci.0,addr=0x5 -net tap,fd=46,vlan=0,name=hostnet0 -usb -device usb-tablet,id=input0 -vnc 127.0.0.1:0 -vga std -device AC97,id=sound0,bus=pci.0,addr=0x4 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 
do_spice_init: starting 0.6.0
spice_server_add_interface: SPICE_INTERFACE_KEYBOARD
spice_server_add_interface: SPICE_INTERFACE_MOUSE
mouse_mode_notifier: absolute pointer: not available
spice_server_add_interface: SPICE_INTERFACE_QXL
red_worker_main: begin
mouse_mode_notifier: absolute pointer: present
handle_dev_destroy_surfaces: 
handle_dev_input: start
mouse_mode_notifier: absolute pointer: present+active
mouse_mode_notifier: using absolute pointer (client mode)
spice_server_add_interface: SPICE_INTERFACE_TABLET
tablet_set_logical_size: 640x480
handle_dev_destroy_surfaces: 
tablet_set_logical_size: 640x480
tablet_set_logical_size: 0x0
tablet_set_logical_size: 1280x1024

Comment 1 Gerd Hoffmann 2010-09-20 07:43:08 UTC
QEMU_AUDIO_DRV=none

That is the reason.  QEMU will send all audio to /dev/null then.

Stick "export QEMU_AUDIO_DRV=spice" into /usr/bin/qemu-spice-wrapper
and it will work just fine.

Comment 2 Tom Horsley 2010-09-20 09:42:12 UTC
Thanks. I guess I couldn't see that in all the noise. I needed another pair of eyes to point out the obvious :-).