* [Qemu-devel] husb: out of buffers for iso stream
@ 2011-11-19 19:40 Stefan Hajnoczi
2011-11-23 16:01 ` Gerd Hoffmann
0 siblings, 1 reply; 7+ messages in thread
From: Stefan Hajnoczi @ 2011-11-19 19:40 UTC (permalink / raw)
To: Gerd Hoffmann, Hans de Goede; +Cc: qemu-devel
I have a Windows 7 VM running a sound driver for a passthrough USB
host device. The driver submits iso in and out urbs to do audio
capture and playback at the same time.
Audacity running inside the guest freezes and does not record audio
unless I move the mouse. Somehow it seems USB iso urbs aren't being
pumped unless I keep moving the mouse. The VM is using VNC.
Checking the QEMU stderr logs I see many occurrences of "husb: out of
buffers for iso stream". Perhaps this message is enough to pinpoint
the problem?
Otherwise please let me know and I'll collect usbmon tcpdump or other
debugging information. I am running qemu.git/master
(bc4268998d154b9b3cc86a7b6bd932cc974591c9).
Thanks,
Stefan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] husb: out of buffers for iso stream
2011-11-19 19:40 [Qemu-devel] husb: out of buffers for iso stream Stefan Hajnoczi
@ 2011-11-23 16:01 ` Gerd Hoffmann
2011-11-24 9:04 ` Stefan Hajnoczi
2011-11-24 9:43 ` Peter Maydell
0 siblings, 2 replies; 7+ messages in thread
From: Gerd Hoffmann @ 2011-11-23 16:01 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: Hans de Goede, qemu-devel
On 11/19/11 20:40, Stefan Hajnoczi wrote:
> I have a Windows 7 VM running a sound driver for a passthrough USB
> host device. The driver submits iso in and out urbs to do audio
> capture and playback at the same time.
>
> Audacity running inside the guest freezes and does not record audio
> unless I move the mouse. Somehow it seems USB iso urbs aren't being
> pumped unless I keep moving the mouse. The VM is using VNC.
I have no idea how moving the mouse could possibly help here.
> Checking the QEMU stderr logs I see many occurrences of "husb: out of
> buffers for iso stream". Perhaps this message is enough to pinpoint
> the problem?
It means the number of buffers in flight (on the host side) went down to
zero, i.e. the stream is interrupted.
usb-host maintains a set of buffers (four by default) per iso endpoint
to keep the constant data flow up, i.e. pass one buffer to the guest
while the host fills the next one. Now the host has no more buffers to
fill. Most likely usb-host sits on a bunch of full buffers which it
hasn't passed to the guest yet.
For starter try a higher number of buffers (isobufs property).
Also make sure you enable the vnc thread (unless you have already).
cheers,
Gerd
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] husb: out of buffers for iso stream
2011-11-23 16:01 ` Gerd Hoffmann
@ 2011-11-24 9:04 ` Stefan Hajnoczi
2011-11-30 13:52 ` Stefan Hajnoczi
2011-11-24 9:43 ` Peter Maydell
1 sibling, 1 reply; 7+ messages in thread
From: Stefan Hajnoczi @ 2011-11-24 9:04 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: Hans de Goede, qemu-devel
On Wed, Nov 23, 2011 at 4:01 PM, Gerd Hoffmann <kraxel@redhat.com> wrote:
> On 11/19/11 20:40, Stefan Hajnoczi wrote:
>> I have a Windows 7 VM running a sound driver for a passthrough USB
>> host device. The driver submits iso in and out urbs to do audio
>> capture and playback at the same time.
>>
>> Audacity running inside the guest freezes and does not record audio
>> unless I move the mouse. Somehow it seems USB iso urbs aren't being
>> pumped unless I keep moving the mouse. The VM is using VNC.
>
> I have no idea how moving the mouse could possibly help here.
It may be unrelated :). This is the only error message I saw in the logs.
>> Checking the QEMU stderr logs I see many occurrences of "husb: out of
>> buffers for iso stream". Perhaps this message is enough to pinpoint
>> the problem?
>
> It means the number of buffers in flight (on the host side) went down to
> zero, i.e. the stream is interrupted.
>
> usb-host maintains a set of buffers (four by default) per iso endpoint
> to keep the constant data flow up, i.e. pass one buffer to the guest
> while the host fills the next one. Now the host has no more buffers to
> fill. Most likely usb-host sits on a bunch of full buffers which it
> hasn't passed to the guest yet.
Okay. The audio device is designed to fill a 288 byte iso buffer
every millisecond, although applications typically use larger
power-of-2 buffer sizes.
> For starter try a higher number of buffers (isobufs property).
> Also make sure you enable the vnc thread (unless you have already).
Thanks, I'll try this.
Stefan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] husb: out of buffers for iso stream
2011-11-23 16:01 ` Gerd Hoffmann
2011-11-24 9:04 ` Stefan Hajnoczi
@ 2011-11-24 9:43 ` Peter Maydell
2011-11-24 11:11 ` Stefan Hajnoczi
1 sibling, 1 reply; 7+ messages in thread
From: Peter Maydell @ 2011-11-24 9:43 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: Stefan Hajnoczi, qemu-devel, Hans de Goede
On 23 November 2011 16:01, Gerd Hoffmann <kraxel@redhat.com> wrote:
> On 11/19/11 20:40, Stefan Hajnoczi wrote:
>> Audacity running inside the guest freezes and does not record audio
>> unless I move the mouse. Somehow it seems USB iso urbs aren't being
>> pumped unless I keep moving the mouse. The VM is using VNC.
>
> I have no idea how moving the mouse could possibly help here.
Something went into USB suspend and the mouse can wake it
back up but the audio source can't, maybe? (wild guess)
-- PMM
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] husb: out of buffers for iso stream
2011-11-24 9:43 ` Peter Maydell
@ 2011-11-24 11:11 ` Stefan Hajnoczi
0 siblings, 0 replies; 7+ messages in thread
From: Stefan Hajnoczi @ 2011-11-24 11:11 UTC (permalink / raw)
To: Peter Maydell; +Cc: Hans de Goede, Gerd Hoffmann, qemu-devel
On Thu, Nov 24, 2011 at 9:43 AM, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 23 November 2011 16:01, Gerd Hoffmann <kraxel@redhat.com> wrote:
>> On 11/19/11 20:40, Stefan Hajnoczi wrote:
>>> Audacity running inside the guest freezes and does not record audio
>>> unless I move the mouse. Somehow it seems USB iso urbs aren't being
>>> pumped unless I keep moving the mouse. The VM is using VNC.
>>
>> I have no idea how moving the mouse could possibly help here.
>
> Something went into USB suspend and the mouse can wake it
> back up but the audio source can't, maybe? (wild guess)
I guess what's special about the audio is that it uses isochronous
messages, not interrupt or bulk like many other devices.
Stefan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] husb: out of buffers for iso stream
2011-11-24 9:04 ` Stefan Hajnoczi
@ 2011-11-30 13:52 ` Stefan Hajnoczi
2011-11-30 15:45 ` Gerd Hoffmann
0 siblings, 1 reply; 7+ messages in thread
From: Stefan Hajnoczi @ 2011-11-30 13:52 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: Hans de Goede, qemu-devel
On Thu, Nov 24, 2011 at 9:04 AM, Stefan Hajnoczi <stefanha@gmail.com> wrote:
> On Wed, Nov 23, 2011 at 4:01 PM, Gerd Hoffmann <kraxel@redhat.com> wrote:
>> For starter try a higher number of buffers (isobufs property).
>> Also make sure you enable the vnc thread (unless you have already).
Tested with vnc thread and isobufs=32. This time the stderr output is:
USBDEVFS_SUBMITURB: File too large [several times, followed by...]
husb: out of buffers for iso stream [many times]
I can still ping the guest and issue QEMU monitor commands while the
display and audio appear to be frozen. Moving the mouse makes it the
audio responsive again.
Next I disabled USB tablet in case there is an interaction between USB
passthrough and the emulated tablet. The audio still gets stuck but
moving the mouse no longer helps. So the mouse is just a distraction,
iso buffers are simply not working and USB table emulation somehow
"kicks" guest USB back into action.
Then I tested playback and capture separately in case it was specific
to just one data direction, but both playback and capture freeze in
the same way. (Playback means the guest is handing filled out iso
buffers to the device. Capture means the guest is asking the device
to fill in iso buffers.)
Any suggestions where to go from here?
Stefan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] husb: out of buffers for iso stream
2011-11-30 13:52 ` Stefan Hajnoczi
@ 2011-11-30 15:45 ` Gerd Hoffmann
0 siblings, 0 replies; 7+ messages in thread
From: Gerd Hoffmann @ 2011-11-30 15:45 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: Hans de Goede, qemu-devel
On 11/30/11 14:52, Stefan Hajnoczi wrote:
> On Thu, Nov 24, 2011 at 9:04 AM, Stefan Hajnoczi <stefanha@gmail.com> wrote:
>> On Wed, Nov 23, 2011 at 4:01 PM, Gerd Hoffmann <kraxel@redhat.com> wrote:
>>> For starter try a higher number of buffers (isobufs property).
>>> Also make sure you enable the vnc thread (unless you have already).
>
> Tested with vnc thread and isobufs=32. This time the stderr output is:
> USBDEVFS_SUBMITURB: File too large [several times, followed by...]
> husb: out of buffers for iso stream [many times]
"File too large" could mean that there are too many bufs submitted, try
making isobufs smaller.
> I can still ping the guest and issue QEMU monitor commands while the
> display and audio appear to be frozen. Moving the mouse makes it the
> audio responsive again.
Display frozen too? Hmm. Totaly frozen? Or is this input level meter
stop changing?
> Next I disabled USB tablet in case there is an interaction between USB
> passthrough and the emulated tablet. The audio still gets stuck but
> moving the mouse no longer helps. So the mouse is just a distraction,
> iso buffers are simply not working and USB table emulation somehow
> "kicks" guest USB back into action.
Is the usb sound device usb 1.1 or usb 2.0? Works it ok on the host?
> Then I tested playback and capture separately in case it was specific
> to just one data direction, but both playback and capture freeze in
> the same way. (Playback means the guest is handing filled out iso
> buffers to the device. Capture means the guest is asking the device
> to fill in iso buffers.)
>
> Any suggestions where to go from here?
For starters try enabling usb-host trace points ...
cheers,
Gerd
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-11-30 15:45 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-19 19:40 [Qemu-devel] husb: out of buffers for iso stream Stefan Hajnoczi
2011-11-23 16:01 ` Gerd Hoffmann
2011-11-24 9:04 ` Stefan Hajnoczi
2011-11-30 13:52 ` Stefan Hajnoczi
2011-11-30 15:45 ` Gerd Hoffmann
2011-11-24 9:43 ` Peter Maydell
2011-11-24 11:11 ` Stefan Hajnoczi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).