Bug 683736

Summary: Asynchronous when recording sound inside kvm guest with vnc console
Product: Red Hat Enterprise Linux 7 Reporter: Shaolong Hu <shu>
Component: qemu-kvmAssignee: Gerd Hoffmann <kraxel>
Status: CLOSED WONTFIX QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 7.0CC: areis, juzhang, michen, mkenneth, tburke, virt-maint, xfu
Target Milestone: rc   
Target Release: 7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-30 09:49:17 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 Shaolong Hu 2011-03-10 08:45:28 UTC
Description of problem:
------------------------
Connect microphone to host, boot a guest, connect guest with vnc on the host, record sound in the guest, sound recorded in the guest has big latency.


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:
2.6.32-118.el6.i686


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 RHEL-Server-6.1-32 -uuid `uuidgen` -rtc base=utc,clock=host,driftfix=slew -no-kvm-pit-reinjection -boot order=cd -drive file=./RHEL6.1-32-qcow2,if=none,id=drive-ide-disk0,format=qcow2,cache=none,werror=stop,rerror=stop -device ide-drive,drive=drive-ide-disk0,id=ide-disk0 -netdev tap,script=/etc/qemu-ifup,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:7b:a2:fa -usb -device usb-tablet,id=input0 -monitor stdio -balloon none -device intel-hda,id=sound0,bus=pci.0 -device hda-duplex -vnc :10

2. Connect microphone to host, on the host:

vncviewer :10

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 faster than real time. There is big latency of sound recorded, for you say "one, two, three", stop recording and play, there is nothing, than resume recording, say "four, five, six", stop recording and play, it plays "one, two, three". 


Expected results:
------------------
Recorded sound should has no latency, timer of Sound Recorder should move correctly.


Additional info:
-----------------
Same command line with -spice, sound recorded correctly.
With win7_32 guest, SoundRecorder's timer moves correctly with both spice and vnc, but recorded sound is noise.

Comment 3 Gerd Hoffmann 2011-06-01 16:05:52 UTC
With luck this is the same as 684149.

If not this will go pretty much to the bottom of the priority list as sound without spice is not supported.

Comment 4 Gerd Hoffmann 2011-06-08 14:31:59 UTC
which app you are using to record sound with the rhel6 guest?

Comment 5 Gerd Hoffmann 2011-06-09 12:59:42 UTC
Found it, gnome-media-apps carries the sound recorder app.

Comment 6 Gerd Hoffmann 2011-06-09 13:08:48 UTC
How does the host-side audio configuration look like?

Do you use alsa?  Or pulseaudio?
See "qemu -audio-help" for more info on audio setup.

Comment 7 FuXiangChun 2011-06-10 10:26:48 UTC
Hi Gerd
   i am trying to reproduce it with alsa and pulseaudio. i will update testing result to bz next monday.

Comment 8 FuXiangChun 2011-06-10 11:26:01 UTC
(In reply to comment #6)
> How does the host-side audio configuration look like?
> 
> Do you use alsa?  Or pulseaudio?
> See "qemu -audio-help" for more info on audio setup.


use alsa and pulseaudio all can reproduce this bug. 

host info:
# uname -r
2.6.32-156.el6.x86_64
#rpm -qa|grep kvm
qemu-kvm-0.12.1.2-2.164.el6.x86_64

guest(rhel6.1 32bit) info:
# uname -r
2.6.32-131.0.15.el6.i686

steps to reproduce
1.QEMU_AUDIO_DRV=alsa or QEMU_AUDIO_DRV=pulseaudio
2. start vm 
/usr/libexec/qemu-kvm -M rhel6.1.0 -enable-kvm -m 8G -smp 4 -name RHEL-Server-6.1-32 -uuid dc170b25-7559-4383-a691-e9f8deb45ab8 -rtc base=utc,clock=host,driftfix=slew -no-kvm-pit-reinjection -boot order=c -drive file=RHEL6.1-32-qcow2,if=none,id=drive-ide-disk0,format=qcow2,cache=none,werror=stop,rerror=stop -device ide-drive,drive=drive-ide-disk0,id=ide-disk0 -netdev tap,script=/etc/qemu-ifup,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:7b:a2:fa -usb -device usb-tablet,id=input0 -monitor stdio -balloon none -device intel-hda,id=sound0,bus=pci.0 -device hda-duplex -vnc :10

Comment 9 Gerd Hoffmann 2011-06-14 08:52:16 UTC
You need "export QEMU_AUDIO_DRV=..." otherwise qemu does't see it.
The pulseaudio driver is named "pa" btw.

Comment 10 Shaolong Hu 2011-07-28 08:01:05 UTC
Hi Gerd,

I am back, see this is here a long time, i tried with the latest qemu-kvm:
qemu-kvm-0.12.1.2-2.172.el6.x86_64
2.6.32-171.el6.x86_64

when i export QEMU_AUDIO_DRV=pa, i can reproduce it, when i use alsa, it keeps prompting "alsa: Unexpected state 1", guest acts slowly, especially when i use Sound Reorder.

Comment 15 Gerd Hoffmann 2013-03-20 14:41:42 UTC
Sound with vnc is unsupported, lowering priority.