[sane-devel] HP 7450C ... addendum

Thomas Frayne tomf at sjpc.org
Mon Jun 30 16:44:13 BST 2003


Please read the procedure at the end of this note before looking at the
interleaved comments.





On Mon, 2003-06-30 at 01:49, Rene Rebe wrote:
> Hi,
> 
> On: 29 Jun 2003 21:45:37 -0700,
>     Thomas Frayne <tomf at sjpc.org> wrote:
> 
> > On Sun, 2003-06-29 at 14:25, Rene Rebe wrote: 
> > 
> > > Which host controller chip and respective kernel driver is this?
> 
> [...]
> 
> > Jun 29 07:33:06 localhost kernel: usb-ohci.c: USB OHCI at membase
> > 0xf0870000, IRQ 5
> > Jun 29 07:33:06 localhost kernel: usb-ohci.c: usb-00:0b.0, NEC
> > Corporation USB
> 
> Ah - ohci! The ohci driver in the kernel should be fine. It works with
> my SiS based Athlon boards and my iBook ... (in the last weeks I
> notices many problems with the two uhci drivers in general - not
> related to SANE/Avision).


Is there anything I should be doing about this?


> 
> > Jun 29 07:33:06 localhost kernel: ehci-hcd 00:0b.2: NEC Corporation USB
> > 2.0
> > Jun 29 07:33:06 localhost kernel: ehci-hcd 00:0b.2: irq 10, pci mem
> > f087a000
> > Jun 29 07:33:06 localhost kernel: usb.c: new USB bus registered,
> > assigned bus number 3
> > Jun 29 07:33:06 localhost kernel: PCI: 00:0b.2 PCI cache line size set
> > incorrectly (32 bytes) by BIOS/FW.
> > Jun 29 07:33:06 localhost kernel: PCI: 00:0b.2 PCI cache line size
> > corrected to 128.
> > Jun 29 07:33:06 localhost kernel: ehci-hcd 00:0b.2: USB 2.0 enabled,
> > EHCI 0.95, driver 2003-Jan-22
> 
> Hm - or ehci?
> 
> Could you send the output of lsusb?


[root at localhost root]# lsusb
Unknown line at line 58
Unknown line at line 2296
Unknown line at line 2297
Unknown line at line 2298
Unknown line at line 2299
Unknown line at line 2300
Unknown line at line 2301
Unknown line at line 2302
Unknown line at line 2303
Unknown line at line 2304
Unknown line at line 2305
Unknown line at line 2306
Unknown line at line 2307
Unknown line at line 2308
Unknown line at line 2309
Unknown line at line 2310
Unknown line at line 2311
Unknown line at line 2312
Unknown line at line 2313
Unknown line at line 2314
Unknown line at line 2315
Unknown line at line 2316
Unknown line at line 2317
Unknown line at line 2318
Unknown line at line 2319
Unknown line at line 2320
Unknown line at line 2321
Unknown line at line 2322
Unknown line at line 2323
Unknown line at line 2324
Unknown line at line 2325
Unknown line at line 2326
Unknown line at line 2327
Unknown line at line 2328
Unknown line at line 2329
Unknown line at line 2330
Unknown line at line 2331
Unknown line at line 2332
Unknown line at line 2333
Unknown line at line 2334
Unknown line at line 2335
 
Bus 004 Device 001: ID 0000:0000
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x0000
  idProduct          0x0000
  bcdDevice            0.00
  iManufacturer           0
  iProduct                2 USB UHCI Root Hub
  iSerial                 1 9000
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           25
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x40
      Self Powered
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               none
        wMaxPacketSize          8
        bInterval             255
  Language IDs: (length=4)
     0000 (null)((null))
 
Bus 004 Device 002: ID 03f0:0801 Hewlett-Packard
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.00
  bDeviceClass            0 Interface
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x03f0 Hewlett-Packard
  idProduct          0x0801
  bcdDevice            0.01
  iManufacturer           1 hp
  iProduct                2 hp scanjet 7400c
  iSerial                 3 87 tem  7400c
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           39
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x40
      Self Powered
    MaxPower                2mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass         0 Interface
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               none
        wMaxPacketSize          8
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               none
        wMaxPacketSize          8
        bInterval              10
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               none
        wMaxPacketSize         64
        bInterval               0
  Language IDs: (length=4)
     0409 English(US)
 
Bus 003 Device 001: ID 0000:0000
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0
  bDeviceProtocol         1
  bMaxPacketSize0         8
  idVendor           0x0000
  idProduct          0x0000
  bcdDevice            2.04
  iManufacturer           3 Linux 2.4.20-18.9 ehci-hcd
  iProduct                2 NEC Corporation USB 2.0
  iSerial                 1 00:0b.2
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           25
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x40
      Self Powered
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               none
        wMaxPacketSize          2
        bInterval              12
  Language IDs: (length=4)
     0000 (null)((null))
 
Bus 003 Device 002: ID 03f3:0081 Adaptec, Inc.
cannot get string descriptor 1, error = Broken pipe(32)
cannot get string descriptor 2, error = Broken pipe(32)



Is there anything I should do about this?



Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0
  bDeviceProtocol         1
  bMaxPacketSize0        64
  idVendor           0x03f3 Adaptec, Inc.
  idProduct          0x0081
  bcdDevice            1.00
  iManufacturer           1
  iProduct                2
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           25
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               none
        wMaxPacketSize          1
        bInterval              12
  Language IDs: (length=4)
     0409 English(US)
 
Bus 003 Device 003: ID 03f0:3404 Hewlett-Packard
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 Interface
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x03f0 Hewlett-Packard
  idProduct          0x3404
  bcdDevice            1.00
  iManufacturer           1 hp
  iProduct                2 deskjet 6122
  iSerial                 3 MY2771C0ZP50
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xc0
      Self Powered
    MaxPower                2mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         7 Printer
      bInterfaceSubClass      1 Printer
      bInterfaceProtocol      2 Bidirectional
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               none
        wMaxPacketSize         64
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               none
        wMaxPacketSize         64
        bInterval               0
  Language IDs: (length=4)
     0409 English(US)
 
Bus 002 Device 001: ID 0000:0000
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            9 Hub
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x0000
  idProduct          0x0000
  bcdDevice            0.00
  iManufacturer           0
  iProduct                2 USB OHCI Root Hub
  iSerial                 1 f0872000
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           25
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x40
      Self Powered
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               none
        wMaxPacketSize          2
        bInterval             255
  Language IDs: (length=4)
     0000 (null)((null))
 
Bus 001 Device 001: ID 0000:0000
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            9 Hub
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x0000
  idProduct          0x0000
  bcdDevice            0.00
  iManufacturer           0
  iProduct                2 USB OHCI Root Hub
  iSerial                 1 f0870000
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           25
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x40
      Self Powered
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               none
        wMaxPacketSize          2
        bInterval             255
  Language IDs: (length=4)
     0000 (null)((null))
[root at localhost root]#



This seems to say that bus 004 is a USB UHCI hub and Bus 004 Device 002:
ID 03f0:0801 Hewlett-Packard is my Scanjet. Does that imply that the
Scanjet is using UHCI?



> 
> > > If communication via libusb is not reliable for you, you still can use
> > > the "deprecated" hpusbscsi driver in the kernel - but _not_ the
> > > scanner driver.
> > 
> > 
> > I've tried so many configuration variations over the last couple of
> > weeks that I've gotten confused about what configuration settings do
> > what.  I don't think I understand the terminology.
> 
> Ok - I rephrase it:
> 
> There is a generic USB scanner driver in the kernel. The resulting
> module is named scanner.o. This driver does not work with Avision/HP
> scanners. You should no try to force it's loading.


Instead, I'll try to force it not to be loaded, e.g., by renaming
scanner.o.  Right?


> 
> Instead you should use access via libusb. Libusb is a normal library
> (libusb.so in /usr/lib or so) which allows low-level access to usb
> devices from user-space applications. This library is automatically
> used when the permissions in /proc/bus/usb/0*/* allow you to access
> the device. But unfortunately this results in strance timeouts on your
> system. So as short time soluion and test you could try:



> [root at localhost root]# ls -l /proc/bus/usb/004/*
-rw-r--r--    1 root     root           18 Jun 30 06:51
/proc/bus/usb/004/001
-rw-r--r--    1 root     root           18 Jun 30 06:51
/proc/bus/usb/004/002
[root at localhost root]# chmod 666  /proc/bus/usb/004/*
[root at localhost root]# ls -l /proc/bus/usb/004/*
-rw-rw-rw-    1 root     root           18 Jun 30 06:51
/proc/bus/usb/004/001
-rw-rw-rw-    1 root     root           18 Jun 30 06:51
/proc/bus/usb/004/002
[root at localhost root]#

Right?




> Access via the "depricated" hpusbscsi driver. It is a kernel driver
> which name is hpusbscsi.o. It was written to access Avision and HP usb
> scanners via an emulated SCSI interface (/dev/sg?). When the hpusbscsi
> module is loaded the scanner would look like a scsi device.


I currently have hpusbscsi.o renamed to disable it.  I'll leave it
disabled for now, and try to use libusb.  If I see 


> 
> > I now think I should avoid using the scanner driver.  Would
> > rmmod scanner 
> > do this for me, or is something else necessary?  How can I tell whether
> > or not I am using the scanner driver?
> 
> lsmod lists the loaded kernel modules. A rmmod scanner does only
> unload the driver until the next reboot. You need to modify the place
> where it gets loaded on your distribution (maybe hotplug so
> /etc/hotplug ...) or you "simply" remove the scanner.o file in
> /lib/modules/<kernel-ver>/... from your disk (if you do not have other
> USB scanners that needs to be accessed via the module ...)
> 
> > I would like to use libusb, but I have not been able to figure out what
> > causes the libusb driver to be loaded.  Some parts of my system refer to
> 
> There is no libusb "driver" - it is a normal user-space library. Youl
> only need the usbfb mounted to /proc/bus/usb - and the permissions
> must allow your user to access the device.
> 
> > usbfs; others refer to usbdevfs.  I think I need everything in the
> > system refering to one or everything to the other, but when I tried
> > changing the usbdevfs references to usbfs, I produced a system that
> > would not boot, and had to restore a backup.
> 
> If RedHat likes the usbdevfs name simply leave it as it is. usbdevfs
> and usbfs are the same. (That one alias is depricate and will
> disappear in the future does only need to wory RedHat - not you)
> 
> > What is the best way to get back to a clean system?
> > Is there a modprobe command I should be using to load the libusb
> > driver?  If so, should I add it to /etc/rc.d/rc.local to get it to run
> > during boot?
> 
> As written above - only usbfs need to be mounted and the permissions
> needs to be correct. Nothing else - no kernel driver.





> [root at localhost root]# mount
/dev/sdb2 on / type ext2 (rw)
none on /proc type proc (rw)
usbdevfs on /proc/bus/usb type usbdevfs (rw)

I am still confused here.  You said to leave usbdevfs as it is, but you
also said that libusb times out.  Should I try libusb first, and try
hpusbscsi if libusb fails?




When modprobe scanner vendor=0x03f0 product=0x0801 was in effect,
scanimage -L failed, but after
rmmod scanner, I got:

[root at localhost root]# scanimage -L
device `avision:libusb:004:002' is a Hewlett-Packard ScanJet 7400c
flatbed scanner
[root at localhost root]#

However, When I tried to scan with xsane, it failed with a timeout.  Is
this the libusb failure you were refering to?

I'd like to try hpusbscsi without rebooting.  The procedure to do this,
as I currently understand it is:

Turn off the scanner to clear the "initializing" state
Rename back to hpusbscsi.o
Don't do a modprobe; do an rmmod scanner to make sure.
Modify /etc/rc.d/rc.local to remove the modprobe at the next boot
Modify /usr/local/etc/sane.d/avision.conf to remove the usb lines and
insert:
scsi AVISION
scsi HP
scsi hp
scsi /dev/scanner
scsi /dev/usb/scanner0

umount /proc type proc
mount what?

Anything wrong, redundant, or missing?




> > What should be done to get the scanner mounted as rw with permissions
> > for everyone to use it?  The things I have tried with fstab did not
> > work, since the system tried to mount it twice.
> > 
> > I currently have hpusbbscsi disabled.  Should both libusb and hpusbbscsi
> > be enabled?
> 
> You can use hpusbscsi - it should work fine - but when you use the new
> libusb access method - the hpusbscsi module should not be loaded.




Should libusb be disabled when I am trying to use hpusbscsi?  If so, how
should I disable libusb?





> 
> Sincerely yours,
>   René Rebe
>     - ROCK Linux stable release maintainer
> 
> --  
> René Rebe - Europe/Germany/Berlin
>   rene at rocklinux.org rene.rebe at gmx.net
> http://www.rocklinux.org http://www.rocklinux.org/people/rene       
> http://gsmp.tfh-berlin.de/gsmp http://gsmp.tfh-berlin.de/rene




More information about the sane-devel mailing list