That solved the problem! Boy, do I feel relieved after more than a year of scanner frustration: I am finally able to use my Nikon LS-40 film scanner!
I have been scanning 24 film strips (of 6 pictures each) with no problems at all. Without your patch I always considered myself lucky if I could scan two film strips without a USB lockup. Thanks Henning! It is interesting to read this comment in the beginning of scanner.c dated 4/30/2000: * - Fixed bug in read_scanner. 'count' should be decremented * by 'this_read' and not by 'partial'. This resulted in twice as many * calls to read_scanner() for small amounts of data and possibly * unexpected returns of '0'. Thanks to Karl Heinz * Kremer <[EMAIL PROTECTED]> and Alain Knaff <[EMAIL PROTECTED]> * for discovering this. It is exactly this "fix" that caused my misery. So what is the deal here? > On Wed, Mar 19, 2003 at 06:06:48AM +0100, Paul Stravers wrote: > > Below follows an excerpt of the debug output from scanner.c and > > uhci-debug.c. To avoid cluttering this mailing list with debug > > information I have put the complete syslog on the web at > > http://www.oink-oink-oink.net/usb-problem/syslog2.gz (269 kB). > > I think I know the reason for this problem. It's most probably in > scanner.c. There has been some discussion some months ago if the code > in read of scanner.c is correct. I think it's incorrect but some other > people didn't seem to share that view.See below for details. > > > The USB subsystem freezes. Sometimes I can solve it with "rmmod > > usb-uhci" but usually I have to reboot to get the USB subsystem to work > > again. The good news is that the part of the system that does not depend > > on USB keeps running, so I can login on a console and type "reboot". > > That's houldn't happen anyway. I'm not yet sure if that freeze happens > in the scanner driver or the uhci driver. > > > Did that, the problem persists with 2.4.21-pre5. I changed the timeout > > in write_scanner to 600*HZ and I enabled debugging. At the end of this > > mail I am including messages from syslog . > > It's not related to write but read and it's not a timeout problem. > > > > Does SANE work instead of vuescan? Or do you get the same timeouts? I > > > don't know if that's the same scanner but a "Nikon LS 40 ED" is listed > > > as supported device. You can use current versions of sane with libusb > > > instead of the kernel scanner driver. If it works with libusb but not > > > the kernel driver we know who is to blame :-) > > > > I downloaded SANE and got the "coolscan2" backend to work with my Nikon > > LS-40. However, I could not operate it in a way that produced usable > > pictures, still looking for a GUI frontend that supports coolscan2. > > scanimage supports all the options that the coolscan2 backend > provides. It's just a bit hard to use :-) > Any SANE frontend should work with the coolscan2 backend (and any > other backend). I'm pretty sure that at least xsane works. Maybe you > have tow versions of sane-backends and xsane still uses the old one? > > > I noticed however that typing Ctl-C to the "scanimage" frontend > > produced the familiar "usb_control/bulk_msg: timeout" messages in the > > syslog... > > Maybe the same issue. > > Let's see what happens: > > > Mar 18 07:02:26 kletskop kernel: scanner.c: read stats(0): result:0 > > this_read:32768 partial:21224 count:42448 > > We want to read 42448 bytes. The buffer size is 32768 so that's the > maximum we can do in one turn. The scanner returns only 21224 bytes > (probably one scan line). So far that's ok. > > Now the error occurs. > > > Mar 18 07:02:26 kletskop kernel: scanner.c: read stats(0): result:-75 > > this_read:9680 partial:9680 count:9680 > > The reason is that the next read reads only 9680 bytes instead of > 21224. The scanner doesn't seem to be able to handle this. > In my opinion the calculation > > count -= this_read; /* Compensate for short reads */ > > is just wrong. That should be > > count -= partial; > > Try to change that in scanner.c, around line 710. > > Bye, > Henning ------------------------------------------------------- This SF.net email is sponsored by:Crypto Challenge is now open! Get cracking and register here for some mind boggling fun and the chance of winning an Apple iPod: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-users
