* [Printing-architecture] [patch] CUPS 1.7.0: fix corrupted output for USB printers
@ 2013-11-29 12:08 Tim Waugh
2013-12-02 16:33 ` Michael Sweet
0 siblings, 1 reply; 2+ messages in thread
From: Tim Waugh @ 2013-11-29 12:08 UTC (permalink / raw)
To: printing-architecture@lists.linux-foundation.org
[-- Attachment #1.1: Type: text/plain, Size: 809 bytes --]
When using the usb backend, if a usb-1 printer connected to a usb-2 hub
runs out of paper during the job the print output will be corrupted.
https://bugzilla.redhat.com/show_bug.cgi?id=1026914
This is due to using a 60 second timeout for the libusb_bulk_transfer()
call. Timeout handling and retries are not reliable in every case, as
described here:
https://bugzilla.redhat.com/show_bug.cgi?id=1035863
Quoting from that report:
==>
So TL;DR: this a known and unfixable problem, and the solution is to
simply not cancel transfers (by setting a timeout) and then decide you
want to finish the transfer after all. Either decide you want to really
cancel the transfer, or just wait for it to finish normally.
<==
Patch attached to change the timeout to 0 to wait indefinitely.
Tim.
*/
[-- Attachment #1.2: cups-usb-timeout.patch --]
[-- Type: text/x-patch, Size: 1107 bytes --]
diff -up cups-1.7.0/backend/usb-libusb.c.usb-timeout cups-1.7.0/backend/usb-libusb.c
--- cups-1.7.0/backend/usb-libusb.c.usb-timeout 2013-07-17 16:51:43.000000000 +0100
+++ cups-1.7.0/backend/usb-libusb.c 2013-11-28 16:44:03.785124015 +0000
@@ -496,7 +496,7 @@ print_device(const char *uri, /* I - De
iostatus = libusb_bulk_transfer(g.printer->handle,
g.printer->write_endp,
print_buffer, g.print_bytes,
- &bytes, 60000);
+ &bytes, 0);
/*
* Ignore timeout errors, but retain the number of bytes written to
* avoid sending duplicate data...
@@ -519,7 +519,7 @@ print_device(const char *uri, /* I - De
iostatus = libusb_bulk_transfer(g.printer->handle,
g.printer->write_endp,
print_buffer, g.print_bytes,
- &bytes, 60000);
+ &bytes, 0);
}
/*
@@ -534,7 +534,7 @@ print_device(const char *uri, /* I - De
iostatus = libusb_bulk_transfer(g.printer->handle,
g.printer->write_endp,
print_buffer, g.print_bytes,
- &bytes, 60000);
+ &bytes, 0);
}
if (iostatus)
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 482 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Printing-architecture] [patch] CUPS 1.7.0: fix corrupted output for USB printers
2013-11-29 12:08 [Printing-architecture] [patch] CUPS 1.7.0: fix corrupted output for USB printers Tim Waugh
@ 2013-12-02 16:33 ` Michael Sweet
0 siblings, 0 replies; 2+ messages in thread
From: Michael Sweet @ 2013-12-02 16:33 UTC (permalink / raw)
To: Tim Waugh; +Cc: printing-architecture@lists.linux-foundation.org
Tim,
On Nov 29, 2013, at 7:08 AM, Tim Waugh <twaugh@redhat.com> wrote:
> When using the usb backend, if a usb-1 printer connected to a usb-2 hub
> runs out of paper during the job the print output will be corrupted.
> https://bugzilla.redhat.com/show_bug.cgi?id=1026914
>
> This is due to using a 60 second timeout for the libusb_bulk_transfer()
> call. Timeout handling and retries are not reliable in every case, as
> described here:
> https://bugzilla.redhat.com/show_bug.cgi?id=1035863
>
> Quoting from that report:
> ==>
> So TL;DR: this a known and unfixable problem, and the solution is to
> simply not cancel transfers (by setting a timeout) and then decide you
> want to finish the transfer after all. Either decide you want to really
> cancel the transfer, or just wait for it to finish normally.
> <==
>
> Patch attached to change the timeout to 0 to wait indefinitely.
This mirrors what we do on OS X; will include this in CUPS 1.7.1.
Filed as:
<rdar://problem/15564888> cups.org: Fix USB timeouts on Linux
_______________________________________________________________
Michael Sweet, Senior Printing System Engineer, PWG Chair
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-12-02 16:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-29 12:08 [Printing-architecture] [patch] CUPS 1.7.0: fix corrupted output for USB printers Tim Waugh
2013-12-02 16:33 ` Michael Sweet
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.