apple / cups

Apple CUPS Sources
https://www.cups.org
Apache License 2.0
1.93k stars 464 forks source link

USB backend fails to work nearly ever. #2194

Closed michaelrsweet closed 17 years ago

michaelrsweet commented 17 years ago

Version: 1.2.7 CUPS.org User: mbt

First off, I can include log files (and I will) but they're not going to help out at all; the problem that I am having does not log.

I can configure USB printing just fine via the web interface. However, once the printer is setup, it does not print. It kicks off the Ghostscript process, and kicks off the USB back-end, and does nothing. The USB backend then becomes idle and will not die on signals 9 or 15, and I find that I have to send it a signal 11 to actually kill it.

This on FreeBSD 6.2, CUPS 1.2.7, ESP Ghostscript 8.15.3.

The printer /almost/ works using the “file” backend, but it is unreliable and needs a lot of hand-holding. If a print job is cancelled, the printer does not print subsequent jobs correctly, and I have to restart the printer. When I turn the printer off, its USB device node disappears and CUPS appears to bail out. So, when I cancel a job, in reality I have to cancel a job, power-cycle the printer, and then restart CUPS.

If you need anything I will try to provide it. I don't know why the USB back-end isn't working—I can cat files to the printer just fine (PCL files; it's a PCL printer that speaks PCL 5 and PCL/XL).

michaelrsweet commented 17 years ago

CUPS.org User: rea-cups

Michael!

Seems like your printer reports bi-directional mode to the FreeBSD kernel, but really operating correctly only for uni-directional mode. Please, provide the outputs from the 'dmesg | grep ulpt' and 'usbdevs -v' commands. The latter requires privileges to read and write to /dev/usb* entries, so you better be root for it.

If I am correct, then the line should be added to the usb_quirks.c file and the PR (problem report) should be submitted to FreeBSD. If you will be able to do this -- it is fine. If you'll not be able -- I can do it.

michaelrsweet commented 17 years ago

CUPS.org User: mbt

Here is the information that you requested. From dmesg: ulpt0: Lexmark International Lexmark E240, rev 2.00/1.00, addr 2, iclass 7/1 ulpt0: using bi-directional mode ulpt0: at uhub0 port 8 (addr 2) disconnected ulpt0: detached ulpt0: Lexmark International Lexmark E240, rev 2.00/1.00, addr 2, iclass 7/1 ulpt0: using bi-directional mode

From usbdevs -v: Controller /dev/usb0: addr 1: full speed, self powered, config 1, OHCI root hub(0x0000), nVidia(0x0000), rev 1.00 port 1 powered port 2 powered port 3 powered port 4 powered port 5 powered port 6 powered port 7 powered port 8 addr 2: full speed, self powered, config 1, Lexmark E240(0x00cb), Lexmark International(0x043d), rev 1.00 port 9 powered port 10 powered Controller /dev/usb1: addr 1: high speed, self powered, config 1, EHCI root hub(0x0000), nVidia(0x0000), rev 1.00 port 1 powered port 2 powered port 3 powered port 4 powered port 5 powered port 6 powered port 7 powered port 8 powered port 9 powered port 10 powered

michaelrsweet commented 17 years ago

CUPS.org User: rea-cups

Michael, good day!

Fine, seems like bidirectional USB is broken on your printer, as expected. Please, try the attached patch, usb_quirks.c-lexmark-e240.patch. If was generated on FreeBSD-6.2. To apply it, go to the /sys/dev/usb directory and spawn the command 'patch < path-to-the-downloaded-patchfile'. It should respond with the message like

Hmm... Looks like a unified diff to me...

The text leading up to this was:

|--- usb_quirks.c.orig Wed Jan 17 11:08:57 2007

|+++ usb_quirks.c Wed Jan 17 11:15:14 2007

Patching file usb_quirks.c using Plan A... Hunk #1 succeeded at 90.

done

Then rebuild your kernel (cd /usr/src; make kernel), reboot when kernel will be rebuilt and watch for kernel messages about ulpt0. It should report 'ulpt0: using uni-directional mode'. And if it will be so, try to print something.

Note: I did not tried to recompile the kernel with my patch, since it is almost trivial. But may there are some error in my patch, though unlikely. If your kernel will not compile, send me the error message. One more thing: if you know how to recompile your kernel, then you can do it as usual.

michaelrsweet commented 17 years ago

CUPS.org User: mbt

Okay. I will give it a shot; it will take me some time, though. I have only built FreeBSD once, and it took me quite a long time. Thanks for the patch, and I will let you know when I know, one way or another. It shouldn’t take me any longer than a week or two to find the time to work on getting this to work.

Thanks again, and I will let you know what happens.

michaelrsweet commented 17 years ago

CUPS.org User: rea-cups

Michael, fine, will wait for the results. If you compiled the kernel only once, then probably the best way to do it is (cd /usr/src; make kernel) and reboot. At least it is 'officially supported' scheme.

michaelrsweet commented 17 years ago

CUPS.org User: mbt

Heh.

Alright, well, I have rebuilt the kernel, and I get the log message at bootup:

ulpt0: Lexmark International Lexmark E240, rev 2.00/1.00, addr 2, iclass 7/1 ulpt0: using uni-directional mode

So, that part worked. The ‘diff -u’ patch you supplied, however, did not apply itself to the sources at all. It appears my copy of 6.2-RELEASE is missing that Xerox line and so it refused to patch it, so I did it manually.

However, now that I have done that and reinstalled CUPS and ESPGS as I did before, I am stuck without a functioning printer at all. I am getting an “invalidfont in findfont” error that I am attempting to track down and fix, but am seemingly failing to do so. Arrgh.

I will let you know as soon as I fix that, whether or not your patch worked to fix my problem. Much appreciation! :-)

michaelrsweet commented 17 years ago

CUPS.org User: rea-cups

Michael, good day!

Were there any progress with your Lexmark printer under FreeBSD?

Thanks!

michaelrsweet commented 17 years ago

CUPS.org User: mbt

No. However… Linux uses it in bidirectional mode just fine. And I know that I did nothing special in the past with FreeBSD when I was using the printer before (the last time I had it attached to a FreeBSD machine was with a 5.2-R box, I think).

usb 1-8: new full speed USB device using ohci_hcd and address 2 usb 1-8: configuration #1 chosen from 1 choice drivers/usb/class/usblp.c: usblp0: USB Bidirectional printer dev 2 if 0 alt 0 proto 2 vid 0x043D pid 0x00CB usbcore: registered new driver usblp drivers/usb/class/usblp.c: v0.13: USB Printer Device Class driver

So, I am starting to not think that it is a problem with the printer or how it treats bi-directionalness. I think there is a bug somewhere in the FreeBSD system—and that I am not competent enough to find it.

michaelrsweet commented 17 years ago

CUPS.org User: mike

Closing CUPS bug on this; please continue this through the FreeBSD channels...

michaelrsweet commented 17 years ago

"usb_quirks.c-lexmark-e240.patch":

--- usb_quirks.c.orig Wed Jan 17 11:08:57 2007 +++ usb_quirks.c Wed Jan 17 11:15:14 2007 @@ -90,6 +90,8 @@ { USB_VENDOR_HP, USB_PRODUCT_HP_1220C, ANY, { UQ_BROKEN_BIDIR }}, /* Xerox WorkCentre M15 */ { 0x0924, 0xffef, ANY, { UQ_BROKEN_BIDIR }},