Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usb backend fails, reports 'Failed to detach "usblp" module from NNNN:NNNN' #5908

Closed
bitwombat opened this issue Mar 27, 2021 · 5 comments
Closed
Assignees
Labels
bug Something isn't working platform issue Issue is specific to an OS or desktop priority-low

Comments

@bitwombat
Copy link

bitwombat commented Mar 27, 2021

While debugging why my USB-connected printer wasn't being seen by CUPS on Ubuntu 20.04, I ended up running /usr/lib/cups/backend/usb and, thankfully, debug output is produced (very much yay!):

DEBUG: Loading USB quirks from "/usr/share/cups/usb".
DEBUG: Loaded 95 quirks.
DEBUG: list_devices
DEBUG: libusb_get_device_list=11
DEBUG: Failed to detach "usblp" module from 04f9:00a2

This happens on HEAD/b27a49b8a as well.

The usblp module is not loaded. I've rmmod'ed it and also blacklisted and rebooted. Same results.

No CUPS errors in error_log

Printer is a Brother HL-L2375DW

I'm compiling locally, so if you want me to sprinkle any printf's around to help debug, let me know.

Note: After I hacked backend/usb-libusb.c to get rid of the module removing code, everything works.

@bitwombat
Copy link
Author

Update/possible clue: ippusbxd was actually installed as well, and a week after getting everything to work, it took over the printer for some reason, and CUPS/usb stopped working. I only found it by luck and apt purged it, and things started working again.

And, now, my un-hacked, /usr/share/cups/usb works.

So is maybe just the error message is wrong? Along with a ippusbxd/CUPS bug.

@michaelrsweet
Copy link
Collaborator

@bitwombat OK, so this definitely is useful information!

The way that the USB printer class is defined, printers can provide a primary protocol and an alternate protocol for each set of endpoints, where protocol 1 and 2 are unidirectional and bidirectional "raw" protocols, 3 is IEEE 1284.4, and 4 is IPP-USB. In most printers only one protocol can be active at any time due to hardware limitations, so when ippusbxd finds an IPP-USB printer it immediately claims the printer's endpoints. Since most printers do not support simultaneous USB legacy and IPP-USB, that prevents you from using the legacy USB endpoints for printing...

Now, since your Brother printer supports IPP-USB (and AirPrint), you don't need to use the Brother driver at all but can just use the IPP Everywhere driver with ippusbxd. Or you could use the Brother driver with ippusbxd. Or you could remove ippusbxd (like you did) and use the Brother driver.

So what we'll be doing (over in OpenPrinting CUPS) is to update the USB backend to show a better error and/or exclude printers when IPP-USB is supported and ippusbxd is present.

@michaelrsweet michaelrsweet self-assigned this Apr 7, 2021
@michaelrsweet michaelrsweet added bug Something isn't working platform issue Issue is specific to an OS or desktop priority-low labels Apr 7, 2021
@michaelrsweet
Copy link
Collaborator

Will track the fix for this in the OpenPrinting bug I just created.

@bitwombat
Copy link
Author

Thanks for all thosedetails @michaelrsweet. I now understand a lot more about CUPS and printers.

Please note that CUPS did not pick up the printer when ippusbxd was in operation... that's the whole reason I had to get down to this level of detail. Can create a different bug if this is of interest (no idea if it's uppusbxd's problem or CUPS').

@michaelrsweet
Copy link
Collaborator

@bitwombat Please do file a bug, but against cups-filters which is the component that is responsible for IPP-USB support on Linux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working platform issue Issue is specific to an OS or desktop priority-low
Projects
None yet
Development

No branches or pull requests

2 participants