Delay after every print job on USB

Bug #1001028 reported by Mitch Claborn on 2012-05-17
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
cups (Ubuntu)
High
Unassigned
Precise
High
Till Kamppeter

Bug Description

Ubuntu 12.04 64 bit (also 32 bit is affected)
Zebra LP 2844-Z USB printer - connected with a generic "raw queue" driver.

usblp0 appears to disconnect after every print job and then automatically reconnect after 8 seconds. The next job to the printer won't print until it is reconnected. This is a problem for us in a high volume printing scenario.

Here are messages from syslog:
May 17 16:47:17 mlcx500 kernel: [25464.991868] usblp0: removed
May 17 16:47:25 mlcx500 kernel: [25473.131745] usblp0: USB Bidirectional printer dev 5 if 0 alt 0 proto 2 vid 0x0A5F pid 0x0027
May 17 16:47:25 mlcx500 udev-configure-printer: add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/usb/lp0
May 17 16:47:25 mlcx500 udev-configure-printer: device devpath is /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2
May 17 16:47:25 mlcx500 udev-configure-printer: Device already handled

Note the 8 second pause between the first and second messages.

Not sure where the disconnect is coming from.

It doesn't appear to be hardware related as I have the problem with various combinations of printer and computer.

[IMPACT]

On some printers it can happen that with Precise's new libusb-based USB CUPS backend there is a small delay of around 8 seconds after each job. In environments where printers are continuously printing small jobs (~1 page each) this is a serious impact on printing performance.

The USB backend in the proposed package has a configurable option to turn off the bi-directional operation of the backend (sending print data and also reading answers of the printer). With uni-directional printing (only sending print data) the delay disappears.

Uni-directional printing can be set manually. We will give instructions in the Release Notes of 12.04.1.

[TESTCASE]

Unfortunately, for reproducing this bug one needs the actual printer.

Connect a printer with the problem to the USB port of the computer.

With current Precise you get the mentioned 8-second delay after each job when you print several jobs one after the other. If you install the proposed package you can suppress bi-directional printing via

lpadmin -p <queue name> -o usb-unidir-default=true

Now the jobs get printed directly one after the other.

[Regression Potential]

The patch looks perhaps more dramatic than it is. This is because several code sections are put into "if" blocks, indenting all the (unchanged) code lines. This especially happens because now we suppress using the back channel for selected printers (and also printers which claim to be uni-directional only).

The code was developed in several steps and uploaded step-by-step to my PPA. There the reporters of the bugs covered by this SRU and some additional bugs (bug 902535, bug 995111) tested it intensively. They did not hit any regressions compared to stock Precise or the first CUPS SRU.

The code is also applied to the CUPS package in Quantal and this also did not cause any regression bug report yet.

I have tested the code on four HP printers (HP LaserJet 3390, HP Color LaserJet CM3530 MFP, HP PhotoSmart C8100, HP PhotoSmart C5200, all on direct USB) and one Epson printer (Epson Stylus Photo 880, both direct USB and parallel with Prolific USB -> Parallel adaptor) and all work fine, no regressions.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: cups 1.5.2-9ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-24.37-generic 3.2.14
Uname: Linux 3.2.0-24-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.0.1-0ubuntu7
Architecture: amd64
Date: Thu May 17 17:47:22 2012
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120425)
Lpstat:
 device for Officejet-6300-series: dnssd://Officejet%206300%20series%20%5B75F808%5D._pdl-datastream._tcp.local/
 device for z6: usb://Zebra%20Technologies/ZTC%20LP2844-Z-200dpi?serial=46J083000010
MachineType: Dell Inc. Precision M6500
Papersize: letter
PccardctlIdent:
 Socket 0:
   no product info available
PccardctlStatus:
 Socket 0:
   no card
PpdFiles: Officejet-6300-series: HP Officejet 6300 Series, hpcups 3.12.2
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.2.0-24-generic root=UUID=c519e5fe-c1ce-42e5-a875-c395070a15ab ro quiet splash vt.handoff=7
SourcePackage: cups
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 06/07/2010
dmi.bios.vendor: Dell Inc.
dmi.bios.version: A04
dmi.board.vendor: Dell Inc.
dmi.chassis.type: 8
dmi.chassis.vendor: Dell Inc.
dmi.modalias: dmi:bvnDellInc.:bvrA04:bd06/07/2010:svnDellInc.:pnPrecisionM6500:pvr:rvnDellInc.:rn:rvr:cvnDellInc.:ct8:cvr:
dmi.product.name: Precision M6500
dmi.sys.vendor: Dell Inc.
mtime.conffile..etc.cups.cupsd.conf: 2012-05-17T17:39:15.321368

Mitch Claborn (mitch-news) wrote :
Mitch Claborn (mitch-news) wrote :
Download full text (3.6 KiB)

here is detailed udev trace output

May 17 17:53:23 mlcx500 udevd[22093]: seq 2676 queued, 'remove' 'usb'
May 17 17:53:23 mlcx500 udevd[22093]: passed 228 bytes to netlink monitor 0x7f297001c2d0
May 17 17:53:23 mlcx500 udevd[22810]: seq 2676 running
May 17 17:53:23 mlcx500 udevd[22810]: device 0x7f2970037130 filled with db file data
May 17 17:53:23 mlcx500 udevd[22810]: device node '/dev/usb/lp0' not found
May 17 17:53:23 mlcx500 udevd[22810]: removing device node '/dev/usb/lp0'
May 17 17:53:23 mlcx500 udevd[22810]: passed -1 bytes to netlink monitor 0x7f2970030fc0
May 17 17:53:23 mlcx500 udevd[22810]: seq 2676 processed with 0
May 17 17:53:23 mlcx500 udevd[22093]: seq 2676 done with 0
May 17 17:53:23 mlcx500 kernel: [29429.072893] usblp0: removed
May 17 17:53:31 mlcx500 udevd[22093]: seq 2677 queued, 'add' 'usb'
May 17 17:53:31 mlcx500 udevd[22093]: passed 225 bytes to netlink monitor 0x7f297001c2d0
May 17 17:53:31 mlcx500 udevd[22810]: seq 2677 running
May 17 17:53:31 mlcx500 udevd[22810]: device 0x7f2970030c10 has devpath '/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/usb/lp0'
May 17 17:53:31 mlcx500 udevd[22810]: no db file to read /run/udev/data/c180:0: No such file or directory
May 17 17:53:31 mlcx500 udevd[22810]: device 0x7f29700342a0 has devpath '/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0'
May 17 17:53:31 mlcx500 udevd[22810]: device 0x7f2970035b70 has devpath '/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2'
May 17 17:53:31 mlcx500 udevd[22810]: device 0x7f29700310e0 has devpath '/devices/pci0000:00/0000:00:1d.0/usb2/2-1'
May 17 17:53:31 mlcx500 udevd[22810]: device 0x7f2970031640 has devpath '/devices/pci0000:00/0000:00:1d.0/usb2'
May 17 17:53:31 mlcx500 udevd[22810]: device 0x7f2970031f80 has devpath '/devices/pci0000:00/0000:00:1d.0'
May 17 17:53:31 mlcx500 udevd[22810]: device 0x7f29700324c0 has devpath '/devices/pci0000:00'
May 17 17:53:31 mlcx500 udevd[22810]: GROUP 7 /lib/udev/rules.d/50-udev-default.rules:62
May 17 17:53:31 mlcx500 udevd[22810]: RUN 'udev-configure-printer add %p' /lib/udev/rules.d/70-printers.rules:4
May 17 17:53:31 mlcx500 udevd[22810]: no node name set, will use kernel supplied name 'usb/lp0'
May 17 17:53:31 mlcx500 udevd[22810]: creating device node '/dev/usb/lp0', devnum=180:0, mode=0660, uid=0, gid=7
May 17 17:53:31 mlcx500 udevd[22810]: preserve file '/dev/usb/lp0', because it has correct dev_t
May 17 17:53:31 mlcx500 udevd[22810]: set permissions /dev/usb/lp0, 020660, uid=0, gid=7
May 17 17:53:31 mlcx500 udevd[22810]: creating symlink '/dev/char/180:0' to '../usb/lp0'
May 17 17:53:31 mlcx500 udevd[22810]: created db file '/run/udev/data/c180:0' for '/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/usb/lp0'
May 17 17:53:31 mlcx500 udevd[25478]: starting 'udev-configure-printer add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/usb/lp0'
May 17 17:53:31 mlcx500 kernel: [29437.148560] usblp0: USB Bidirectional printer dev 5 if 0 alt 0 proto 2 vid 0x0A5F pid 0x0027
May 17 17:53:31 mlcx500 udev-configure-printer: add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/usb/lp0
May 17 17:53:31 mlcx500 udevd[22810]: 'udev-configure-printer add /devices/pci0...

Read more...

Mitch Claborn (mitch-news) wrote :

attached is a detailed cups log

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in cups (Ubuntu):
status: New → Confirmed
Launchpad Janitor (janitor) wrote :
Download full text (4.8 KiB)

This bug was fixed in the package cups - 1.5.3-1

---------------
cups (1.5.3-1) unstable; urgency=low

  [ Till Kamppeter ]
  * New upstream release
     - Numerous fixes on IPP (LP: #945028, LP: #973270, LP: #990734,
       LP: #992468, LP: #992982, LP: #1000172, LP: #1000758)
     - USB backend based on the maintained libusb 1.0.x with support for
       bi-directional communication
     - Fixes on SNMP-based supply level reporting
     - PostScript prtinter auto-configuration reliable now
     - Several fixes on PostScript, SSL, authenticated printing, and
       networking issues
  * debian/patches/ipp-fixes-1.5.3.patch,
    debian/patches/fix-empty-translations.patch,
    debian/patches/ppd-cache-fix-crash.patch,
    debian/patches/commandtops-make-robust-against-broken-postscript.patch,
    debian/patches/cups-polld-reconnect.patch,
    debian/patches/usb-backend-libusb-1.0.patch,
    debian/patches/usb-backend-backchannel-support.patch: Removed patches which
    got included upstream.
  * debian/patches/fix-supply-level-computation-for-percent-supply-unit.patch,
    debian/patches/fix-supply-levels-for-enumerated-prtmarkersupplieslevel.patch,
    debian/patches/fix-status-reports-when-supply-levels-grow.patch,
    debian/patches/add-status-reports-for-full-waste-trays-and-cleaner-unit-eol.patch,
    debian/patches/match-marker-colorants-which-use-non-standard-string.patch,
    debian/patches/truncate-marker-supply-names-at-comma.patch: Removed supply
    level report fixes. This got solved differently upstream.
  * debian/patches/do-not-suppress-inputslot-setting-with-empty-ap-d-inputslot.patch:
    Removed, problem solved differently upstream.
  * debian/patches/cups-avahi.patch: Manually regenerated to adapt to upstream
    changes.
  * debian/patches/ppd-poll-with-client-conf.patch,
    debian/patches/colord-support.patch,
    debian/patches/airprint-support.patch,
    debian/patches/no-conffile-timestamp.patch,
    debian/patches/drop_unnecessary_dependencies.patch,
    debian/patches/read-embedded-options-from-incoming-postscript-and-add-to-ipp-attrs.patch,
    debian/patches/show-compile-command-lines.patch: Refreshed using quilt.
  * debian/patches/usb-backend-busy-loop-fix.patch: Correct loops to repeat
    claiming interfaces on USB devices when they are busy. Before, hitting busy
    state made the device opening function error out without comment
    (LP: #987485).
  * debian/patches/usb-backend-detach-usblp-earlier-crash-guards.patch: Protect
    against crashes by checking error codes of libusb functions (LP: #997040)
    and detach usblp kernel module in an earlier stage when opening a device
    (LP: #987485, LP: #997040).
  * debian/patches/usb-backend-initialize-usblp-attached-state.patch: Initialize
    usblp_attached field in printer data structure to assure that detaching
    and re-attaching the usblp kernel module is always done correctly
    (LP: #902535, LP: #959676, LP: #960666, LP: #987485,
    LP: #995111, LP: #997040, LP: #1000253, LP: #1001028).
  * debian/patches/install-sh-remove-bashism.patch: Removed bashism.
  * debian/local/blacklist-cups-usblp.conf, debian/cups.postinst,
    debian/cups.install: Bla...

Read more...

Changed in cups (Ubuntu):
status: Confirmed → Fix Released
Till Kamppeter (till-kamppeter) wrote :

New CUPS package with the following (and some addtional) fixes uploaded to precise-proposed (proposed updates for 12.04 (Precise)):

 - Crash and busy loop fixes on the USB backend
 - "usblp" kernel module blacklisted again as it also causes problems with the new USB backend
 - Lots of fixes on the IPP backend and also on the IPP server part in the CUPS daemon
 - Other networking issues

These fixes should address most of the bugs reported shortly after the release of Precise, especially the problems with USB printing and network printing. As soon as the package is approved and made available for testing and additional comment with installation instructions will get posted here. Please test the new package then and report here whether this solves your problems. We will decide on the results whether the package will be made an official update for Precise.

Please remove/cancel all jobs and turn off and turn on your printer before testing.

debdiff attached.

Changed in cups (Ubuntu Precise):
status: New → Fix Committed
importance: Undecided → High
Changed in cups (Ubuntu):
importance: Undecided → High
Changed in cups (Ubuntu Precise):
milestone: none → precise-updates

Hello Mitch, or anyone else affected,

Accepted cups into precise-proposed. The package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-needed

I will test on Tuesday and update with results.

Mitch Claborn (mitch-news) wrote :

This did not resolve my problem. I'm not seeing the device connect/disconnect, but it still takes about 8 seconds between print jobs. Attaching cups error log and syslog shortly.

apt-cache policy cups
cups:
  Installed: 1.5.3-0ubuntu1
  Candidate: 1.5.3-0ubuntu1
  Version table:
 *** 1.5.3-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ precise-proposed/main i386 Packages
        100 /var/lib/dpkg/status
     1.5.2-9ubuntu1 0
        500 http://us.archive.ubuntu.com/ubuntu/ precise/main i386 Packages

Mitch Claborn (mitch-news) wrote :
Mitch Claborn (mitch-news) wrote :

Unfortunately, the USB backend fixes applied in the most recent CUPS packages for Quantal and in the proposed SRU for Precise do not fix this problem. Reopening for Quantal and taking out of the SRU process for Precise.

summary: - usblp0 removed after every print job
+ Delay after every print job on USB
Changed in cups (Ubuntu):
status: Fix Released → Confirmed
Changed in cups (Ubuntu Precise):
status: Fix Committed → Confirmed
tags: removed: verification-needed
Launchpad Janitor (janitor) wrote :
Download full text (3.8 KiB)

This bug was fixed in the package cups - 1.5.3-0ubuntu1

---------------
cups (1.5.3-0ubuntu1) precise-proposed; urgency=low

  [ Till Kamppeter ]
  * New upstream release
     - Numerous fixes on IPP (LP: #945028, LP: #973270, LP: #990734,
       LP: #992468, LP: #992982, LP: #1000172, LP: #1000758)
     - USB backend based on the maintained libusb 1.0.x with support for
       bi-directional communication
     - Fixes on SNMP-based supply level reporting
     - PostScript prtinter auto-configuration reliable now
     - Several fixes on PostScript, SSL, authenticated printing, and
       networking issues
  * debian/patches/ipp-fixes-1.5.3.patch,
    debian/patches/fix-empty-translations.patch,
    debian/patches/ppd-cache-fix-crash.patch,
    debian/patches/commandtops-make-robust-against-broken-postscript.patch,
    debian/patches/cups-polld-reconnect.patch,
    debian/patches/usb-backend-libusb-1.0.patch,
    debian/patches/usb-backend-backchannel-support.patch: Removed patches which
    got included upstream.
  * debian/patches/fix-supply-level-computation-for-percent-supply-unit.patch,
    debian/patches/fix-supply-levels-for-enumerated-prtmarkersupplieslevel.patch,
    debian/patches/fix-status-reports-when-supply-levels-grow.patch,
    debian/patches/add-status-reports-for-full-waste-trays-and-cleaner-unit-eol.patch,
    debian/patches/match-marker-colorants-which-use-non-standard-string.patch,
    debian/patches/truncate-marker-supply-names-at-comma.patch: Removed supply
    level report fixes. This got solved differently upstream.
  * debian/patches/do-not-suppress-inputslot-setting-with-empty-ap-d-inputslot.patch:
    Removed, problem solved differently upstream.
  * debian/patches/cups-avahi.patch: Manually regenerated to adapt to upstream
    changes.
  * debian/patches/ppd-poll-with-client-conf.patch,
    debian/patches/colord-support.patch,
    debian/patches/airprint-support.patch,
    debian/patches/no-conffile-timestamp.patch,
    debian/patches/drop_unnecessary_dependencies.patch,
    debian/patches/read-embedded-options-from-incoming-postscript-and-add-to-ipp-attrs.patch,
    debian/patches/show-compile-command-lines.patch: Refreshed using quilt.
  * debian/patches/usb-backend-busy-loop-fix.patch: Correct loops to repeat
    claiming interfaces on USB devices when they are busy. Before, hitting busy
    state made the device opening function error out without comment
    (LP: #987485).
  * debian/patches/usb-backend-detach-usblp-earlier-crash-guards.patch: Protect
    against crashes by checking error codes of libusb functions (LP: #997040)
    and detach usblp kernel module in an earlier stage when opening a device
    (LP: #987485, LP: #997040).
  * debian/patches/usb-backend-initialize-usblp-attached-state.patch: Initialize
    usblp_attached field in printer data structure to assure that detaching
    and re-attaching the usblp kernel module is always done correctly
    (LP: #902535, LP: #959676, LP: #960666, LP: #987485,
    LP: #995111, LP: #997040, LP: #1000253, LP: #1001028).
  * debian/patches/install-sh-remove-bashism.patch: Removed bashism.
  * debian/local/blacklist-cups-usblp.conf, debian/cups.postinst,
    de...

Read more...

Changed in cups (Ubuntu Precise):
status: Confirmed → Fix Released

Reopening wrongly closed Precise task.

Changed in cups (Ubuntu Precise):
status: Fix Released → Confirmed

I have uploaded a modified CUPS package to my PPA now. Please add my PPA to your system as described on

https://launchpad.net/~till-kamppeter/+archive/ppa

in the section "Adding this PPA to your system" and then install the new CUPS package, preferably by simply doing a full system update. The CUPS version must be 1.5.3-0ubuntu2~ppa2.

Now turn off and turn on your printer and re-plug the USB (with the printer turned on). Try to print. does it work now?

Independent whether printing works for you now or not, reactivate the usblp kernel module by running the following two commands in a terminal window:

sudo mv /etc/modprobe.d/blacklist-cups-usblp.conf ~
sudo modprobe usblp

Turn off and turn on your printer again and re-plug the USB (with the printer turned on). Try to print again. does it also work now?

If it works, you are done. If it worked in the first test and stopped in the second, return to the configuration of the first test by running the following commands in a terminal window:

sudo mv ~/blacklist-cups-usblp.conf /etc/modprobe.d/
sudo rmmod usblp

Mitch Claborn (mitch-news) wrote :

apt-cache policy cups
cups:
  Installed: 1.5.3-0ubuntu2~ppa1
  Candidate: 1.5.3-0ubuntu2~ppa1

This is not the version you mentioned, but I don't have a ppa2 version to install.

First test after updating: printer works, but there is till the 8 second delay between jobs.

Second test: same result

Attached is relevant portion of syslog.

The new packages are still in the queue on the build server. It will take several hours until it is their turn to get built. For amd64 the build is scheduled to happen in ~1 hour, for i386 in ~14 hours from now.

The relevant parts of the version you have tested are identical with the CUPS SRU for Precise, so the result is as expected.

Please repeat the test when the ~ppa2 version has arrived.

The packages have arrived, please update and re-test.

Mitch Claborn (mitch-news) wrote :

apt-cache policy cups
cups:
  Installed: 1.5.3-0ubuntu2~ppa2
  Candidate: 1.5.3-0ubuntu2~ppa2

Test 1 - did not print at all.
Several of these messages in syslog:
usb 3-1: usbfs: process 2631 (usb) did not claim interface 0 before use

Test 2
mv /etc/modprobe.d/blacklist-cups-usblp.conf ~
mv: cannot stat `/etc/modprobe.d/blacklist-cups-usblp.conf': No such file or directory
sudo modprobe usblp
(ok)
still won't print

The "Add Printer" dialog does not list the printer.

Syslog attached.

My CUPS upload to my PPA (1.5.3-0ubuntu2~ppa2) is broken. In some hours the new version 1.5.3-0ubuntu2~ppa3 will be available. Please wait for this new version, update your system then, check whether you actually have 1.5.3-0ubuntu2~ppa3 and then do the tests of comment #15 again.

Mitch Claborn (mitch-news) wrote :

apt-cache policy cups
cups:
  Installed: 1.5.3-0ubuntu2~ppa3
  Candidate: 1.5.3-0ubuntu2~ppa3

Test results same as before. Nothing prints.

Syslog attached.

Does this mean that with the official SRU of CUPS (1.5.3-0ubuntu1) you can print and with both PPA versions (~ppa2 and ~ppa3) you are not able to print?

Can you attach your error_log of the failed jobs with the newest version (~ppa3)?

Even with the usblp kernel module blacklisted you are not able to print?

Please do tests for the case with the usblp module active and with the usblp module blacklisted and attach the error_log for both.

If you do not have a file /etc/modprobe.d/blacklist-cups-usblp.conf run the following command:

sudo apt-get install --reinstall cups

Please also check for stale "usb" processes via

ps auxwww | grep usb

and kill all "usb:..." processes. After all these eliminated, test again. Reboot if in doubt.

Edward (edwardvankuik) wrote :

I also tried the 1.5.3-0ubuntu2~ppa3 above requested, but could not print at all with or without usblp.
At one time, I could print one job, but then needed to unplug the USB and replug it in again before it would print another job. I rebooted a few times between attempts. I've reverted to 1.5.3-0ubuntu1 which has the long delays.

Mitch Claborn (mitch-news) wrote :

I started with a clean system.

With 1.5.3-0ubuntu1
  prints fine with 8 second delay

Installed 1.5.3-0ubuntu2~ppa3

Rebooted

/etc/modprobe.d/blacklist-cups-usblp.conf contains
# cups talks to the raw USB devices, so we need to blacklist usblp to avoid
# grabbing them
blacklist usblp

unplugged/replugged printer

Did not print.
Nothing in cups error log.

mv /etc/modprobe.d/blacklist-cups-usblp.conf ~
modprobe usblp
Cleared print queue

 ps auxwww | grep usb
 (no results)

unplugged/replugged printer

did not print.
Nothing in cups error log.

Turned on debug in cupsd.conf
error_log for that attached.

Mitch Claborn (mitch-news) wrote :

Next testing round to get the USB backend working: In some hours cups 1.5.3-0ubuntu2~ppa4 will be available on my PPA, update your system to get it, check whether you actually got it, and do the tests of comment #15 again. For each failed test attach the error_log and /var/log/syslog, thanks.

Mitch Claborn (mitch-news) wrote :

apt-cache policy cups
cups:
  Installed: 1.5.3-0ubuntu2~ppa4
  Candidate: 1.5.3-0ubuntu2~ppa4

test 1 - usblp blacklisted
did not print

test 2 - not blacklisted
did not print

syslog and error_log attached

Mitch Claborn (mitch-news) wrote :

New version uploaded which does not do an initial reset on the printer (~ppa5). please do the same tests with this version.

Mitch Claborn (mitch-news) wrote :

apt-cache policy cups
cups:
  Installed: 1.5.3-0ubuntu2~ppa5
  Candidate: 1.5.3-0ubuntu2~ppa5

Test 1 - blacklisted
  prints OK but still has 8 second delay (printed 3 jobs)

Test 2 - not blacklisted
  prints OK but still has 8 second delay (printed 3 jobs)

syslog and error_log attached

Mitch Claborn (mitch-news) wrote :

Next testing round: cups 1.5.3-0ubuntu2~ppa7 is uploaded to my PPA now and this respects uni-directional devices and gives some more messages in error_log.

Please repeat the tests with it (with and without blacklisting usblp) and attach syslog and error_log of the failing tests.

In addition, you can try to force uni-directional mode by

lpadmin -p <queue> -o usb-unidir-default=true

and restore to normal mode via

lpadmin -p <queue> -o usb-unidir-default=false

For <queue> the name of your print queue has to be inserted.

Please repeat your tests with forced uni-directional mode.

Mitch Claborn (mitch-news) wrote :

apt-cache policy cups
cups:
  Installed: 1.5.3-0ubuntu2~ppa7
  Candidate: 1.5.3-0ubuntu2~ppa7

test 1 - blacklisted, normal mode (not unidirectional)
  prints OK, 8 second delay

test 1a - blacklisted, uni-directional mode
  prints OK, little or no delay between jobs

test 2 - not blacklisted, normal mode
  prints OK, 8 second delay

test 2b - not blacklisted, uni-directional mode
  prints OK, little or no delay between jobs

(each test is 3 print jobs)

syslog and error_log attached

Mitch Claborn (mitch-news) wrote :

Thank you very much for testing. As your case is rather rare and also not predictable when setting up the printer, I will include the USB backend with the option to force uni-directional access in the next update (SRU) for CUPS in Precise and also propose this version for CUPS upstream.

Please stay tuned as I will soon post here a call for testing the update package and user feedback is required to make the update being accepted into Precise.

Edward (edwardvankuik) wrote :

Installed cups from Till's PPA and I can confirm that it works without delay in uni-directional mode.
Thank you so much.

Launchpad Janitor (janitor) wrote :
Download full text (3.4 KiB)

This bug was fixed in the package cups - 1.5.3-3

---------------
cups (1.5.3-3) experimental; urgency=low

  * debian/patches/usb-backend-further-enhancements.patch: Added latest
    development work on the libusb-based USB backend:
     - Support for uni-directional devices, both protocol-1 devices and
       devices where no read endpoint is found.
     - Soft reset specific to the "PRINTER" device class. This allows a
       reset without reconnecting.
     - When closing the device, it will also get reset to its original
       configuration, before re-attaching the usblp kernel module. Do not
       restore the configuration setting when the old configuration was zero,
       as zero means "unconfigured".
     - Added option "usb-unidir" to force the backend into uni-directional
       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, LP: #1001028). Also
       useful for debugging.
     - Added the quirk management of the usblp kernel module. So the problems
       of all printers which were worked around in the kernel module are
       also worked around in the libusb-based CUPS backend now (LP: #1000253).
     - Added new quirk type to quirk manager: Printers for which the usblp
       kernel module should not get reattached after printing a job
       (LP: #1000253, perhaps also LP: #995111).
     - Added additional quirks for the Prolific Technology USB -> Parallel
       adapter, as the adapter needs uni-directional mode to be forced and
       also does not like re-attaching the usblp kernel module after the
       job (last third of last page gets cut off, re-attaching probably
       sends a reset to the printer while there is still data to be printed
       in the printer's internal buffer (LP: #987485).
     - Added the command line option "usb-no-reattach". With the option set
       the usblp kernel module does not get reattached after a job has been
       printed. Some printers cut off the end of the job or even crash by
       re-attaching the module. This is a development/debug mode to test
       whether re-attaching was the culprit of a problem. Users should
       report such issues so that their printers can get added to the quirk
       list.
     - Some extra debug messages.
     - Added a missing libusb_free_config_descriptor().
    This patch is submitted upstream as CUPS STR #4128.
  * debian/patches/add-ipp-backend-of-cups-1.4.patch, debian/cups.config,
    debian/cups.lintian-overrides, debian/cups.postinst, debian/cups.prerm,
    debian/cups.templates: Add the IPP backend of CUPS 1.4.x to the current
    CUPS package as independent backend "ipp14". Some devices (like the
    LiveBox 2) do not work with the current IPP backend (LP: #945028,
    LP: #973270, LP: #990734, LP: #992468, LP: #992982).
  * debian/patches/ipp-backend-cups-1.5.4-fixes.patch: Backported latest
    fixes on the IPP backend from upstream.
  * debian/local/blacklist-cups-usblp.conf, debian/cups.postinst,
    debian/cups.install, debian/cups.preinst, debian/cups.postinst,
    debian/cups.postrm:...

Read more...

Changed in cups (Ubuntu):
status: Confirmed → Fix Released

Uploaded proposed fix for Precise to the precise-proposed package repository. As soon as it gets approved we will post another comment here with instructions how to install and test it. Please test it that as your feedback here is required for making the package an official update.

For the SRU team: debdiff attached to bug 945028: https://bugs.launchpad.net/ubuntu/+source/cups/+bug/945028/+attachment/3219011/+files/cups_1.5.3-0ubuntu1_1.5.3-0ubuntu2.debdiff

SRU is for bug 945028, bug 973270, bug 987485, bug 997040, bug 1000253, and bug 1001028.

Changed in cups (Ubuntu Precise):
status: Confirmed → Won't Fix
status: Won't Fix → Fix Committed
milestone: precise-updates → ubuntu-12.04.1
description: updated
Changed in cups (Ubuntu Precise):
assignee: nobody → Till Kamppeter (till-kamppeter)
Stéphane Graber (stgraber) wrote :

Please use "In progress" instead of "Fix commited" as the status for bugs that have a fix in the queue but not yet accepted to -proposed, otherwise it's making our reports quite confusing...
The SRU script will automatically changed it to "Fix commited" when it lands in -proposed and then "Fix released" when it lands in -updates.

Thanks

Changed in cups (Ubuntu Precise):
status: Fix Committed → In Progress
Mitch Claborn (mitch-news) wrote :

I'm not seeing the fix in proposed yet. Is it still pending?

Yes, it is not yet approved.

Mitch Claborn (mitch-news) wrote :

lpadmin -p <queue> -o usb-unidir-default=true

will this setting change be persistent across reboots and restarts of CUPS?

Yes, it is persistent. It creates an entry in /etc/cups/printers.conf. Use always the commands given in this bug report, /etc/cups/printers.conf can only be edited if the CUPS daemon is stopped, otherwise the daemon would restore it to the old state.

Hello Mitch, or anyone else affected,

Accepted cups into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/cups/1.5.3-0ubuntu2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in cups (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
Mitch Claborn (mitch-news) wrote :

It works great. No noticeable delay between print jobs.

Also verified that the setting persists across reboots.

Mitch Claborn (mitch-news) wrote :

Please change the tag to "verification-done". I can't figure out where to do that.

Mitch, thank you very much for testing, I have set the "verification-done" tag now.

tags: added: verification-done
removed: verification-needed

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Launchpad Janitor (janitor) wrote :
Download full text (3.7 KiB)

This bug was fixed in the package cups - 1.5.3-0ubuntu2

---------------
cups (1.5.3-0ubuntu2) precise-proposed; urgency=low

  * debian/patches/usb-backend-further-enhancements.patch: Added latest
    development work on the libusb-based USB backend:
     - Support for uni-directional devices, both protocol-1 devices and
       devices where no read endpoint is found (LP: #1000253, LP: #1001028).
     - Soft reset specific to the "PRINTER" device class. This allows a
       reset without reconnecting.
     - When closing the device, it will also get reset to its original
       configuration, before re-attaching the usblp kernel module. Do not
       restore the configuration setting when the old configuration was zero,
       as zero means "unconfigured".
     - Added option "usb-unidir" to force the backend into uni-directional
       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, LP: #1001028). Also
       useful for debugging.
     - Added the quirk management of the usblp kernel module. So the problems
       of all printers which were worked around in the kernel module are
       also worked around in the libusb-based CUPS backend now (LP: #1000253).
     - Added new quirk type to quirk manager: Printers for which the usblp
       kernel module should not get reattached after printing a job
       (LP: #1000253).
     - Added additional quirks for the Prolific Technology USB -> Parallel
       adapter, as the adapter needs uni-directional mode to be forced and
       also does not like re-attaching the usblp kernel module after the
       job (last third of last page gets cut off, re-attaching probably
       sends a reset to the printer while there is still data to be printed
       in the printer's internal buffer, LP: #987485).
     - Added the command line option "usb-no-reattach". With the option set
       the usblp kernel module does not get reattached after a job has been
       printed. Some printers cut off the end of the job or even crash by
       re-attaching the module. This is a development/debug mode to test
       whether re-attaching was the culprit of a problem. Users should
       report such issues so that their printers can get added to the quirk
       list.
     - Do a printer reset after each job, this makes the Prolific USB ->
       Parallel adapter finally work (LP: #987485) and makes it unnecessary
       to blacklist the usblp kernel module for some printers (LP: #997040).
     - Some extra debug messages.
     - Added a missing libusb_free_config_descriptor().
    This patch is submitted upstream as CUPS STR #4128.
  * debian/patches/add-ipp-backend-of-cups-1.4.patch, debian/cups.config,
    debian/cups.lintian-overrides, debian/cups.postinst, debian/cups.prerm,
    debian/cups.templates: Add the IPP backend of CUPS 1.4.x to the current
    CUPS package as independent backend "ipp14". Some devices (like the
    LiveBox 2 and some Samsung printers) do not work with the current IPP
    backend (LP: #945028, LP: #973270).
  * debian/local/blacklist-cups-usblp.co...

Read more...

Changed in cups (Ubuntu Precise):
status: Fix Committed → Fix Released
Rocklobster (jhecker) wrote :

I don't think it's fixed. I am using 12.04/x64 that is completely up to date with CUPS 1.5.3-0ubuntu3 and I am still getting these messages after every time I print on my Samsung ML1710. CUPS used to work just fine until recently. I don't know which update started to make it fail for me as I print intermittently. Bugs like this shouldn't creep into an LTS version.

Aug 19 09:00:32 myth kernel: [473533.637697] usblp0: USB Bidirectional printer dev 24 if 0 alt 0 proto 2 vid 0x04E8 pid 0x323A
Aug 19 09:01:00 myth kernel: [473561.932981] usblp0: removed
Aug 19 09:01:01 myth kernel: [473562.635166] usblp0: USB Bidirectional printer dev 24 if 0 alt 0 proto 2 vid 0x04E8 pid 0x323A
Aug 19 09:01:12 myth kernel: [473574.198813] usblp0: removed

Rocklobster (jhecker) wrote :

I'll add that in my printers.conf I have:

Option usb-unidir true

This hasn't helped one iota.

Mitch Claborn (mitch-news) wrote :

@Rocklobster - you should probably open a new bug. See comment #49. I doubt the developers are watching this one any more.

Edward (edwardvankuik) wrote :

I suspect there has been some sort of regression somewhere.
When I updated to the newer version, I had this problem again.

I had the problem on two machines after the upgrade to 1.5.3-0ubuntu3.
The problem seemed to resolve itself when I downgraded to 1.5.3-0ubuntu2~ppa11.

@Rocklobster, I can send you the old .deb's if you like.

Note that to actually solve this problem you need to force uni-directional mode.

This can be done by the command

lpadmin -p <printer> -o usb-unidir-default=true

with <printer> replaced by the name of your print queue.

Everyone with this problem please post the output of the command

lsusb

here, so that we can add exception rules to the CUPS USB backend to let it automatically force uni-directional mode on such printers.

Rocklobster (jhecker) wrote :

I have to count about 20 seconds between job to ensure print success else jobs don't get printed. Sometimes they don't print after the printers warm-up cycle ends. Bidirectional worked fine for many years. Please just reinstate the old behaviour as I don't think unidirectional is working either.

Here are my printers.conf, lsusb and syslog error.

<Printer Samsung_ML-1710>
UUID urn:uuid:c8fc1189-a960-3d5d-4ca7-3b2f50160a6d
Info Samsung ML-1710
Location Loungeroom
MakeModel Samsung ML-1710 Foomatic/gdi
DeviceURI usb://Samsung/ML-1710?serial=6774-03041052150
State Idle
StateTime 1345183876
Type 8392708
Accepting Yes
Shared Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy retry-job
Option usb-unidir true
</Printer>

Bus 006 Device 005: ID 04e8:323a Samsung Electronics Co., Ltd ML-1710 Printer

Aug 21 17:44:34 myth kernel: [95596.260771] usblp0: removed
Aug 21 17:44:38 myth kernel: [95600.732433] usblp0: USB Bidirectional printer dev 5 if 0 alt 0 proto 2 vid 0x04E8 pid 0x323A

Mitch Claborn (mitch-news) wrote :

Here is the printer from my lsusb that needs the uni-directional setting:

Bus 002 Device 003: ID 0a5f:0027 Zebra

Bus 002 Device 003: ID 0a5f:0027 Zebra
Device Descriptor:
  bLength 18
  bDescriptorType 1
  bcdUSB 1.10
  bDeviceClass 7 Printer
  bDeviceSubClass 1 Printer
  bDeviceProtocol 2 Bidirectional
  bMaxPacketSize0 8
  idVendor 0x0a5f Zebra
  idProduct 0x0027
  bcdDevice 0.01
  iManufacturer 1 Zebra Technologies
  iProduct 2 ZTC LP2844-Z-200dpi
  iSerial 3 46A083700002
  bNumConfigurations 1
  Configuration Descriptor:
    bLength 9
    bDescriptorType 2
    wTotalLength 32
    bNumInterfaces 1
    bConfigurationValue 1
    iConfiguration 0
    bmAttributes 0xc0
      Self Powered
    MaxPower 0mA
    Interface Descriptor:
      bLength 9
      bDescriptorType 4
      bInterfaceNumber 0
      bAlternateSetting 0
      bNumEndpoints 2
      bInterfaceClass 7 Printer
      bInterfaceSubClass 1 Printer
      bInterfaceProtocol 2 Bidirectional
      iInterface 0
      Endpoint Descriptor:
        bLength 7
        bDescriptorType 5
        bEndpointAddress 0x82 EP 2 IN
        bmAttributes 2
          Transfer Type Bulk
          Synch Type None
          Usage Type Data
        wMaxPacketSize 0x0040 1x 64 bytes
        bInterval 0
      Endpoint Descriptor:
        bLength 7
        bDescriptorType 5
        bEndpointAddress 0x01 EP 1 OUT
        bmAttributes 2
          Transfer Type Bulk
          Synch Type None
          Usage Type Data
        wMaxPacketSize 0x0040 1x 64 bytes
        bInterval 0
Device Status: 0x0001
  Self Powered

Rocklobster (jhecker) wrote :

OK, latest update for CUPS and ML1710 and everything is back to normal again. I can queue up print jobs, switch on the printer and they will all come out. Thanks!

The current version of CUPS in Quantal sets uni-directional for all Zebra printers, so the problem of the original poster is solved out-of-the-box now.

Mitch Claborn (mitch-news) wrote :

Will that change be back-ported to Precise?

Will that work for existing printer defintions, or new ones only?

I did not decide yet but probably we will backport the change to Precise.

The change is immediately active, also on existing printer definitions.

Ruslan (b7-10110111) wrote :

I have this problem with Epson Stylus Photo R300 printer, tried setting
lpadmin -p Stylus-Photo-R330 -o usb-unidir-default=true
but still have several seconds delay at the end of print job, i.e. the printer stops, waits several seconds, then does final carriage return and paper feed.
I've also tried to restart cups (just in case), but it didn't help.
I have the following in dmesg:
[18990.523142] usblp0: removed # when print job starts
[19019.917018] usblp0: USB Bidirectional printer dev 8 if 1 alt 0 proto 2 vid 0x04B8 pid 0x0803 # when printer finally does paper feed

Do I understand correctly that this should have worked with current cups in Precise? Any help, please?

I too have a hard time determining if this issue is fixed. I tried contacting Canonical for paid support on this to no avail.

Here is the AskUbuntu question:
https://bugs.launchpad.net/ubuntu/+source/cups/+bug/1001028

Here is the bug report for my FOSS Java software:
https://github.com/qzindustries/qz-print/issues/17

Even manual build instructions would suffice at this point. 12.04 is LTS so the client I'm dealing with wants to use it for a Kiosk solution. The print delays aren't observable on Windows or OSX, which prevents Ubuntu from being a reliable solution for the Kiosks at this time.

*Correction, Here is the AskUbuntu question:
http://askubuntu.com/questions/427176/cups-print-delays/

Tres Finocchiaro, this is an old bug report which is already marked as fixed. Therefore I recomment to first boot a live system of a newer Ubuntu release and check whether the problem is gone there. If the problem still persists, it probably has another origin than this bug. In this case please report a new bug following the instructions on

https://wiki.ubuntu.com/DebuggingPrintingProblems

Mitch Claborn (mitch-news) wrote :

I can confirm that this is working for me in Precise.
You must add

Option usb-unidir true

to the printers.conf file

To post a comment you must log in.