[sane-devel] USB2 4 port hub and write_scanner(0): funky result: -32

Alexander Iain Kempshall email@aikempshall.freeserve.co.uk
Sun, 1 May 2005 08:32:54 +0000


On Wednesday 20 April 2005 15:54, Julien BLACHE wrote:
> Alexander Kempshall <member@aikempshall.freeserve.co.uk> wrote:
> > I've recently bought the Trust 420A 4 Port Compact USB2 Hub. On the
> > http://www.qbik.ch/usb/devices/ there is a suggestion that it is Linux
> > compatible.
>
> A USB hub needs no OS driver, it just works (tm).
>
> > In Slackware 10.1 when the hub is connected to my Canon N670U scanner,
> > start Kooka, the scanner is recognised but when I try to scan nothing
> > happens. Close Kooka down and start again the scanner is no longer
> > recognised. Unplug the USB cable the machine crashes. In dmesg I get
> > the following
> >
> > scanner.c: write_scanner(0): funky result: -32. Consult
> > Documentataion/usb/scanner.txt.
>
> Don't use the scanner module, it's obsolete, unmaintained, etc. rmmod
> it, and either remove the scanner.o file or add it to the hotplug
> blacklist (if you have hotplug installed).
>

Added scanner to /etc/hotplug/blacklist

> > The Scanner works perfectly if plugged directly into a usb port on the
> > mother board. Also the scanned works perfectly plugged into the
> > external hub using knoppix.
>
> Does your USB hub come with an AC adapter ? If yes, is it plugged in ?
> Same question for your scanner.
>

No the hub didn't come with an AC adapter but it can use an external power 
supply. Acquired a power supply for hub. The scanner can't use an external 
power supply.

> If neither your USB hub nor your scanner come with an AC adapter, then
> you'll need to get another, AC powered, hub so that the scanner will
> get enough power from the USB bus.
>
> Currently, your scanner is under-powered, as you have too many
> bus-powered devices plugged on your USB bus. Hence the transfer
> errors.
>

Using a power supply made no difference. Adding scanner to the blacklist does 
seem to have made a difference. Rebooted the machine three or more times now 
and on each occasion the scanner works - eventually. I say eventually  
because in each new session the first time a scan is attempted it will fail 
with the following in dmesg -

usbdevfs: USBDEVFS_CONTROL failed dev 5 rqt 128 rq 6 len 2 ret -32
usbdevfs: USBDEVFS_CONTROL failed dev 5 rqt 128 rq 6 len 2 ret -32
usbdevfs: USBDEVFS_BULK failed dev 4 ep 0x3 len 5 ret -32
usbdevfs: USBDEVFS_BULK failed dev 4 ep 0x3 len 4 ret -32
usbdevfs: USBDEVFS_BULK failed dev 4 ep 0x3 len 4 ret -32
usbdevfs: USBDEVFS_BULK failed dev 4 ep 0x3 len 5 ret -32
usbdevfs: USBDEVFS_BULK failed dev 4 ep 0x3 len 4 ret -32
usbdevfs: USBDEVFS_BULK failed dev 4 ep 0x3 len 4 ret -32
usbdevfs: USBDEVFS_BULK failed dev 4 ep 0x3 len 4 ret -32
usbdevfs: USBDEVFS_BULK failed dev 4 ep 0x3 len 5 ret -32
usbdevfs: USBDEVFS_BULK failed dev 4 ep 0x3 len 4 ret -32
usbdevfs: USBDEVFS_BULK failed dev 4 ep 0x3 len 4 ret -32

On the second and subsequent attempts the scanner works perfectly. What do the 
errors mean?

I've googled the error. Most references found seem to refer to scanners that 
aren't working. The nature of my error looks like on the first scan a module 
has not been found loaded so is loaded but not in time for the scanner to 
scan. On subsequent scans the module is loaded so scanning takes place as 
normal. I suppose I could do an lsmod to test this possibility.

Checked out that theory the modules loaded before and after are the same!

> JB.
>
> --
> Julien BLACHE                                   <http://www.jblache.org>
> <jb@jblache.org>                                  GPG KeyID 0xF5D65169

Alex