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

Long delay before printing last page on HP LaserJet 1150/1300/1320 (usb backend) #4549

Closed
michaelrsweet opened this issue Dec 25, 2014 · 11 comments
Milestone

Comments

@michaelrsweet
Copy link
Collaborator

Version: 2.1-current
CUPS.org User: tagunil

I have many old HP LJ printers (1150/1300/1320) and there is very long delay before last page prints (5-10 minutes) with libusb-based usb backend. Usually this last page is also corrupted. It looks like STR #3405. I can't use hp backend from HPLIP, because it is small embedded system and I want use everything as generic as possible. Decreasing buffer size as in r9448 does not work for me. Usblp-based backend works perfectly.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: tagunil

Inserting sleep(1) before calling close_device() in usb_libusb.c fixes this for me.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: till.kamppeter

Looks like this should be implemented as a new USB quirk type, perhaps named "delayed-close" which lets the backend do a sleep(1) before doing close_device().

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: h.blischke

Instead of sleep (1) ti will be better to call fflush prior tp close_device

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: tagunil

I'm not sure that fflush will work because I've captured USB traffic with and without sleep() and the only substantial difference I've found was time delay before switching altsetting back. I think it is a hardware bug, and a new quirk type will be good.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: smitty

It has been a very long time, but I recall some printers from this period where the coordination between the PDL language interpreter and the USB subsystem had some issues, and that could cause buffer flushing problems in the printer. Making sure that the jobs were well-formed as far as the PCL5 or PJL language reference manuals were concerned may help; for instance, including leading / trailing UELs to "thump" the language interpreter, which may cause buffer flushes between the subsystems.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Please provide the USB vendor/model IDs so we can populate the quirks file appropriately.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: tagunil

HP LaserJet 1150:
03f0:0f17
HP LaserJet 1300:
03f0:1017
03f0:1117
HP LaserJet 1320:
03f0:1d17

Maybe there are more affected models, but I've seen only these.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Fixed in Subversion repository.

@michaelrsweet
Copy link
Collaborator Author

"str4549.patch":

Index: backend/org.cups.usb-quirks

--- backend/org.cups.usb-quirks (revision 12875)
+++ backend/org.cups.usb-quirks (working copy)
@@ -5,6 +5,7 @@

product ID (omit for all vendor products), and a list of known issues:

blacklist The printer is not functional with the USB backend.

+# delay-close Delay close/reset of selected interface

no-reattach Do no re-attach usblp kernel module after printing.

soft-reset Do a soft reset after printing for cleanup.

unidir Only supported unidirectional I/O

@@ -227,3 +228,13 @@

All Intermec devices (STR #4553)

0x067e no-reattach
+
+# HP LaserJet 1150 (STR #4549)
+0x03f0 0x0f17 delay-close
+
+# HP LaserJet 1300 (STR #4549)
+0x03f0 0x1017 delay-close
+0x03f0 0x1117 delay-close
+
+# HP LaserJet 1320 (STR #4549)
+0x03f0 0x1d17 delay-close

Index: backend/usb-libusb.c

--- backend/usb-libusb.c (revision 12875)
+++ backend/usb-libusb.c (working copy)
@@ -3,7 +3,7 @@
*

  • LIBUSB interface code for CUPS.
    *
    • * Copyright 2007-2014 by Apple Inc.
    • * Copyright 2007-2015 by Apple Inc.
      *
  • These coded instructions, statements, and computer programs are the
  • property of Apple Inc. and are protected by Federal copyright
    @@ -103,6 +103,7 @@
    #define USB_QUIRK_USB_INIT 0x0010 /* Needs vendor USB init string /
    #define USB_QUIRK_VENDOR_CLASS 0x0020 /
    Descriptor uses vendor-specific
    Class or SubClass /
    +#define USB_QUIRK_DELAY_CLOSE 0x0040 /
    Delay close /
    #define USB_QUIRK_WHITELIST 0x0000 /
    no quirks */

@@ -641,6 +642,9 @@

  • Close the connection and input file and general clean up...
    */
  • if (g.printer.quirks & USB_QUIRK_DELAY_CLOSE)
  • sleep(1);

close_device(g.printer);

/*
@@ -1211,6 +1215,9 @@
if (strstr(line, " blacklist"))
quirk->quirks |= USB_QUIRK_BLACKLIST;

  •  if (strstr(line, " delay-close"))
    
  •    quirk->quirks |= USB_QUIRK_DELAY_CLOSE;
    
    • if (strstr(line, " no-reattach"))
      quirk->quirks |= USB_QUIRK_NO_REATTACH;

@hawajrambo
Copy link

hawajrambo commented Sep 19, 2017

Dear Mike,

The same delay-close problem exists on HP Laserjet 1160.
Adding the following to org.cups.usb-quirks has solved the issue:

# HP LaserJet 1160 (Issue #4549)
0x03f0 0x1e17 delay-close

Could you please include this in the future versions?

Gabor

@michaelrsweet
Copy link
Collaborator Author

@hawajrambo Please file a new issue for the LaserJet 1160.

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

2 participants