QEMU soundhw HDA huge microphone lag

Bug #1492649 reported by Nek on 2015-09-05
38
This bug affects 7 people
Affects Status Importance Assigned to Milestone
QEMU
Undecided
Unassigned

Bug Description

I use a Windows 7 x86_64 guest with VGA passthrough and -soundhw hda. The audio plays fine, but the microphone input is delayed by more than 20 seconds.

-soundhw ac97 does not have this delay but it has choppy sound playback and input.

System:
Arch linux
Kernel: 4.1.6-1-ARCH
Audio hardware: 00:1b.0 Audio device: Intel Corporation 82801JI (ICH10 Family) HD Audio Controller
Audio system: Pulseaudio 6.0

I seem to have this issue too. Using latest 15.04 Ubuntu, qemu and -soundhw all.

tinyhitman (custin) wrote :

I can reproduce this on Windows 10 (64bit) with hda device.

Host kernel is 4.1.13-rt15-1-rt, also tried with non-realtime kernel with same results.

Output works without delay, given it is choppy from time to time.
Using the following env vars when starting QEMU:

QEMU_AUDIO_DRV: pa
QEMU_PA_SAMPLE: 32 # also tried with 128, 256, 512 and 1024. Same results for input, output got less choppy but with notable latency
QEMU_PA_SERVER: unix:/run/user/1000/pulse/native # where user with uid is the user with Xorg and PA session, of course.

Glenn Sommer (glemsom) wrote :

I cannot figure out why - but, it would seem the input ringbuffer is not processed till the buffer is full.
As an ugly workaround, i tried to set the buffering attributes to the input section - which reduced the delay to less then a second. (important part here is ba.maxlength)

Jonathan Rubenstein (jjrcop) wrote :

I've got this issue too on windows 10 with QEMU emulator version 3.1.0 (Debian 1:3.1+dfsg-4). It seems to only occur when the device isn't used in the windows host for a while by any application. If an application opens the capture device, the delay slowly gets smaller until it's only a 4th of a second.

My uneducated guess is that the pa/hda driver isn't dequeuing the buffer unless the device is opened and being used by an application. This should not be happening, it should move the read pointer to the sample length even if the device isn't being used.

Jonathan Rubenstein (jjrcop) wrote :

Proofread your comments, guys... oops

So it's a debian HOST and windows GUEST, not windows host. :-l

Sorry for the double post.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers