[pvrusb2] usb weakiness and streaming errors

Mike Isely isely at isely.net
Sat Jan 7 23:14:27 CST 2006


On Thu, 5 Jan 2006, Ingo Flaschberger wrote:

> Hi
>
>>> I have attached a patch to provide a little bit of error tolerance in 
>>> stream reads from the usb bus.
>>> 
>>> After 3 continous failed reads the stream is dropped and not after the 
>>> first one like now.
>> 
>> I'll take a look and see about integrating it.  I don't like the idea of 
>> putting in a hack to work around what is really a problem in the USB core 
>> and/or the hardware.
>
> me too but would be glad not to have to patch the driver every time..
>
>> However if the patch otherwise doesn't do any harm then it would seem to 
>> make sense to apply it.
>
> it should not do any harm, after 3 unsucessfull reads it stops like before.
>
> bye,
> 	Ingo

Ingo:

I'm going to implement this, but I'm going to handle it differently.  The 
driver has a layered approach to handling pipelining of IO.  The code you 
tweaked is at the "read" stream level, but I'm going to change it instead 
at the buffer level.  It's also going to be done per-stream instead of 
globally, and it will be tunable per-stream instead of having a global 
limit.  Finally, I'm adding some debug message that will print when the 
fail count changes so we can track how often this is being used and to 
provide an indicator in the log in case we start seeing potentially 
related issues and want to know if other errors are being, uh, "pasted 
over".

Pushing this down to the buffer layer is important because hopefully at 
some point this driver is going to implement the other standard V4L IO 
methods, and such an implementation is all going to share the buffer layer 
but not the "read" stream layer.

The per-stream parts are important because (1) It would probably be useful 
to only enable this for devices known to be on flakey hardware / software, 
and (2) I expect the driver to support other stream types in the future 
which might not be so forgiving of these problems.  Also, for (1) I will 
add a module option as you suggest to control this on a per-driver 
instance basis.

By the way, none of this is going to help if the spurious error(s) happen 
during a control transfer - the results in that case will be 
unpredictable, ranging from subtle to catastrophic.  In the end it's 
probably still best to find better a better USB controller :-(

   -Mike

-- 
                         |         Mike Isely          |     PGP fingerprint
      Spammers Die!!     |                             | 03 54 43 4D 75 E5 CC 92
                         |   isely @ pobox (dot) com   | 71 16 01 E2 B5 F5 C1 E8
                         |                             |


More information about the pvrusb2 mailing list