libusbscanner hotplug script sometimes changes permission of the wrong device

Bug #8241 reported by Sam Folk-Williams on 2004-09-19
38
Affects Status Importance Assigned to Milestone
sane-backends (Ubuntu)
Medium
Martin Pitt

Bug Description

sane can not find my epson 1650 perfection scanner, which has solid linux
support. sane-find-scanner finds the scanner, but gives what appears to be an
invalid device address. Below is the output from sane-find-scanner:

sam@ernie ~ $ sudo sane-find-scanner

  # No SCSI scanners found. If you expected something different, make sure that
  # you have loaded a SCSI driver for your SCSI adapter.
  # Also you need support for SCSI Generic (sg) in your operating system.
  # If using Linux, try "modprobe sg".

found USB scanner (vendor=0x04b8 [EPSON], product=0x0110 [EPSON Scanner]) at
libusb:002:002
  # Your USB scanner was (probably) detected. It may or may not be supported by
  # SANE. Try scanimage -L and read the backend's manpage.

  # Not checking for parallel port scanners.

  # Most Scanners connected to the parallel port or other proprietary ports
  # can't be detected by this program.
--------------------------
Below is the output of dmesg after scanner is plugged in
sam@ernie /dev $ sudo dmesg
] (IRQs 3 4 5 6 7 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LNK2] (IRQs 3 4 5 6 7 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LNK3] (IRQs 3 4 5 6 7 10 *11 12 14 15)
ACPI: PCI Interrupt Link [LNK4] (IRQs 3 4 5 6 7 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LNK5] (IRQs 3 4 *5 6 7 10 11 12 14 15)
ACPI: PCI Interrupt Link [LUBA] (IRQs 3 4 *5 6 7 10 11 12 14 15)
ACPI: PCI Interrupt Link [LUBB] (IRQs 3 4 5 6 7 10 11 *12 14 15)
ACPI: PCI Interrupt Link [LMAC] (IRQs 3 4 5 6 7 10 11 *12 14 15)
ACPI: PCI Interrupt Link [LAPU] (IRQs 3 4 5 6 7 10 11 *12 14 15)
ACPI: PCI Interrupt Link [LACI] (IRQs 3 4 5 6 7 10 *11 12 14 15)
ACPI: PCI Interrupt Link [LMCI] (IRQs 3 4 5 6 7 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LSMB] (IRQs 3 4 5 6 7 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LUB2] (IRQs 3 4 5 6 7 10 *11 12 14 15)
ACPI: PCI Interrupt Link [LFIR] (IRQs 3 4 *5 6 7 10 11 12 14 15)
ACPI: PCI Interrupt Link [L3CM] (IRQs 3 4 5 6 7 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LIDE] (IRQs 3 4 5 6 7 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link [APC1] (IRQs *16), disabled.
ACPI: PCI Interrupt Link [APC2] (IRQs *17), disabled.
ACPI: PCI Interrupt Link [APC3] (IRQs *18), disabled.
ACPI: PCI Interrupt Link [APC4] (IRQs *19), disabled.
ACPI: PCI Interrupt Link [APC5] (IRQs *16), disabled.
ACPI: PCI Interrupt Link [APCF] (IRQs 20 21 22) *0, disabled.
ACPI: PCI Interrupt Link [APCG] (IRQs 20 21 22) *0, disabled.
ACPI: PCI Interrupt Link [APCH] (IRQs 20 21 22) *0, disabled.
ACPI: PCI Interrupt Link [APCI] (IRQs 20 21 22) *0, disabled.
ACPI: PCI Interrupt Link [APCJ] (IRQs 20 21 22) *0, disabled.
ACPI: PCI Interrupt Link [APCK] (IRQs 20 21 22) *0, disabled.
ACPI: PCI Interrupt Link [APCS] (IRQs *23), disabled.
ACPI: PCI Interrupt Link [APCL] (IRQs 20 21 22) *0, disabled.
ACPI: PCI Interrupt Link [APCM] (IRQs 20 21 22) *0, disabled.
ACPI: PCI Interrupt Link [AP3C] (IRQs 20 21 22) *0, disabled.
ACPI: PCI Interrupt Link [APCZ] (IRQs 20 21 22) *0, disabled.
Linux Plug and Play Support v0.97 (c) Adam Belay
PnPBIOS: Scanning system for PnP BIOS support...
PnPBIOS: Found PnP BIOS installation structure at 0xc00fc000
PnPBIOS: PnP BIOS version 1.0, entry 0xf0000:0xc030, dseg 0xf0000
PnPBIOS: 16 nodes reported by PnP BIOS; 16 recorded by driver
PCI: Using ACPI for IRQ routing
ACPI: PCI Interrupt Link [APCS] enabled at IRQ 23
ACPI: PCI interrupt 0000:00:01.1[A] -> GSI 23 (level, high) -> IRQ 169
ACPI: PCI Interrupt Link [APCF] enabled at IRQ 22
ACPI: PCI interrupt 0000:00:02.0[A] -> GSI 22 (level, high) -> IRQ 177
ACPI: PCI Interrupt Link [APCG] enabled at IRQ 21
ACPI: PCI interrupt 0000:00:02.1[B] -> GSI 21 (level, high) -> IRQ 185
ACPI: PCI Interrupt Link [APCL] enabled at IRQ 20
ACPI: PCI interrupt 0000:00:02.2[C] -> GSI 20 (level, high) -> IRQ 193
ACPI: PCI Interrupt Link [APCH] enabled at IRQ 22
ACPI: PCI interrupt 0000:00:04.0[A] -> GSI 22 (level, high) -> IRQ 177
ACPI: PCI Interrupt Link [APCI] enabled at IRQ 21
ACPI: PCI interrupt 0000:00:05.0[A] -> GSI 21 (level, high) -> IRQ 185
ACPI: PCI Interrupt Link [APCJ] enabled at IRQ 20
ACPI: PCI interrupt 0000:00:06.0[A] -> GSI 20 (level, high) -> IRQ 193
ACPI: PCI Interrupt Link [APCM] enabled at IRQ 22
ACPI: PCI interrupt 0000:00:0d.0[A] -> GSI 22 (level, high) -> IRQ 177
ACPI: PCI Interrupt Link [APC3] enabled at IRQ 18
ACPI: PCI interrupt 0000:01:06.0[A] -> GSI 18 (level, high) -> IRQ 201
ACPI: PCI Interrupt Link [APC5] enabled at IRQ 16
ACPI: PCI interrupt 0000:03:00.0[A] -> GSI 16 (level, high) -> IRQ 209
number of MP IRQ sources: 15.
number of IO-APIC #2 registers: 24.
testing the IO APIC.......................
IO APIC #2......
.... register #00: 02000000
....... : physical APIC id: 02
....... : Delivery Type: 0
....... : LTS : 0
.... register #01: 00170011
....... : max redirection entries: 0017
....... : PRQ implemented: 0
....... : IO APIC version: 0011
.... register #02: 00000000
....... : arbitration: 00
.... IRQ redirection table:
 NR Log Phy Mask Trig IRR Pol Stat Dest Deli Vect:
 00 000 00 1 0 0 0 0 0 0 00
 01 001 01 0 0 0 0 0 1 1 39
 02 000 00 1 0 0 0 0 0 0 00
 03 001 01 0 0 0 0 0 1 1 41
 04 001 01 0 0 0 0 0 1 1 49
 05 001 01 0 0 0 0 0 1 1 51
 06 001 01 0 0 0 0 0 1 1 59
 07 001 01 1 0 0 0 0 1 1 61
 08 001 01 0 0 0 0 0 1 1 69
 09 001 01 0 1 0 0 0 1 1 71
 0a 001 01 0 0 0 0 0 1 1 79
 0b 001 01 0 0 0 0 0 1 1 81
 0c 001 01 0 0 0 0 0 1 1 89
 0d 001 01 0 0 0 0 0 1 1 91
 0e 001 01 0 0 0 0 0 1 1 99
 0f 001 01 0 0 0 0 0 1 1 A1
 10 001 01 1 1 0 0 0 1 1 D1
 11 000 00 1 0 0 0 0 0 0 00
 12 001 01 1 1 0 0 0 1 1 C9
 13 000 00 1 0 0 0 0 0 0 00
 14 001 01 1 1 0 0 0 1 1 C1
 15 001 01 1 1 0 0 0 1 1 B9
 16 001 01 1 1 0 0 0 1 1 B1
 17 001 01 1 1 0 0 0 1 1 A9
Using vector-based indexing
IRQ to pin mappings:
IRQ0 -> 0:2
IRQ1 -> 0:1
IRQ3 -> 0:3
IRQ4 -> 0:4
IRQ5 -> 0:5
IRQ6 -> 0:6
IRQ7 -> 0:7
IRQ8 -> 0:8
IRQ9 -> 0:9
IRQ10 -> 0:10
IRQ11 -> 0:11
IRQ12 -> 0:12
IRQ13 -> 0:13
IRQ14 -> 0:14
IRQ15 -> 0:15
IRQ209 -> 0:16
IRQ201 -> 0:18
IRQ193 -> 0:20
IRQ185 -> 0:21
IRQ177 -> 0:22
IRQ169 -> 0:23
.................................... done.
VFS: Disk quotas dquot_6.5.1
Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
devfs: 2004-01-31 Richard Gooch (<email address hidden>)
devfs: boot_options: 0x0
Initializing Cryptographic API
isapnp: Scanning for PnP cards...
isapnp: No Plug & Play device found
Serial: 8250/16550 driver $Revision: 1.90 $ 54 ports, IRQ sharing enabled
ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize
serio: i8042 AUX port at 0x60,0x64 irq 12
serio: i8042 KBD port at 0x60,0x64 irq 1
input: AT Translated Set 2 keyboard on isa0060/serio0
EISA: Probing bus 0 at eisa0
EISA: Detected 0 cards.
NET: Registered protocol family 2
IP: routing cache hash table of 4096 buckets, 32Kbytes
TCP: Hash tables configured (established 32768 bind 65536)
NET: Registered protocol family 8
NET: Registered protocol family 20
ACPI: (supports S0 S1 S4 S5)
RAMDISK: cramfs filesystem found at block 0
RAMDISK: Loading 4316 blocks [1 disk] into ram disk... done.
VFS: Mounted root (cramfs filesystem) readonly.
Freeing unused kernel memory: 204k freed
vesafb: probe of vesafb0 failed with error -6
ACPI: Processor [CPU0] (supports C1)
ACPI: Thermal Zone [THRM] (40 C)
ACPI: Fan [FAN] (on)
NET: Registered protocol family 1
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
NFORCE2: IDE controller at PCI slot 0000:00:09.0
NFORCE2: chipset revision 162
NFORCE2: not 100% native mode: will probe irqs later
NFORCE2: BIOS didn't set cable bits correctly. Enabling workaround.
NFORCE2: BIOS didn't set cable bits correctly. Enabling workaround.
NFORCE2: 0000:00:09.0 (rev a2) UDMA133 controller
    ide0: BM-DMA at 0xf000-0xf007, BIOS settings: hda:DMA, hdb:DMA
    ide1: BM-DMA at 0xf008-0xf00f, BIOS settings: hdc:DMA, hdd:DMA
hda: HDS722512VLAT80, ATA DISK drive
Using anticipatory io scheduler
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
hda: max request size: 1024KiB
hda: 241254720 sectors (123522 MB) w/7938KiB Cache, CHS=16383/255/63, UDMA(100)
 /dev/ide/host0/bus0/target0/lun0: p1 p2 < p5 >
hdc: WDC WD1200JB-00EVA0, ATA DISK drive
hdd: LITE-ON LTR-16101B, ATAPI CD/DVD-ROM drive
ide1 at 0x170-0x177,0x376 on irq 15
hdc: max request size: 1024KiB
hdc: 234441648 sectors (120034 MB) w/8192KiB Cache, CHS=16383/255/63, UDMA(100)
 /dev/ide/host0/bus1/target0/lun0: p1 p2 p3
SGI XFS with ACLs, security attributes, realtime, large block numbers, no debug
enabled
SGI XFS Quota Management subsystem
kjournald starting. Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
Adding 497972k swap on /dev/hda5. Priority:-1 extents:1
EXT3 FS on hda1, internal journal
SCSI subsystem initialized
mice: PS/2 mouse device common for all mice
hdd: ATAPI 40X CD-ROM CD-R/RW drive, 2048kB Cache, DMA
Uniform CD-ROM driver Revision: 3.20
ieee1394: Initialized config rom entry `ip1394'
sbp2: $Rev: 1219 $ Ben Collins <email address hidden>
parport: PnPBIOS parport detected.
parport0: PC-style at 0x378, irq 7 [PCSPP,TRISTATE]
lp0: using parport0 (interrupt-driven).
Capability LSM initialized
device-mapper: 4.1.0-ioctl (2003-12-10) initialised: <email address hidden>
md: md driver 0.90.0 MAX_MD_DEVS=256, MD_SB_DISKS=27
cdrom: open failed.
kjournald starting. Commit interval 5 seconds
EXT3 FS on hdc2, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
Real Time Clock Driver v1.12
input: PC Speaker
inserting floppy driver for 2.6.8.1-2-386
FDC 0 is a post-1991 82077
Linux agpgart interface v0.100 (c) Dave Jones
agpgart: Detected NVIDIA nForce2 chipset
agpgart: Maximum main memory to use for agp memory: 409M
agpgart: AGP aperture is 64M @ 0xd0000000
usbcore: registered new driver usbfs
usbcore: registered new driver hub
ohci_hcd: 2004 Feb 02 USB 1.1 'Open' Host Controller (OHCI) Driver (PCI)
ohci_hcd: block sizes: ed 64 td 64
ACPI: PCI interrupt 0000:00:02.0[A] -> GSI 22 (level, high) -> IRQ 177
ohci_hcd 0000:00:02.0: nVidia Corporation nForce2 USB Controller
PCI: Setting latency timer of device 0000:00:02.0 to 64
ohci_hcd 0000:00:02.0: irq 177, pci mem deb0c000
ohci_hcd 0000:00:02.0: new USB bus registered, assigned bus number 1
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 3 ports detected
ACPI: PCI interrupt 0000:00:02.1[B] -> GSI 21 (level, high) -> IRQ 185
ohci_hcd 0000:00:02.1: nVidia Corporation nForce2 USB Controller (#2)
PCI: Setting latency timer of device 0000:00:02.1 to 64
ohci_hcd 0000:00:02.1: irq 185, pci mem deb0e000
ohci_hcd 0000:00:02.1: new USB bus registered, assigned bus number 2
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 3 ports detected
usb 1-2: new low speed USB device using address 2
usbcore: registered new driver hiddev
input: USB HID v1.10 Mouse [Microsoft Microsoft 3-Button Mouse with
IntelliEye(TM)] on usb-0000:00:02.0-2
usbcore: registered new driver usbhid
drivers/usb/input/hid-core.c: v2.0:USB HID core driver
ts: Compaq touchscreen protocol output
usb 1-3: new full speed USB device using address 3
ACPI: PCI interrupt 0000:00:02.2[C] -> GSI 20 (level, high) -> IRQ 193
ehci_hcd 0000:00:02.2: nVidia Corporation nForce2 USB Controller
PCI: Setting latency timer of device 0000:00:02.2 to 64
ehci_hcd 0000:00:02.2: irq 193, pci mem deb10000
ehci_hcd 0000:00:02.2: new USB bus registered, assigned bus number 3
PCI: cache line size of 64 is not supported by device 0000:00:02.2
ehci_hcd 0000:00:02.2: USB 2.0 enabled, EHCI 1.00, driver 2004-May-10
hub 3-0:1.0: USB hub found
hub 3-0:1.0: 6 ports detected
usb 1-2: USB disconnect, address 2
usb 1-3: USB disconnect, address 3
forcedeth.c: Reverse Engineered nForce ethernet driver. Version 0.28.
ACPI: PCI interrupt 0000:00:04.0[A] -> GSI 22 (level, high) -> IRQ 177
PCI: Setting latency timer of device 0000:00:04.0 to 64
usb 3-3: new high speed USB device using address 3
eth0: forcedeth.c: subsystem: 01297:0531 bound to 0000:00:04.0
Initializing USB Mass Storage driver...
scsi0 : SCSI emulation for USB Mass Storage devices
  Vendor: USB2.0 Model: CF CardReader Rev:
  Type: Direct-Access ANSI SCSI revision: 02
Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
  Vendor: USB2.0 Model: CBO CardReader Rev:
  Type: Direct-Access ANSI SCSI revision: 02
Attached scsi removable disk sdb at scsi0, channel 0, id 0, lun 1
ACPI: PCI interrupt 0000:00:06.0[A] -> GSI 20 (level, high) -> IRQ 193
PCI: Setting latency timer of device 0000:00:06.0 to 64
USB Mass Storage device found at 3
usbcore: registered new driver usb-storage
USB Mass Storage support registered.
usb 1-2: new low speed USB device using address 4
input: USB HID v1.10 Mouse [Microsoft Microsoft 3-Button Mouse with
IntelliEye(TM)] on usb-0000:00:02.0-2
intel8x0_measure_ac97_clock: measured 303071 usecs
intel8x0: measured clock 21064 rejected
intel8x0: clocking to 48000
usb 1-3: new full speed USB device using address 5
cpci_hotplug: CompactPCI Hot Plug Core version: 0.2
pci_hotplug: PCI Hot Plug PCI Core version: 0.5
shpchp: shpc_init : shpc_cap_offset == 0
shpchp: shpc_init : shpc_cap_offset == 0
shpchp: Standard Hot Plug PCI Controller Driver version: 0.4
pciehp: PCI Express Hot Plug Controller Driver version: 0.4
ohci1394: $Rev: 1223 $ Ben Collins <email address hidden>
ACPI: PCI interrupt 0000:00:0d.0[A] -> GSI 22 (level, high) -> IRQ 177
PCI: Setting latency timer of device 0000:00:0d.0 to 64
ohci1394: fw-host0: OHCI-1394 1.1 (PCI): IRQ=[177] MMIO=[e1084000-e10847ff]
Max Packet=[2048]
ath_hal: module license 'Proprietary' taints kernel.
ath_hal: 0.9.11.6
wlan: 0.8.4.2 (EXPERIMENTAL)
ath_pci: no version for "ieee80211_ioctl_siwrate" found: kernel tainted.
ath_pci: 0.9.4.0 (EXPERIMENTAL)
ACPI: PCI interrupt 0000:01:06.0[A] -> GSI 18 (level, high) -> IRQ 201
ath0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
ath0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps
36Mbps 48Mbps 54Mbps
ath0: mac 5.9 phy 4.3 5ghz radio 4.6
ath0: 802.11 address: 00:0d:88:c9:d7:f3
ath0: Use hw queue 0 for WME_AC_BE traffic
ath0: Use hw queue 1 for WME_AC_BK traffic
ath0: Use hw queue 2 for WME_AC_VI traffic
ath0: Use hw queue 3 for WME_AC_VO traffic
ath0: Atheros 5212: mem=0xe0000000, irq=201
ohci1394: fw-host0: SelfID received outside of bus reset sequence
ieee1394: Host added: ID:BUS[0-00:1023] GUID[00301b301b38e481]
NET: Registered protocol family 10
Disabled Privacy Extensions on device c02c95c0(lo)
IPv6 over IPv4 tunneling driver
ACPI: Power Button (FF) [PWRF]
ACPI: Sleep Button (CM) [SLPB]
Linux Kernel Card Services
  options: [pci] [cardbus] [pm]
Intel ISA PCIC probe: not found.
Device 'i823650' does not have a release() function, it is broken and must be fixed.
Badness in device_release at drivers/base/core.c:85
 [<c018bbd8>] kobject_cleanup+0x40/0x65
 [<decf6e11>] init_i82365+0x6f/0x179 [i82365]
 [<c012afd2>] sys_init_module+0xe3/0x1d4
 [<c0105f49>] sysenter_past_esp+0x52/0x71
ath0: no IPv6 routers present
udf: registering filesystem
cdrom: open failed.
cdrom: open failed.
UDF-fs: No VRS found
ISO 9660 Extensions: Microsoft Joliet Level 3
ISO 9660 Extensions: RRIP_1991A
usb 1-3: USB disconnect, address 5
ohci_hcd 0000:00:02.1: wakeup
usb 2-3: new full speed USB device using address 2
----------------------------------------------------------
Below are the contents of the /dev directory:

sam@ernie /dev $ ls
MAKEDEV lp0 md7 ram9 tty20 tty43 tty9 ttyS30 ttyS53
adsp lvm md8 random tty21 tty44 ttyS0 ttyS31 ttyS6
agpgart mapper md9 rtc tty22 tty45 ttyS1 ttyS32 ttyS7
audio md0 mem sda tty23 tty46 ttyS10 ttyS33 ttyS8
cdrom md1 mixer sdb tty24 tty47 ttyS11 ttyS34 ttyS9
console md10 null shm tty25 tty48 ttyS12 ttyS35 urandom
core md11 port snd tty26 tty49 ttyS13 ttyS36 vcs
dsp md12 psaux sndstat tty27 tty5 ttyS14 ttyS37 vcs1
evms md13 ptmx stderr tty28 tty50 ttyS15 ttyS38 vcs2
fd md14 pts stdin tty29 tty51 ttyS16 ttyS39 vcs3
full md15 ram0 stdout tty3 tty52 ttyS17 ttyS4 vcs4
hda md16 ram1 tty tty30 tty53 ttyS18 ttyS40 vcs5
hda1 md17 ram10 tty0 tty31 tty54 ttyS19 ttyS41 vcs6
hda2 md18 ram11 tty1 tty32 tty55 ttyS2 ttyS42 vcs7
hda5 md19 ram12 tty10 tty33 tty56 ttyS20 ttyS43 vcsa
hdc md2 ram13 tty11 tty34 tty57 ttyS21 ttyS44 vcsa1
hdc1 md20 ram14 tty12 tty35 tty58 ttyS22 ttyS45 vcsa2
hdc2 md21 ram15 tty13 tty36 tty59 ttyS23 ttyS46 vcsa3
hdc3 md22 ram2 tty14 tty37 tty6 ttyS24 ttyS47 vcsa4
hdd md23 ram3 tty15 tty38 tty60 ttyS25 ttyS48 vcsa5
initctl md24 ram4 tty16 tty39 tty61 ttyS26 ttyS49 vcsa6
input md3 ram5 tty17 tty4 tty62 ttyS27 ttyS5 vcsa7
kmem md4 ram6 tty18 tty40 tty63 ttyS28 ttyS50 xconsole
kmsg md5 ram7 tty19 tty41 tty7 ttyS29 ttyS51 zero
log md6 ram8 tty2 tty42 tty8 ttyS3 ttyS52
sam@ernie /dev $

Nathaniel McCallum (nmccallum) wrote :

I think you mentioned on irc that you had this working under linux before. What
kernel version were you using before?

Hi,

Before I've had this working on Kernel 2.4 and 2.6. It's worked under FC 1, FC
2, and RH9. The latest kernel I had it working under was 2.6.5

Sam

Nathaniel McCallum (nmccallum) wrote :

I'm not sure what redhat is doing with their kernels as far as configuration,
but the usb scanner driver in the kernel is depreciated in 2.6. Therefore, we
aren't enabling it. This means two things: sane is built using libusb (all
userspace usb interface) and there may not be (doesn't need to be) a device file
in /dev.

However, sane should still work. On the command line: what do you get with
"scanimage -L"? Can you scan an image using scanimage (again command line)?

Hi, I do scanimage -L as root it gives me this:

device `epson:libusb:001:006' is a Epson GT-8200 flatbed scanner

However, if I do it as a normal user it returns no devices found on the system.
It also appears that it IS working to scan images through the command line
(scanimage) as root, but not as a normal user. In redhat, I needed to change the
permissions on the /dev/usb/scanner0 file in order for normal users to access
the scanner. Is it this type of issue I am encountering now? How to I change the
permission if there is no device file?

Thanks,

Sam

Nathan Howell (neh) wrote :

In Fedora changing the permissions of the /proc entry is what works. I guess for
your scanner that would be /proc/bus/usb/001/006.

OK -- problem solved. Thanks for helping me through this, and sorry it turned
out not to be a real bug. All I needed to do was

sudo chmod 777 /proc/usb/001/006

I'm I really stupid, or is there an easier way to do this, or _should_ this be
more obvious. I'm just thinking in terms of usibility, could it be possible to
just plug a scanner in as a normal user and have it work out of the box?

Thanks a lot for your help,

Sam

Matt Zimmerman (mdz) wrote :

Ick...why is this stuff moving toward /proc and away from /dev? That sounds
like a regression, for exactly the reasons described in this bug. Users
shouldn't need to fiddle with permissions in /proc to get peripherals to work.
We already have facilities for setting sane permissions in /dev automagically.

Anyway, the quick fix for this is probably to add a hotplug handler which sets
the permissions when the device is initialised, by dropping a file in
/etc/hotplug.d/usb

Nathan Howell (neh) wrote :
Matt Zimmerman (mdz) wrote :

This seems to be the only roadblock for many users in getting scanner support to
Just Work, and it's a small one, so it should be fixed for Warty.

Nathaniel McCallum (nmccallum) wrote :

/etc/hotplug/usb/libusbscanner does this for us already. The only problem is
that users are not in the scanner group. Should we add default users to the
scanner group? Should we change the group in this file to the video group?
mdz: what is your opinion?

Matt Zimmerman (mdz) wrote :

Ah, OK. Yes, we should add users to the scanner group, though the list of
groups certainly is accumulating.

Nathaniel McCallum (nmccallum) wrote :

Reassigning to Colin to fix default user groups.

Matt Zimmerman (mdz) wrote :

CCing Martin; gnome-system-tools needs updating as well

I am working on base-config to add the group scanner and the default user to it.

Matt Zimmerman (mdz) wrote :

Assigning the bug to you since you're working on it

Fixed with base-config ubuntu23.

Martin Pitt (pitti) wrote :

I will take care of g-s-t today.

Martin Pitt (pitti) wrote :

Created an attachment (id=234)
Trivial patch for g-s-t

Martin Pitt (pitti) wrote :

Fixed in gnome-system-tools 1.0.0-0ubuntu3.

Matt Zimmerman (mdz) wrote :

*** Bug 8720 has been marked as a duplicate of this bug. ***

Joe Hester (joeh-midsouth) wrote :

(In reply to comment #10)
> /etc/hotplug/usb/libusbscanner does this for us already. The only problem is
> that users are not in the scanner group. Should we add default users to the
> scanner group? Should we change the group in this file to the video group?
> mdz: what is your opinion?

I have an Epson 2400 scanner and I had to modify /etc/hotplug/usb/libusbscanner
to make it work as a user in the scanner group.

Changed the line:
  DEV=`expr $DEV + 1`
to
  DEV=`expr $DEV - 1`
and it works fine now.

I don't know if this is a bug or just a fix for me.

Matt Zimmerman (mdz) wrote :

I don't have a USB scanner to test with, so I'm not sure what the device
numbering looks like. Can you send the output of:

find /sys/bus/usb/devices
find /proc/bus/usb

Joe Hester (joeh-midsouth) wrote :

(In reply to comment #22)
> I don't have a USB scanner to test with, so I'm not sure what the device
> numbering looks like. Can you send the output of:
>
> find /sys/bus/usb/devices
/sys/bus/usb/devices
/sys/bus/usb/devices/4-3.3:1.0
/sys/bus/usb/devices/4-3.3
/sys/bus/usb/devices/4-3.2:1.0
/sys/bus/usb/devices/4-3.2
/sys/bus/usb/devices/4-3.1:1.0
/sys/bus/usb/devices/4-3.1
/sys/bus/usb/devices/4-4:1.0
/sys/bus/usb/devices/4-4
/sys/bus/usb/devices/4-3:1.0
/sys/bus/usb/devices/4-3
/sys/bus/usb/devices/4-0:1.0
/sys/bus/usb/devices/usb4
/sys/bus/usb/devices/3-0:1.0
/sys/bus/usb/devices/usb3
/sys/bus/usb/devices/2-0:1.0
/sys/bus/usb/devices/usb2
/sys/bus/usb/devices/1-0:1.0
/sys/bus/usb/devices/usb1

> find /proc/bus/usb
/proc/bus/usb
/proc/bus/usb/004
/proc/bus/usb/004/006
/proc/bus/usb/004/005
/proc/bus/usb/004/004
/proc/bus/usb/004/003
/proc/bus/usb/004/002
/proc/bus/usb/004/001
/proc/bus/usb/003
/proc/bus/usb/003/001
/proc/bus/usb/002
/proc/bus/usb/002/001
/proc/bus/usb/001
/proc/bus/usb/001/001
/proc/bus/usb/devices

Matt Zimmerman (mdz) wrote :

Based on that output, the code seems correct as-is. The sysfs numbering starts
from 0, and the /proc/bus/usb numbering starts from 1, so it adds 1 to the sysfs
value to get the procfs value.

What led you to the conclusion that it needed to be changed? Can you provide
more detail about the problem?

Joe Hester (joeh-midsouth) wrote :

(In reply to comment #24)
> Based on that output, the code seems correct as-is. The sysfs numbering starts
> from 0, and the /proc/bus/usb numbering starts from 1, so it adds 1 to the sysfs
> value to get the procfs value.
>
> What led you to the conclusion that it needed to be changed? Can you provide
> more detail about the problem?

I modified /etc/hotplug/usb/libusbscanner
  DEV=`echo $DEVPATH | sed 's/\(bus\/usb\/devices\/\)\(.*\)-\(.*\)/\3/'`
  echo $DEVPATH >> /home/joeh/dev.txt
  echo $IF >> /home/joeh/dev.txt
  echo $DEV >> /home/joeh/dev.txt
  DEV=`expr $DEV + 1`

The contents of /home/joeh/dev.txt after running /etc/init.d/hotplug start
bus/usb/devices/4-4
4
4
bus/usb/devices/4-4/4-4:1.0
4-4/4
4:1.0

The output of lsusb
Bus 004 Device 006: ID 043d:0057 Lexmark International, Inc. Z35 Printer
Bus 004 Device 005: ID 04f9:000d Brother Industries, Ltd HL-1440 Laser Printer
Bus 004 Device 004: ID 0781:9393 SanDisk Corp.
Bus 004 Device 003: ID 04b8:011b Seiko Epson Corp. Perfection 2400 Photo
Bus 004 Device 002: ID 0409:0058 NEC Corp. HighSpeed Hub
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000

The scanner is Bus 004 Device 003 but /etc/hotplug/usb/libusbscanner is using
Bus 004 Device 004.

Why? I don't know enough about how this works to understand what is wrong here.

Matt Zimmerman (mdz) wrote :

If it was using 4/4 and you changed the +1 to a -1, would that not cause it to
use 4/2, rather than 4/3?

Joe Hester (joeh-midsouth) wrote :

(In reply to comment #26)
> If it was using 4/4 and you changed the +1 to a -1, would that not cause it to
> use 4/2, rather than 4/3?

No it was 4/4 before adding 1.
That's why I changed it from +1 to -1 so it would use 4/3 instead of 4/5

Matt Zimmerman (mdz) wrote :

Ah, of course. I misread your previous comment.

Nathaniel McCallum (nmccallum) wrote :

Users are in the scanner group by default now, so I'm going to downgrade bug
severity. However, in the case of Joe's bug, hotplug seems to be reporting the
incorrect devpath. This does not happen to me with my canon scanner. Matt do
you have any ideas why hotplug would report the wrong devpath?

Joe Hester (joeh-midsouth) wrote :

(In reply to comment #29)
> Users are in the scanner group by default now, so I'm going to downgrade bug
> severity. However, in the case of Joe's bug, hotplug seems to be reporting the
> incorrect devpath. This does not happen to me with my canon scanner. Matt do
> you have any ideas why hotplug would report the wrong devpath?

I found this in the gentoo bugs: http://bugs.gentoo.org/show_bug.cgi?id=50934

Apparently, it makes a difference whether the device is plugged in at boot
(coldplug?) or plugged in after boot (hotplug?). I haven't tried plugging in
after boot since my scanner is always plugged in to the same usb port.

Alfredo Yunes (alyunes) wrote :

Maybe this may help.

If I connect the scanner (Epson Perfection 1660 USB) directly to the PC it works. The scanner does NOT work (unless I'm logged in as root) if it's connected
to a USB hub (in my case a Dlink 4 port hub). I can provide additional info if needed.

Matt Zimmerman (mdz) wrote :

Herbert, do you know of any reason why hotplug could be receiving unexpected
values this way? Or is the problem something else? The gentoo bug has more
details.

Xavier Bestel (xavier-bestel) wrote :

I have a snapscan e20 (USB), and have the same problem: at boot,
permissions/ownership aren't correct on /proc/bus/usb/nnn/nnn, they are
0644/root.root, but when I unplug/replug it, they are correctly set to
0660/root.scanner

Matt Zimmerman (mdz) wrote :

*** Bug 9462 has been marked as a duplicate of this bug. ***

Martin Pitt (pitti) wrote :

> DEV=`echo $DEVPATH | sed 's/\(bus\/usb\/devices\/\)\(.*\)-\(.*\)/\3/'`
> DEV=`expr $DEV + 1`

Adding or substracting numbers from a device is only a gamble, we won't gain
anything by changing the + to a -.

Can everybody please try to replace /etc/hotplug/usb/libusbscanner by the
following script

  http://bugs.gentoo.org/attachment.cgi?id=33423

This uses sysfs to query device numbers instead of guesstimating them. Please
report whether it works.

Thanks!

Martin

Martin Pitt (pitti) wrote :

Lacking both a scanner and feedback, I uploaded a new version without being able
to test it:

 sane-backends (1.0.15-2ubuntu1) hoary; urgency=low
 .
   * debian/patches/33_sysfs_libusbscanner.dpatch:
     + Added; use sysfs to look up device numbers instead of guesstimating them
       (Ubuntu bug #8241)

So please reopen the bug and cry out loudly if it breaks.

Matt Zimmerman (mdz) wrote :

*** Bug 11811 has been marked as a duplicate of this bug. ***

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.