http://bugzilla.novell.com/show_bug.cgi?id=559697
http://bugzilla.novell.com/show_bug.cgi?id=559697#c23
--- Comment #23 from Stanislav Brabec 2009-12-11 17:04:20 CET ---
Now I see a big difference how libusb0 and libusb-compat handles incomplete
transfers:
libusb0:
- program starts with 32000 bytes request
- libusb splits 32000 bytes request to 2 URBs
- libusb asks for the first URB - 16384 bytes
- scanner returns short transfer 6668 bytes (or 0, if there are no data
available yet)
- program decreases 32000 bytes by 6688 each time, but if 16384 bytes limit is
reached, it again returns to 32000
- loop repeats until scan is complete
libusb-compat:
- program starts with 32000 bytes request
- libusb splits 32000 bytes request to 2 URBs
- libusb asks for the first URB - 16384 bytes
- scanner returns short transfer 6668 bytes (or 0, if there are no data
available yet)
- libusb asks for the second URB (even if previous URB returned 0)
- scanner returns some amount of data (e. g. 3584 bytes)
- libusb concatenates both transfers and returns the data block (e. g. 10252
bytes).
- program decreases 32000 bytes by e. g. 10252 bytes and enters loop
- next loop run requests 21748 bytes, returns 3084+0
- next loop run requests 18664 bytes, returns 6668+0
- it repeats many times, until it reaches:
- next loop run requests x bytes, returns 6668+(small amount of data less than
about 700 bytes)
It seems that 1 byte on URB confuses scanner and scanning stops.
The behavior difference and way to fix is obvious.
What is actually happening is not obvious. It seems that libusb0 always
requests URB with 16384 bytes, size requested by libusb-compat varies. It may
confuse the scanner or trigger a timing problem or race condition. Even
firmware error is possible.
--
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.