qemu-devel
[Top][All Lists]
Advanced

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

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


From: David Ahern
Subject: [Qemu-devel] USB streaming [Re: [PATCH 18/18] usb: add ehci adapter]
Date: Tue, 17 May 2011 11:43:07 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110421 Fedora/3.1.9-2.fc14 Thunderbird/3.1.9

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. If they lose sync (ie.,
the guest is not appending them before the qemu code passes that frame),
you get a 1+ second delay as the UHCI code in qemu cycled through the
frames coming back to the frame holding the request from the guest OS.
One of the key changes for the audio streaming to work was setting the
expire_time  immediately and not at the end of the frame_timer function:

 static void uhci_frame_timer(void *opaque)
 {
     UHCIState *s = opaque;
-    int64_t expire_time;
+
+    /* prepare the timer for the next frame */
+    s->expire_time += (get_ticks_per_sec() / FRAME_TIMER_FREQ);

David

> 
> Regards,
> 
> Hans



reply via email to

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