duplex printing through CUPS no longer works

Bug #308817 reported by Tommaso Toffoli on 2008-12-17
20
This bug affects 1 person
Affects Status Importance Assigned to Milestone
CUPS
Fix Released
Medium
cups (Ubuntu)
Undecided
Unassigned
Intrepid
Undecided
Unassigned
ghostscript (Ubuntu)
Undecided
Unassigned
Intrepid
Undecided
Unassigned

Bug Description

Since I moved from Ubuntu 8/04 to a full install of Ubuntu 8.10 on my office machine (desktop i386), the networked
printers that I use---a Canon 3320 and a canon 5180---while set up for double-sided printing (long edge) exactly as
before via CUPS, now insists on printing single-sided. Here is a test PostScript file (sent to the default printer via
'lpr testfile.ps', which used to work well double-sided with Ubuntu 8.04 and still works well with Windows:

%!
% <</Duplex true>> setpagedevice % Uncommenting this does not make a difference
100 100 100 200 rectstroke showpage
100 100 200 100 rectstroke showpage

The double-sided configuration is accepted without complaints by CUPS and correctly acknowledged; the .cpp file reads

  *OpenUI *Duplex/Double-Sided Printing: PickOne
  *OrderDependency: 130 AnySetup *Duplex
  *DefaultDuplex: DuplexNoTumble
  *Duplex DuplexNoTumble/Long Edge (Standard): "<</Duplex true /Tumble false>>setpagedevice"
  *Duplex DuplexTumble/Short Edge (Flip): "<</Duplex true /Tumble true>>setpagedevice"
  *Duplex None/Off: "<</Duplex false>>setpagedevice"
  *CloseUI: *Duplex

it seems to me that CUPS in this Ubuntu 8.10 context somehow fails to pass well this configuration to the printer.

Note that, on my home computer and home printer, the switch from Ubuntu 8.04 to Ubuntu 8.10 didn't show this problem. There, however, however, I have a USB HP laser printer, which is automatically recognized at installation time with all its properties, so that I only have to configure my preferences, not set up the whole printer. On the other hand, my standard procedure so far with the networked Canon printers has been to ignore make and model number and configure them as Generic PostScript.

Finally, I am not using Gnome but a simple, stripped down version of the window manager fvwm. But I have successfully
used this setup with the same machines and operating system for a couple of years---the problem only arose when I switched to Ubuntu 8.10.

Any lights?

PS
$ lsb_release -rd
Description: Ubuntu 8.10
Release: 8.10

cups 1.3.9-2

I expected to to see double-sided printing
I invariably get single-sided printing (on those networked printers; two-sided works as before on a recognized USB printer)

Reece (reece) wrote :

I have the same problem with a similar history.

Under 08.04, duplex printing worked fine to a Xerox 5500 and a Xerox Phaser 8550DP.

After upgrading to 08.10, duplexing works on the 5500 but not the 8550DP, as tested by printing the same document through evince.

Till Kamppeter (till-kamppeter) wrote :

After the release of Intrepid we have fixed a lot of printing-related bugs. Please update your system at first and then try again. Do

sudo apt-get update
sudo apt-get upgrade

This will install a bunch of packages. When it finishes, try to print again and tell whether the problem still persists.

Dear Till:

Thanks for your reply. In the meantime I have been experimenting with the
bug, and I fixed it myself---I'm curious to see whether the upgrades you
point to will also fix the problem, and I will let you know.

At any rate, calling my printer 'cp', I compared the two cp.ppd's generated
one by Ubuntu 8.04 and the other by Ubuntu 8.10. Using the old one on the new
system fixed the "loss of double-sided printing" problem. After some
block-by-block and line-by-line replacements of old by new, it seems that the
only offending line in the new .ppd is in the header block (line 12 of actual
code), namely,

  *cupsFilter: "application/vnd.cups-pdf 0 foomatic-rip"

Commenting out this line, as in

  *%cupsFilter: "application/vnd.cups-pdf 0 foomatic-rip"

in the 8.10 vintage .cpp is enough to fix the problem (whatever the reason).

Thanks for your assistance, and best to everybody on launchpad.

                                                Tom Toffoli
----------------------------------------------------------------
        Tommaso Toffoli <email address hidden> |
        Research Prof. pm1.bu.edu/~tt | home:
        Boston University 617/353-9846 | 617/864-8545
        ECE Department 8 Saint Mary's St | 26 Athens St
                                      Boston MA | Cambridge MA

Till Kamppeter (till-kamppeter) wrote :

The effect of you change is letting another sequence of filters being used. There were a lot of ixes done in the filters. Therefore please try the updates with the unmodified PPD.

Reece (reece) wrote :

I was already updated/upgraded. I did it again anyway. The problem persists.

Specifically, I did this:
$ sudo apt-get update
$ sudo apt-get upgrade
Defined a new printer in case this made any difference
Opened an arbitrary PDF. Tried to duplex the 8550DP -- fail. Retried on 5500 -- success.

I've attached a list of cups* and foo* packages with versions.

Till Kamppeter (till-kamppeter) wrote :

Reece, can you attach the PPD files (from /etc/cups/ppd/) of your two printers? This way I could find out what the difference of the two cases is.

Changed in cups:
status: New → Incomplete
hjs (hjstein) wrote :

I'm having the same problem with Ubuntu 8.10, but with an HP Photosmart P1100 with a duplex attachment. In the printer config, (system->administration->printing), it quite nicely comes up with the printer when I plug it into the USB port, even maintaining the duplex setting I selected the first time I connected the printer (right-click & select "properties" & choose "more" in the "Common Options" section of "Job Options", it shows "Sides: To-sided (long edge)"). However, when I print from Firefox, the print dialog's "Page Setup" tab shows "Two-sided: Not available", and attempting to print duplex from the command line, as in:

   lpr -o sides=two-sided-long-edge -o page-ranges=1-2 file.pdf

only prints single sided (even though it respects the page range & properly processes the pdf file).

hjs (hjstein) wrote :

Fooling around with it some more, I found the printer defaulting to the cdj550 driver. When I changed it to the hpijs driver, duplex started working properly.

I have also confirmed this bug on a Xerox x255, while using the Xerox 133 PPD file. Duplex printing worked in 8.04, but now fails in 8.10. I have all the latest Ubuntu updates including -proposed and -backports. No luck on duplex printing. I am about to try out the fix suggested in this thread to see if it works. Confirming this bug for now as it is definitely a bug.

Changed in cups:
status: Incomplete → Confirmed

Confirmed bug, introduced since 8.10. Temporary workaround is below:

# sed -i "s/^\*cupsFilter:\t\"application\/vnd.cups-pdf 0 foomatic-rip\"/\*%cupsFilter:\t\"application\/vnd.cups-pdf 0 foomatic-rip\"/" /etc/cups/ppd/*.ppd && /etc/init.d/cups restart

Please fix. Thanks! :-)

I do not know whether it helps, but can you try the following:

Do

sudo gedit /usr/share/ghostscript/8.64/Resource/Init/gs_setpd.ps

and look for this structure around line 424:

  % Define the keys used in output attribute matching.
  /.outputattrkeys [
    /OutputType /Duplex /Tumble /ManualFeed
  ] readonly def
} ifelse

Remove the "/Duplex /Tumble /ManualFeed" after "/OutputType" and save the file.

Now undo everything which you edited in the PPD files (Reactivate '*cupsFilter: "application/vnd.cups-pdf 0 foomatic-rip"' line) and restart CUPS so that the manual changes in the PPD files get active. Now try to print again. Does Duplex work now?

I edited the gs_setpd.ps file according to your instructions and it seems to have fixed the duplex printing problem I was having with Ubuntu 8.10 and a Samsung 3051ND Laser Printer. Only my file was in the following path:

/usr/share/ghostscript/8.63/lib/gs_statd.ps

Frank, thanks for doing the test.

Sorry, I was on a box where I tested Ghostscript 8.64.

Are you sure that you did the change in

/usr/share/ghostscript/8.63/lib/gs_statd.ps

I found the place which I described in my last comment only in

/usr/share/ghostscript/8.63/lib/gs_setpd.ps

on my Intrepid box with Ghostscript 8.63.

Yes, you are correct...I was looking at the wrong file when I typed that line. It should be:

/usr/share/ghostscript/8.63/lib/gs_setpd.ps

When will this bug be fixed in Ubuntu??? :-)

On Tue, Jan 13, 2009 at 11:49 AM, Till Kamppeter
<email address hidden> wrote:
> I do not know whether it helps, but can you try the following:
>
> Do
>
> sudo gedit /usr/share/ghostscript/8.64/Resource/Init/gs_setpd.ps
>
> and look for this structure around line 424:
>
> % Define the keys used in output attribute matching.
> /.outputattrkeys [
> /OutputType /Duplex /Tumble /ManualFeed
> ] readonly def
> } ifelse
>
> Remove the "/Duplex /Tumble /ManualFeed" after "/OutputType" and save
> the file.
>
> Now undo everything which you edited in the PPD files (Reactivate
> '*cupsFilter: "application/vnd.cups-pdf 0 foomatic-rip"' line) and
> restart CUPS so that the manual changes in the PPD files get active. Now
> try to print again. Does Duplex work now?
>
> --
> duplex printing through CUPS no longer works
> https://bugs.launchpad.net/bugs/308817
> You received this bug notification because you are a direct subscriber
> of the bug.
>

--
Kristian Erik Hermansen

Have you tried Session Destroyer yet?
<http://kristian.hermansen.googlepages.com/session.destroyer.html>

Kristian Erik, did you test the fix already whether it also worked for you? If not, can you please do so and tell us whether it fixes the problem also for you? Thanks.

Your fix did not seem to apply to me. I could not locate the line you
mention and there are less than 424 lines in my file. Only my sed
hack worked for me...

On 1/17/09, Till Kamppeter <email address hidden> wrote:
> Kristian Erik, did you test the fix already whether it also worked for
> you? If not, can you please do so and tell us whether it fixes the
> problem also for you? Thanks.
>
> --
> duplex printing through CUPS no longer works
> https://bugs.launchpad.net/bugs/308817
> You received this bug notification because you are a direct subscriber
> of the bug.
>

--
Sent from my mobile device

Kristian Erik Hermansen

Have you tried Session Destroyer yet?
<http://kristian.hermansen.googlepages.com/session.destroyer.html>

Kristian Erik, the file to edit is

/usr/share/ghostscript/8.63/lib/gs_setpd.ps

The version on an up-to-date Intrepid has well more than 424 lines. Please do

sudo apt-get install --reinstall ghostscript

to assure that your file is correct. Then edit it as described.

Till,

Modifying the file as you suggest did not work. Only my solution
works so far...

On Sat, Jan 17, 2009 at 5:06 PM, Till Kamppeter
<email address hidden> wrote:
> Kristian Erik, the file to edit is
>
> /usr/share/ghostscript/8.63/lib/gs_setpd.ps
>
> The version on an up-to-date Intrepid has well more than 424 lines.
> Please do
>
> sudo apt-get install --reinstall ghostscript
>
> to assure that your file is correct. Then edit it as described.
>
> --
> duplex printing through CUPS no longer works
> https://bugs.launchpad.net/bugs/308817
> You received this bug notification because you are a direct subscriber
> of the bug.
>

--
Kristian Erik Hermansen

Have you tried Session Destroyer yet?
<http://kristian.hermansen.googlepages.com/session.destroyer.html>

Ghostscript in Jaunty has the fixed gs_setpd.ps file now.

Changed in ghostscript:
status: New → Fix Released

On Tue, Jan 20, 2009 at 4:27 PM, Till Kamppeter
<email address hidden> wrote:
> Ghostscript in Jaunty has the fixed gs_setpd.ps file now.

Till,

That file did not work for me though...
--
Kristian Erik Hermansen

Have you tried Session Destroyer yet?
<http://kristian.hermansen.googlepages.com/session.destroyer.html>

Kristian Erik Hermansen, you are perhaps bitten by bug 299918, please have a look there. Tomorrow am update of the foomatic-filters package will get released there for testing. Please anyone who do not get his problem solved by editing /usr/share/ghostscript/8.63/lib/gs_setpd.ps, please go to bug 299918.

Changed in cups:
status: Confirmed → Invalid

Tommaso Toffoli, please have also a look at bug 299918.

For everyone for whom the suggestion of editing gs_setpd.ps works out, I propose the attached debdiff as an SRU.

The fixed Ghostscript package is uploaded to -proposed and waits for approval.

On Thu, Jan 22, 2009 at 7:20 AM, Till Kamppeter
<email address hidden> wrote:
> Kristian Erik Hermansen, you are perhaps bitten by bug 299918, please
> have a look there. Tomorrow am update of the foomatic-filters package
> will get released there for testing. Please anyone who do not get his
> problem solved by editing /usr/share/ghostscript/8.63/lib/gs_setpd.ps,
> please go to bug 299918.

I will check, thanks...

> ** Changed in: cups (Ubuntu)
> Status: Confirmed => Invalid

You should not be marking confirmed bugs as invalid, ever! Please set
them to "Fix Released" if the bug was confirmed and rectified by new
code uploaded to the repositories...
--
Kristian Erik Hermansen

Have you tried Session Destroyer yet?
<http://kristian.hermansen.googlepages.com/session.destroyer.html>

Kristian Erik Hermansen, this bug was initially assigned to CUPS by one of the volunteer triagers because he saw that it is about printing but he was not aware of the internals of the printing workflow and all the packages which are involved (in contrary to scanning with SANE where the SANE package contains the core and all drivers). The triager still did a good thing by assigning the bug to CUPS as this way he raised my attention and I started the investigation.

You have discovered this bug report and as at least the symptoms of your problem are the same as of the initial reporter you have marked the bug "Confirmed".

The hint that Ghostscript could be the culprit I got only after you having kicked in. And today I came to the idea that some of the posters here could suffer bug 299918. I made appropriate comments and not having any hint for CUPS being the culprit and also not having done any upload of CUPS which cured the problem for someone posting here I invalidated the CUPS task. No one really proved that CUPS could have caused the bug.

Till,

That makes sense, but in the future, when you mark something as invalid due to the package name please do consider adding the correct package at the same time. Since you did this later, it appeared to simply be marked as invalid without any other additions.

Also, bug 299918 fixes do not work for me either. If you have any other ideas, please let me know. The only solution still for me is to make use of the sed script I posted earlier...

Martin Pitt (pitti) wrote :

Till,

thanks for digging out the patch. Can you please enhance the changelog with an explanation how the patch works? (or just mention it here if you don't want to reupload). The patch is by far not obvious, and I wonder why the /Duplex /Tumble /ManualFeed had been there previously in the first place. I'd like to make sure that the patch is properly understood and does not cause regressions for other users with duplex/manual feed etc. Thank you!

Changed in cups:
status: New → Invalid
Changed in ghostscript:
status: New → Incomplete

pitti, it is the following upstream bug in Ghostscript:

http://bugs.ghostscript.com/show_bug.cgi?id=690041

The bug was discovered under Windows, but Frank Zimmerman's success message in this bug report shows that it was also a problem for Linux.

The problem creeped in with the ESP/GPL Ghostscript merger. This commit was to do two other things and as a third (accidental, therefore not documented in log) change the bug was introduced:

http://www.ghostscript.com/pipermail/gs-cvs/2007-May/007499.html
http://svn.ghostscript.com/viewvc/branches/gs-esp-gpl-merger/lib/gs_setpd.ps?view=log&pathrev=7929#rev7928
http://svn.ghostscript.com/viewvc/branches/gs-esp-gpl-merger/lib/gs_setpd.ps?r1=7929&r2=7928&pathrev=7929

Changed in ghostscript:
status: Incomplete → Confirmed
Martin Pitt (pitti) wrote :

Ah, thank you. Looks good then.

Changed in ghostscript:
status: Confirmed → In Progress
Changed in cups:
status: Unknown → Fix Released
Martin Pitt (pitti) wrote :

Accepted ghostscript into intrepid-proposed, please test and give feedback here. Please see https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in ghostscript:
status: In Progress → Fix Committed

On Fri, Jan 23, 2009 at 8:31 AM, Martin Pitt <email address hidden> wrote:
> Accepted ghostscript into intrepid-proposed, please test and give
> feedback here. Please see https://wiki.ubuntu.com/Testing/EnableProposed
> for documentation how to enable and use -proposed. Thank you in advance!

Will test the final patch once the package propagates. At the moment
all I see are the old packages...
# apt-cache madison ghostscript
ghostscript | 8.63.dfsg.1-0ubuntu6.1 | http://us.archive.ubuntu.com
intrepid-updates/main Packages
ghostscript | 8.63.dfsg.1-0ubuntu6 | http://us.archive.ubuntu.com
intrepid/main Packages
--
Kristian Erik Hermansen

Have you tried Session Destroyer yet?
<http://kristian.hermansen.googlepages.com/session.destroyer.html>

Till,

Fixed! Seems that your manual workaround did not fix my issue, but
that the package updates did. Quite strange. Here's what was
updated...

The following packages will be upgraded:
  busybox-initramfs cups cups-bsd cups-client cups-common foomatic-filters
  ghostscript ghostscript-x gvfs gvfs-backends gvfs-bin gvfs-fuse libcups2
  libcupsimage2 libgs8 libgvfscommon0 libnautilus-extension1 libsmbclient
  libwbclient0 linux-headers-2.6.27-11 linux-headers-2.6.27-11-generic
  linux-image-2.6.27-11-generic linux-libc-dev linux-source-2.6.27 nautilus
  nautilus-data samba-common smbclient winbind
--
Kristian Erik Hermansen

Have you tried Session Destroyer yet?
<http://kristian.hermansen.googlepages.com/session.destroyer.html>

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ghostscript - 8.63.dfsg.1-0ubuntu6.2

---------------
ghostscript (8.63.dfsg.1-0ubuntu6.2) intrepid-proposed; urgency=low

  * debian/patches/72_gs-setpd-ps-duplex-fix.dpatch: Duplex printing did not
    work in some cases (LP: #308817).

 -- Till Kamppeter <email address hidden> Thu, 22 Jan 2008 16:39:22 +0100

Changed in ghostscript:
status: Fix Committed → Fix Released
Changed in cups:
importance: Unknown → Medium
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.