qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] USB streaming [Re: [PATCH 18/18] usb: add ehci adapter]


From: Hans de Goede
Subject: Re: [Qemu-devel] USB streaming [Re: [PATCH 18/18] usb: add ehci adapter]
Date: Tue, 17 May 2011 20:44:39 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc15 Lightning/1.0b2 Thunderbird/3.1.10

Hi,

On 05/17/2011 07:43 PM, David Ahern wrote:
On 05/17/11 11:36, Hans de Goede wrote:
Very likely it won't be needed both the guest OS, as well as any
emulated hardware (or redirection code) will be doing some amount of
buffering. Normal bufferering for usb video devices is 32 iso packets
per urb and then 2-4 queued urbs, so that means that the OS does not
even ask to be bothered with iso transfers till 32 of them have completed,
or in other words 4 ms have passed in the usb 2 case with an endpoint
with the lowest possible interval.

I got audio streaming working nicely through UHCI in early 2010. The
qemu patch is:
http://www.mail-archive.com/address@hidden/msg28185.html

I noticed a lot of timing issues related to when the UHCI frame timer
ran and saw the pending requests from the guest.

Given the nature of isoc data streams, tricks like you did can only
go so far. If you look at the patches which I did for isochroneous
data buffering, which are in kraxel's latest usb pull request
(tested with usb 1 webcams and audio devices), you see that they add a
small fifo between the real device and the emulated uhci controller,
this allows to handle iso request synchronously by simply
taking the next packet from the buffer for input streams, or storing it
into the buffer for output streams.

With these patches in place I can significantly lower the wakeup rate
of the UHCI emulation (and handle multiple frames at once on wakeup
without any ill effects and a nice drop in CPU load.

Note that once every while a packet will get lost since normally a usb
device is synced to the usb frame timer, but the real and emulated frame timer
are not synced, so eventually a packet will get lost.

Regards,

Hans



reply via email to

[Prev in Thread] Current Thread [Next in Thread]