Bug 684149

Summary: Sound record failed in windows guest with spice and vnc
Product: Red Hat Enterprise Linux 6 Reporter: Shaolong Hu <shu>
Component: qemu-kvmAssignee: Gerd Hoffmann <kraxel>
Status: CLOSED WORKSFORME QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: juzhang, michen, mkenneth, tburke, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-06-09 19:45:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 711810    
Bug Blocks:    

Description Shaolong Hu 2011-03-11 10:21:25 UTC
Description of problem:
------------------------
Record sound in win7_32 guest with spice, then play it, it's noise. It's the same with vnc.


Version-Release number of selected component (if applicable):
--------------------------------------------------------------
Host:
2.6.32-118.el6.x86_64
qemu-kvm-0.12.1.2-2.149.el6.x86_64

Guest:
win7_32bit


How reproducible:
-----------------
100%


Steps to Reproduce:
--------------------
1. Boot guest with:

/usr/libexec/qemu-kvm -M rhel6.1.0 -enable-kvm -m 8G -smp 4 -name win7-32-qcow2 -uuid `uuidgen` -rtc base=utc -boot order=cd -drive file=./win7-32-virtio.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,werror=stop,rerror=stop -device virtio-blk-pci,drive=drive-virtio-disk0,id=virtio-disk0 -netdev tap,script=/etc/qemu-ifup,id=hostnet0 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:7b:a2:fa -usb -device usb-tablet,id=input0 -monitor stdio -device intel-hda,id=sound0,bus=pci.0 -device hda-duplex -spice port=5910,disable-ticketing

2. Connect microphone to host, on the host:

spicec -h 127.0.0.1 -p 5910

3. Record sound in the guest with Sound Recorder.


Actual results:
----------------
Recorded length of step 3 is bigger than actual length, timer on Sound Recorder
moves correctly, and properties of sound file suggests the length of the sound file is correct, but it can play far more longer, and the recorded sound is noise.


Expected results:
------------------
Recorded sound should be correct.


Additional info:
-----------------
Change -spice to -vnc, use vncviewer to connect and record, it's the same.
Reference to another bug 683736, the situation is a little different.

Comment 2 Dor Laor 2011-03-17 14:16:01 UTC
What's the result when ac97 card is used?

Comment 3 Shaolong Hu 2011-03-18 13:39:15 UTC
(In reply to comment #2)
> What's the result when ac97 card is used?

Cannot record sound with ac97, only for intel-hda.

Comment 5 Gerd Hoffmann 2011-06-01 15:42:46 UTC
Not investigated yet.  Most likely nothing major and easy to fix.  Setting CondNACK just in case it turns out to be more complicated ...

Comment 6 Gerd Hoffmann 2011-06-09 13:18:42 UTC
Please re-test with the RHEL-6.1.

Also please include details on the host audio setup (most importantly the QEMU_AUDIO_DRV environment variable) and the spice client application used.

RHEL 6.1 qemu-kvm should route sound via spice by default in case spice support is enabled, i.e. the spice client handles sound recording and playback.

spicec doesn't play nicely with pulseaudio (bug 711810).
spicy client (from spice-gtk) can be used instead, packages are here: http://koji.fedoraproject.org/koji/buildinfo?buildID=245423

Both recording and playback works with both ac97 (winxp guest) and intel-hda (rhel6 guest) in my testing.  Will try win7 guest + intel-hda too.

Comment 7 Gerd Hoffmann 2011-06-09 14:31:47 UTC
Hmm, win7 guest shows strage behavior after recording something.  Playback the just recorded sound and also the windows sample sounds is dissorted and way too slow.

Comment 8 Gerd Hoffmann 2011-06-09 19:45:12 UTC
Comment #7 issue seems happen due to spice client issues, when the sound setup on the spice client side works flawlessly I can record and playback sound in win7 just fine.

I'm using spicec for testing and take care that nothing else records sound to workaround bug 711810.

If you still have problems please reopen the bug and fill in the glory details needed to reproduce.