mounaiban / captdriver

Driver for Canon CAPT printers
GNU General Public License v3.0
87 stars 16 forks source link

LBP3000 - "CAPT: no reply from printer" after printing 2nd page [Alpine Linux 3.12, aarch64] #6

Closed ralismark closed 4 years ago

ralismark commented 4 years ago

Thanks for you work on this driver!

I'm currently running prerelease 0.1.4-m3 on alpine linux on my raspberry pi 3. When I try to print more than 2 pages, the first two are printed fine, but then the driver stops with "CAPT: no reply from printer". I'm unable to print again until I power cycle the printer.

mounaiban commented 4 years ago

Thanks for your feedback. I am currently investigating compatibility issues on both 32 and 64-bit x86 GNU/Linux with the LBP2900, but I might shift focus onto Raspberry Pi compatibility as it has come to my attention that there might be a significant number of users using Canon personal printers with RPi's. I don't currently own an RPi, but that may change in the future. 🤓

In the meantime, what version of libusb are you running?

I am suspecting the use of an older version of libusb (1.0.22 or earlier). The only successful use of this driver after commit 216fddb on an RPi was on Ubuntu Server 19.10 with libusb 1.0.23. For more information, see this conversation: https://github.com/mounaiban/captdriver/commit/18797c4c8edf916add31c09a2c527cf284021e14#r38572647, which continues on #3.

ralismark commented 4 years ago

I tried running a 3-page print just then, and this issue appears to have been fixed. This is on Alpine Linux 3.12 (aarch64), with libusb version 1.0.23-r0.

mounaiban commented 4 years ago

Glad that the driver is working for you! 🤓 I'll leave this open for another couple weeks or so, just in case you find another bug related to this issue.

blmhemu commented 2 years ago

Hey ! Just got this issue on my rpi - CAPT: no reply from printer Printer is LBP2900

mounaiban commented 2 years ago

@blmhemu Are you also running 64-bit Alpine Linux 3.12? I am suspecting that one cause, the dreaded CUPS-libusb backend issues that is the single largest sticking point for this driver.

For now, maybe try enabling the no-reattach quirk for the printer in the CUPS USB quirks file?

The file is at $(cups-config --datadir)/usb/org.cups.usb-quirks (which resolves to /usr/share/cups/usb/org.cups.usb-quirks on most desktop Linux systems), and try adding the following lines to the file:

# Canon LBP2900
0x04a9 0x2676 no-reattach

This hack was previously discussed on: https://github.com/agalakhov/captdriver/issues/15#issuecomment-600539039

If this doesn't fix the problem, you may have to use Ubuntu instead as we are still investigating how to work around the communications bug.

To confirm the backend difficulties, check the CUPS error log (usually at /var/log/cups/) for repeated communications failures. They look like these: https://github.com/agalakhov/captdriver/issues/7#issuecomment-748621016; the actual bytes may vary but it's always the same bytes sent over and over again.

Remember to enable debug logging with cupsctl --debug-logging before printing.

blmhemu commented 2 years ago

Yup ! I was using alpine. When I switched to ubuntu it worked flawlessly. Is it musl related ?

mounaiban commented 2 years ago

All I can really say is I don't know :ghost:

It seems that even the slightest changes in the way CUPS was built affects the way it interacts with libusb. Linking with a different libusb version, let alone a different 'libc, is enough to introduce subtle but important differences. I haven't even mentioned compiler flags. That is why some distros work and some don't.

As a full-time bi-directional driver, captdriver is more deeply affected by these differences than, say, the built-in PCL drivers.

While we are at it, this is one of the reasons that I am all for deterministic builds.