aboutsummaryrefslogtreecommitdiff
path: root/oslib-win32.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2010-11-26 11:41:08 +0100
committerGerd Hoffmann <kraxel@redhat.com>2011-05-04 12:25:24 +0200
commit060dc841d117e2a2868ef50d0d30e01c90051a6f (patch)
treef74cedab0d4643590eeb4252f83634bfaeb6e0be /oslib-win32.c
parentc43831fb47e4ee51967870c7b5deb08789b0874c (diff)
usb-linux: Add support for buffering iso usb packets
Currently we are submitting iso packets to the host one at a time, as we receive them from the emulated host controller. This has 2 problems: 1) If we were fast enough to submit every packet in time for the next host host controller usb frame, we would be generating 1000 hardware interrupts per second on the host 2) We are not fast enough to submit every packet in time for the next host host controller usb frame, causing us to not submit iso urbs in some usb frames which causes devices with an endpoint with an interval of 1 ms (so every frame) to loose data. This causes for example ubs-1.1 webcams to not work properly (usb-2.0 is not supported at all atm). This patch fixes both problems by changing the iso packet pass through handling to buffer packets. This version only does so for iso input packets (webcams, audio in) I'm working on a second patch extending this to iso output packets (audio out). This patch makes use of the linux batching of iso packets in one urb. When an iso in packet gets received from the emulated host controller, it immediately submits 3 urbs with 32 iso in packets each. This causes the host to only get an hw interrupt every 32 packets dropping the interrupt rate to 32 interrupts per second and gives it a queue of urbs to work from once the first 32 iso in packets have been received to make sure no packets are dropped. Besides submitting a whole bunch or urbs as soon as the first urb is received, effectively creating a buffer inside the kernel, this patch also gets rid of the asynchroneous completion for iso in urbs. Instead they are only marked as complete in the fd write callback (which usbfs uses to signal complete urbs). These complete packets then get consumed by returning them synchroneously to the emulated host controller when it submits an iso in packet for the ep in question. When no complete packets are ready (which happens when the stream is starting) a 0 length packet gets returned to the emulated host controller. With this patch I've several usb-1.1 webcams working well with usb pass through, where as without this patch none of them work. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'oslib-win32.c')
0 files changed, 0 insertions, 0 deletions