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
libusb-based USB backend: Further fixes #4128
Comments
CUPS.org User: upscope Tim been have problems printing Landscape with brothers printer on usb (CUPS 1.5.0 for openSUSE 12.1. Do you think its worth trying this patch? Also is there a document on appling patches? |
CUPS.org User: till.kamppeter upscope, to apply a patch uncompress the source .tar.gz (or .tar.bz2) file of CUPS, go into the main directory of the source and run the command patch -p0 < file.patch with "file.patch" replaced by the name of the patch file. Patches for both CUPS 1.5.x and 1.6.x are attached to this STR. After that compile and install as usual. |
CUPS.org User: till.kamppeter I have continued the development of the USB CUPS backend, especially with a Prolific Technology USB -> Parallel adapter at hand. The new patches are usb-libusb-c-update-1-6-x-2.patch The added changes are:
Can you please apply these updated patches to CUPS 1.6.x and 1.5.x? This should solve most problems. |
CUPS.org User: till.kamppeter Another small update: The new patches are usb-libusb-c-update-1-6-x-3.patch The added changes are:
Can you please apply these updated patches to CUPS 1.6.x and 1.5.x? This change and the previous changes should be considered as bug fixes and preparation for future debugging. |
CUPS.org User: till.kamppeter Another small update: The new patches are usb-libusb-c-update-1-6-x-4.patch The added changes are:
Can you please apply these updated patches to CUPS 1.6.x and 1.5.x? This change and the previous changes should be considered as bug fixes and preparation for future debugging. |
CUPS.org User: jsmeix.suse FYI regarding "USB device reset after finishing each job": On all-in-one USB devices a USB device reset (i.e. a reset of In this case an all-in-one USB device reset because In other words: A reset of a whole USB all-in-one device According to I don't know if particular hardware like the Prolific Till, |
CUPS.org User: till.kamppeter Johannes, what I could do to improve that is making the after-job reset a quirk option, currently only applying to the Prolific USB -> Parallel adaptor. The quirk behavior is hard-coded, it is the same as in the usblp kernel module with some added quirk rules. For some quirk time there are also admin-settable options:
|
CUPS.org User: jsmeix.suse Regarding hard-coded quirk behavior as in usblp kernel module: Quirks in the kernel must be hard-coded because the kernel In contrast quirks in application programs (from the kernel's For debugging of issues that happen on other user's systems Furthermore for debugging the libusb-based USB backend |
CUPS.org User: mike Fixed in Subversion repository. Please open a new bug with new patches when you decide how you want to deal with the different quirk modes. |
"usb-libusb-c-update-1-6-x.patch": --- backend/usb-libusb.c 2012-06-22 11:53:18.043277991 +0200
/*
/*
- g.read_thread_stop = 1;- pthread_mutex_lock(&g.read_thread_mutex);
- fputs("DEBUG: Waiting for read thread to exit...\n", stderr);
- }
if (!g.read_thread_done)
- stderr);
if (print_fd) int errcode; /* Return value of libusb function */
@@ -782,16 +850,29 @@
@@ -1095,8 +1176,12 @@
printer->usblp_attached = 0; @@ -1132,14 +1217,9 @@ printer->usblp_attached = 0;
/*
if (number1 != current)
@@ -1620,7 +1737,7 @@
/*
|
"usb-libusb-c-update-1-5-x.patch": --- backend/usb-libusb.c 2012-06-22 11:53:36.103353715 +0200
/*
/*
- g.read_thread_stop = 1;- pthread_mutex_lock(&g.read_thread_mutex);
- fputs("DEBUG: Waiting for read thread to exit...\n", stderr);
- */
- stderr);
if (print_fd) int errcode; /* Return value of libusb function */
errcode =
@@ -782,16 +850,29 @@
@@ -1095,8 +1176,12 @@
printer->usblp_attached = 0; @@ -1132,14 +1217,9 @@ printer->usblp_attached = 0;
/*
if ((errcode = if (number1 != current)
@@ -1620,7 +1737,7 @@
/*
|
"usb-libusb-c-update-1-6-x-2.patch": --- backend/usb-libusb.c 2012-06-22 11:53:18.043277991 +0200
@@ -99,6 +103,54 @@ +/*
+#define USBLP_QUIRK_BIDIR 0x1 /* reports bidir but requires
/*
/*
/*
- g.read_thread_stop = 1;- pthread_mutex_lock(&g.read_thread_mutex);
- cond_timeout.tv_nsec = tv.tv_usec * 1000;
- }
if (!g.read_thread_done)
- stderr);
if (print_fd) int errcode; /* Return value of libusb function */
@@ -764,7 +889,10 @@
@@ -782,16 +910,41 @@
@@ -1095,8 +1248,12 @@
printer->usblp_attached = 0; @@ -1132,14 +1289,9 @@ printer->usblp_attached = 0;
/*
if (number1 != current)
+/*
+/*
@@ -1620,7 +1834,7 @@
/*
|
"usb-libusb-c-update-1-5-x-2.patch": --- backend/usb-libusb.c 2012-06-22 11:53:36.103353715 +0200
@@ -99,6 +103,54 @@ +/*
+#define USBLP_QUIRK_BIDIR 0x1 /* reports bidir but requires
/*
/*
/*
- g.read_thread_stop = 1;- pthread_mutex_lock(&g.read_thread_mutex);
- }
- */
- stderr);
if (print_fd) int errcode; /* Return value of libusb function */
errcode =
@@ -764,7 +889,10 @@
@@ -782,16 +910,41 @@
@@ -1095,8 +1248,12 @@
printer->usblp_attached = 0; @@ -1132,14 +1289,9 @@ printer->usblp_attached = 0;
/*
if ((errcode = if (number1 != current)
+/*
+/*
@@ -1620,7 +1834,7 @@
/*
|
"usb-libusb-c-update-1-6-x-3.patch": --- backend/usb-libusb.c 2012-06-22 11:53:18.043277991 +0200
@@ -99,6 +103,54 @@ +/*
+#define USBLP_QUIRK_BIDIR 0x1 /* reports bidir but requires
/*
/*
/*
- g.read_thread_stop = 1;- pthread_mutex_lock(&g.read_thread_mutex);
- fputs("DEBUG: Waiting for read thread to exit...\n", stderr);
- cond_timeout.tv_nsec = tv.tv_usec * 1000;
if (!g.read_thread_done)
- stderr);
if (print_fd) int errcode; /* Return value of libusb function */
errcode =
@@ -764,7 +903,10 @@
@@ -782,16 +924,41 @@
@@ -1095,15 +1262,19 @@
printer->usblp_attached = 0; if (verbose)
/*
if (number1 != current)
+/*
+/*
@@ -1620,7 +1848,7 @@
/*
|
"usb-libusb-c-update-1-5-x-3.patch": --- backend/usb-libusb.c 2012-06-22 11:53:36.103353715 +0200
@@ -99,6 +103,54 @@ +/*
+#define USBLP_QUIRK_BIDIR 0x1 /* reports bidir but requires
/*
/*
/*
@@ -515,50 +611,54 @@
- g.read_thread_stop = 1;- pthread_mutex_lock(&g.read_thread_mutex);
- cond_timeout.tv_nsec = tv.tv_usec * 1000;
- */
- stderr);
if (print_fd) int errcode; /* Return value of libusb function */
@@ -764,7 +903,10 @@
@@ -782,16 +924,41 @@
@@ -959,7 +1126,7 @@
printer->usblp_attached = 0; if (verbose)
/*
if ((errcode = if (number1 != current)
+/*
+/*
@@ -1620,7 +1848,7 @@
/*
|
"usb-libusb-c-update-1-6-x-4.patch": --- backend/usb-libusb.c 2012-06-22 11:53:18.043277991 +0200
@@ -99,6 +104,55 @@ +/*
+#define USBLP_QUIRK_BIDIR 0x1 /* reports bidir but requires
/*
/*
g.print_fd = print_fd;
/*
/*
@@ -515,38 +614,18 @@
- g.read_thread_stop = 1;- pthread_mutex_lock(&g.read_thread_mutex);
- fputs("DEBUG: Waiting for read thread to exit...\n", stderr);
- cond_timeout.tv_nsec = tv.tv_usec * 1000;
if (!g.read_thread_done)
- stderr);
if (print_fd) int errcode; /* Return value of libusb function */
errcode =
@@ -764,7 +921,10 @@
@@ -782,16 +942,41 @@
@@ -1095,15 +1280,20 @@
printer->usblp_attached = 0;
if (verbose)
/*
if (number1 != current)
+/*
+/*
@@ -1620,7 +1867,7 @@
/*
|
"usb-libusb-c-update-1-5-x-4.patch": --- backend/usb-libusb.c 2012-06-22 11:53:36.103353715 +0200
@@ -99,6 +104,55 @@ +/*
+#define USBLP_QUIRK_BIDIR 0x1 /* reports bidir but requires
/*
/*
g.print_fd = print_fd;
/*
/*
- g.read_thread_stop = 1;- pthread_mutex_lock(&g.read_thread_mutex);
- fputs("DEBUG: Waiting for read thread to exit...\n", stderr);
- */
- stderr);
if (print_fd) int errcode; /* Return value of libusb function */
@@ -764,7 +921,10 @@
@@ -782,16 +942,41 @@
@@ -1095,15 +1280,20 @@
printer->usblp_attached = 0;
if (verbose)
/*
if ((errcode = if (number1 != current)
+/*
+/*
@@ -1620,7 +1867,7 @@
/*
|
I came here from https://wiki.archlinux.org/index.php/CUPS/Troubleshooting#USB_printers |
@averagejoey2000 At this point I have nothing I can help you with. If there is something we can change in the backend to help you, we are happy to accommodate you and the other Linux distributions, but right now it looks like the right answer is to simply blacklist the usblp module since the USB backend is a complete replacement for general printing purposes... |
Version: 1.6-current
CUPS.org User: till.kamppeter
Based on work together with Ubuntu bug reporters I succeeded to fix several issues with the libusb-based CUPS backend. Now practically all real USB printers (no USB->Parallel adapters) work.
Patches for 1.6.x and 1.5.x are attached.
Following Ubuntu bugs are solved:
https://bugs.launchpad.net/ubuntu/+source/cups/+bug/1000253
Brother HL-1440 printing extra page with PJL codes
https://bugs.launchpad.net/ubuntu/+source/cups/+bug/995111
Print failure since upgrade to 12.04
For following bug I have added a configuration option:
https://bugs.launchpad.net/ubuntu/+source/cups/+bug/1001028
Delay after every print job on USB
Blacklisting the usblp kernel module is not needed any more, the usblp backend correctly detaches and re-attaches the module.
The changes I have done are:
devices where no read endpoint is found.
reset without reconnecting.
configuration, before re-attaching the usblp kernel module.
mode. This allows to work around problems with bi-di communications,
especially also a delay at the end of the job caused by closing the
read channel (happens only for some devices). Also useful for
debugging.
Can this be put into CUPS 1.6.x/1.5.x? Thanks.
The text was updated successfully, but these errors were encountered: