From: Johannes E. <joh...@er...> - 2006-01-24 07:29:46
|
On Mon, Jan 23, 2006, Kam Tsa <ka...@gm...> wrote: > I am writing a user space driver for USDigital USB1 encoder and far libusb > works just great (thanks to all the contributers). > > One thing that puzzles me is that I cannot perform a bulk read in a rate > greater than 2 ms per read. > > If I perform the read in a tight loop, each bulk read takes exactly 2 ms > (while CPU usages is virtually zero). Then, I insert in the reading loop a > delay of 0.5ms, the entire loop still take 2 ms (0.5ms for the delay > and 1.5ms for the bulk read). > > It seems that the reading is tied to some invisible 1ms clock and the call > to a bulk read need to be long enough such that it covers two 1 ms ticks. > > Anybody knows what may be the cuase? > > The USDigital USB1 is specified to be able to provide a reading every 1ms so > is it possible that the restriction is somewhere on the host? > > BTW, my system is relativly old (I don't have the kernel or libusb version > here with me at home). The "invisible" 1ms clock you're seeing is the 1ms USB frame. The HCD implementations will generate interrupts only at the end of the USB frame. As a result, the minimum time any transfer takes will be 1ms. I can't think immediately why you're seeing it take 2ms. You'll have to find out what HC you are using, which kernel driver you're using and which version of the kernel and libusb you are using. JE |