You are not logged in.

#1 2006-11-16 23:06:30

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Usb programming... and latency

Hey all,

I may be needing to reverse engineer a usb device under windows and write a driver for Linux. I've got a Windows usb sniffer, so I can access the protocol, but I've no idea where to start in rewriting it. Would this be done in userspace, or do I have to write a kernel module? Where do I start? I can't find any tutorial or documentation on it.

Now, the other thing, there seems to be a latency of at least 15 milliseconds in USB; does anybody know if that's normal? Its actually not really a latency or a delay, it seems like packets are only arriving every 15 milliseconds, even though the device in question is operating at 120Hz. Sometimes they get bunched up and stuff. This is one reason we want to try to write a Linux driver; we thought maybe it was Windows introducing this. Does anybody know if its actually USB or part of the hardware?

I used the usbmon kernel module to test a flash drive and a USB trackball, and in both cases, it appeared that all packets were timestamped in small groups that were also at least 15 milliseconds apart (up to 40 milliseconds). But the usbmon timestamps are recorded to nanosecond accuracy, so it seems like there is at least potential for devices to be more accurate.

Dusty

Offline

#2 2006-11-16 23:59:43

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Usb programming... and latency

I'm pretty sure you'd have to write a module for it.  Check out the infamous "gadget zero" :
http://lxr.linux.no/source/drivers/usb/gadget/zero.c

Offline

Board footer

Powered by FluxBB