hybrid usb backend doesn't work with usblp if printer needs to load firmware (HP LJ 1000/1005/1018/1020/P100x/...)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
foo2zjs (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: cups
This is in Ubuntu 9.10, with CUPS version 1.4.1-5ubuntu2.4.
The first symptom of the problem is that the printer is not discovered. Invoking the usb backend directly shows the same:
0$ sudo /usr/lib/
DEBUG: list_devices_libusb
DEBUG: usb_find_busses=2
DEBUG: usb_find_devices=5
0$
Running this in strace reveals a few things. The device is on bus 1, id 100:
0$ sudo lsusb
Bus 002 Device 002: ID 046d:c51a Logitech, Inc. MX Revolution/G7 Cordless Mouse
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 100: ID 03f0:2b17 Hewlett-Packard LaserJet 1020
Bus 001 Device 099: ID 04cc:1520 Philips Semiconductors
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
0$ ls -l /dev/bus/usb/001/
total 0
crw-rw-r-- 1 root root 189, 0 2010-03-20 14:15 001
crw-rw-r-- 1 root root 189, 98 2010-03-20 20:28 099
crw-rw---- 1 root lp 189, 99 2010-03-20 21:02 100
From the trace, when an attempt is made to configure this device in the libusb part of the hybrid backend, an EBUSY error is encountered:
open("/
ioctl(3, USBDEVFS_
ioctl(3, USBDEVFS_
close(3) = 0
This seems to be because the device has been claimed by usblp. Next, the usblp part of the backend tries to discover the device:
open("/dev/usblp0", O_RDWR|
ioctl(3, SNDCTL_DSP_SYNC, 0xbfe397ad) = -1 EIO (Input/output error)
close(3) = 0
For some reason, the ioctl here is failing (ignore the ioctl name, it's not accurate). My best guess is that the earlier fidgeting with the USB device left it in a bad state. The failure of this ioctl seems to be the core cause of the discovery failure. After this occurs in the trace, the usblp backend runs through several more possible lp device names, all producing ENOENT, before giving up.
So, moving from the strace to the failing ioctl, it seems clear that this is the LPIOC_GET_DEVICE_ID call in backendGetDeviceID from ieee1284.c (which is invoked from list_devices_unix in the hybrid backend). I dove into the kernel code to see if I could figure out why it would return EIO.
The implementation of this ioctl is found in drivers/
http://
It looks to me like it can only return EIO if the call to usblp_cache_
That's all I've got so far.
Related branches
summary: |
- hybrid usb backend doesn't work with usblp + hybrid usb backend doesn't work with usblp if printer needs to load + firmware (HP LJ 1000/1005/1018/1020/P100x/... |
summary: |
hybrid usb backend doesn't work with usblp if printer needs to load - firmware (HP LJ 1000/1005/1018/1020/P100x/... + firmware (HP LJ 1000/1005/1018/1020/P100x/...) |
I've found some additional details about this problem. First, if I stop the CUPS service before I turn on the printer the probe works fine, and locates the printer as a usblp device. I can then start CUPS and print without issue (I assume... I'm not actually wasting paper testing this, since the failure to discover the printer is the primary issue).
This, and some additional testing, suggest that the problem is related to the timing of the probe. The printers in this line lack the internal memory to store their firmware, and instead load the firmware when they are first turned on or connected. It's obvious to the user when this is happening because the printer noisily "runs" while the firmware loads (the paper rollers turn, I guess). This takes a good 5 or 6 seconds.
I'm hypothesizing that probing the printer while the firmware is loading causes the problem. Maybe it even corrupts the firmware.
Further investigation pending.