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

Delayed Print Action #5251

Closed
Arvish12 opened this issue Feb 19, 2018 · 10 comments
Closed

Delayed Print Action #5251

Arvish12 opened this issue Feb 19, 2018 · 10 comments
Assignees
Milestone

Comments

@Arvish12
Copy link

Hello out there. Help required.

I am using a Star Micronics thermal printer TSP654 (STR_T-001) via USB on Ubuntu 16.04.
I have built the driver as instructed from the vendor. When printing a small text file, printing happens immediately with no error. As soon as the text file is larger OR I choose to print multiple copies, the printing process seems to slow down dramatically.

The CUPS erro_log shows countless entries as follows :
D [19/Feb/2018:23:06:27 +0200] [Job 38] Read 9 bytes of back-channel data...
D [19/Feb/2018:23:06:27 +0200] [Job 38] Read 9 bytes of back-channel data...
D [19/Feb/2018:23:06:27 +0200] [Job 38] Read 9 bytes of back-channel data...
D [19/Feb/2018:23:06:27 +0200] [Job 38] Read 9 bytes of back-channel data...
D [19/Feb/2018:23:06:27 +0200] [Job 38] Read 9 bytes of back-channel data...
D [19/Feb/2018:23:06:27 +0200] [Job 38] Read 9 bytes of back-channel data...
D [19/Feb/2018:23:06:27 +0200] [Job 38] Read 9 bytes of back-channel data...
D [19/Feb/2018:23:06:27 +0200] [Job 38] Read 9 bytes of back-channel data...
D [19/Feb/2018:23:06:27 +0200] [Job 38] Read 9 bytes of back-channel data...
D [19/Feb/2018:23:06:27 +0200] [Job 38] Read 9 bytes of back-channel data...

And after some time, sometimes 2-3 minutes, sometimes more, the document eventually prints. What on earth could be causing CUPS to only read 9 bytes of data at a time ???

@michaelrsweet
Copy link
Collaborator

We don't provide drivers for this particular printer, but it is possible you can add a USB quirk rule for it. Run "lsusb -v" to get the vendor and model codes, and then make a file in /usr/share/cups/usb with the following:

0xVENDOR 0xMODEL unidir

@michaelrsweet michaelrsweet self-assigned this Feb 20, 2018
@michaelrsweet michaelrsweet added this to the CUPS 2.3.x milestone Feb 20, 2018
@michaelrsweet
Copy link
Collaborator

Doing a little research, the following should do the trick:

0x0519 unidir

I've pushed this change to master, pending confirmation that the change fixes things for you:

[master a468069] Use unidirectional mode for Star Micronics printers (Issue #5251)

@Arvish12
Copy link
Author

Thanks so much for your replies.

I have done as instructed, inserted '0x0519 unidir' into a file in /usr/share//cups/usb/, and the behavior of the printer has changed. If I now print 3 copies of an extremely small text file, it works perfectly. However, as soon as I increase the size of the text file and print multiple copies, a different issue seems to occur. The printer jams, and the job seems to disappear. Please see error log below :

I [20/Feb/2018:21:21:06 +0200] Saving subscriptions.conf...
D [20/Feb/2018:21:21:06 +0200] cupsdSetBusyState: newbusy="Not busy", busy="Dirty files"
I [20/Feb/2018:21:21:06 +0200] Expiring subscriptions...
D [20/Feb/2018:21:21:06 +0200] Report: clients=10
D [20/Feb/2018:21:21:06 +0200] Report: jobs=5
D [20/Feb/2018:21:21:06 +0200] Report: jobs-active=0
D [20/Feb/2018:21:21:06 +0200] Report: printers=1
D [20/Feb/2018:21:21:06 +0200] Report: stringpool-string-count=18775
D [20/Feb/2018:21:21:06 +0200] Report: stringpool-alloc-bytes=11720
D [20/Feb/2018:21:21:06 +0200] Report: stringpool-total-bytes=419024

Further advice would be greatly appreciated.

@michaelrsweet
Copy link
Collaborator

Sigh, that sounds like the printer doesn't actually implement the USB printer class properly - as soon as it falls behind it sounds like it starts dropping data.

Not sure what can be done to resolve this, but I'd try to get the manufacturer involved...

@Arvish12
Copy link
Author

Ok, thanks for the help. I will have to keep at it.

Moving forward though, do you have any recommendations for thermal printers that work well with the CUPS system ?

@michaelrsweet
Copy link
Collaborator

The Zebra printers I've worked most recently with have all been solid. In the (somewhat distant) past I used Dymo printers for printing hundreds of smaller labels on a daily basis, however none of the models I used back then are still sold today... Both are supported by the bundled CUPS label printer driver.

@Arvish12
Copy link
Author

Ok great, will look into those. Whats strange for me is that I have used this exact same Star printer on Ubuntu 14 running CUPS 1.5.2 and it is working flawlessly up till this day. I was wrong to assume the same with the most updated software. Anyways, thanks once again...

@michaelrsweet
Copy link
Collaborator

The backend has probably changed from using the kernel "lp" module to the libusb-based backend and lower-level kernel USB driver. Plus you are using a newer Linux kernel - probably what worked before due to a timing or compatibility hack no longer works... :/

@jsmeix
Copy link

jsmeix commented Feb 21, 2018

@Arvish12
probably not a solution but perhaps the following might help you
to do some further attempts how you could make that particular USB device
(I won't call it a real USB printer ;-) accept the data more reliably:

Have a look at
https://en.opensuse.org/SDB:Using_Your_Own_Backends_to_Print_with_CUPS
how you might experiment with a selfmade backend
to send the data to that particular USB device.
When you do things like cat - >/dev/usb/lp0
to send the data to that USB device the traditional way
via the 'usblp' kernel module might be used, have a look at
https://en.opensuse.org/SDB:Installing_a_Printer
regarding kernel modules for direct USB printer access
(the 'lp' kernel module is used for parallel port access).

What kind of USB port is used at your computer?
Is it perhaps a USB 3 port (i.e. USB 3 hardware in the computer)?

At least for USB scanners there are known issues with the
data transfer if a USB 3 port is used at the computer,
cf. the "USB" section in
https://en.opensuse.org/SDB:Configuring_Scanners

Nowadays "xhci_hcd" kernel driver/module issues (a.k.a. "USB 3")
are the most often cause of issues like "Error during device I/O", cf.
http:https://lists.alioth.debian.org/pipermail/sane-devel/2016-November/034901.html
and follow the links therein.

Regarding how to get kernel related USB messages,
see the section "Do not overdo things" in
https://en.opensuse.org/SDB:How_to_Report_a_Printing_Issue
therein about "get usb-related kernel messages".

In particular see
http:https://lists.alioth.debian.org/pipermail/sane-devel/2015-December/034207.html
(excerpt):

Regarding "USB 2.0 (black) and USB 3.0 (blue)":

Neither the color nor what the port is labeled on the computer
is reliable regarding what kernel driver is used for the port.

Only the "lsusb -t" output shows what kernel driver is used.

For example all USB ports on my testing machine have same dark color.
Also the "super speed" (USB 3) labeled ports are basically black.
Their exact color is "very dark" but not "100% black"
and neither blue (USB 3.0) nor teal blue (USB 3.1), cf.
https://en.wikipedia.org/wiki/USB#Colors

On my testing machine xhci_hcd is used for all USB ports
where I can connect devices (i.e. all external USB ports).

If USB 3 (i.e. the xhci_hcd kernel driver) is the root cause,
the best way out is to use real USB 2 hardware (i.e. a USB port
at the computer where not xhci_hcd is used) or when there is
no such port then buy additional real USB 2 hardware and use that
to get problems with USB 3 out of sight, cf.
https://bugzilla.opensuse.org/show_bug.cgi?id=856794#c49

michaelrsweet added a commit that referenced this issue Mar 7, 2018
- Fixed a compile issue when PAM is not available (Issue #5253)
- Documentation fixes (Issue #5252)
- Star Micronics printers need the "unidir" USB quirk rule (Issue #5251)
- The scheduler now supports using temporary print queues for older IPP/1.1 print queues like those shared by CUPS 1.3 and earlier (Issue #5241)
- The `cupsRasterWritePixels` function did not correctly swap bytes for some formats (Issue #5225)
- Added a USB quirk rule for Canon MP280 series printers (Issue #5221)
- The `ppdInstallableConflict` tested too many constraints (Issue #5213)
- More fixes for printing to old CUPS servers (Issue #5211)
- The `cupsCopyDest` function now correctly copies the `is_default` value (Issue #5208)
- The scheduler did not work with older versions of uClibc (Issue #5188)
- The scheduler now substitutes default values for invalid job attributes when running in "relaxed conformance" mode (Issue #5186)
- Fixed PAM module detection and added support for the common PAM definitions (Issue #5185)
- Fixed a journald support bug in the scheduler (Issue #5181)
- The cups-driverd program incorrectly stopped scanning PPDs as soon as a loop was seen (Issue #5170)
- Fixed group validation on OpenBSD (Issue #5166)
- Fixed the `ippserver` sample code when threading is disabled or unavailable (Issue #5154)
- The `cupsEnumDests` function did not include options from the lpoptions files (Issue #5144)
- The `SSLOptions` directive now supports `MinTLS` and `MaxTLS` options to control the minimum and maximum TLS versions that will be allowed, respectively (Issue #5119)
- The scheduler did not write out dirty configuration and state files if there were open client connections (Issue #5118)
- The `lpadmin` command now provides a better error message when an unsupported System V interface script is used (Issue #5111)
- The `lp` and `lpr` commands now provide better error messages when the default printer cannot be found (Issue #5096)
- No longer support backslash, question mark, or quotes in printer names (Issue #4966)
- The CUPS library now supports the latest HTTP Digest authentication specification including support for SHA-256 (Issue #4862)
- The `lpstat` command now reports when new jobs are being held (Issue #4761)
- The `lpoptions` command incorrectly saved default options (Issue #4717)
- The `ppdLocalizeIPPReason` function incorrectly returned a localized version of "none" (rdar:https://36566269)
- TLS connections now properly timeout (rdar:https://34938533)
- The IPP backend did not properly detect failed PDF prints (rdar:https://34055474)
@michaelrsweet
Copy link
Collaborator

OK, I'm going to close this bug as "fixed" as much as we can fix it on our end. Please let me know if there are other changes we can make to improve the performance of these printers...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants