hpijs and hpcups drivers select wrong tray if default is set to CDDVDTray

Bug #786117 reported by Reinhold Kainhofer on 2011-05-21
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Won't Fix

Bug Description

Running hplip 3.11.3a and 3.11.5 on Ubuntu (natty).

There seems to be a bug in the filter code (for the Photosmart C5380 in my case, maybe also for other printers): If you set the default tray to CDDVDTray (in the system's printer config dialog or equivalently in the /etc/cups/ppd/printername.ppd file), then the filter will always try to use the photo tray rather than the CD/DVD tray...

Looking at an USB snoop, the filter really sends the PCL command <ESC>&l0H in that case rather than the correct <ESC>&l14H command, which selects the DVD tray.

If you choose any other tray as the default in the .ppd file and manually select the DVD tray in the print dialog, then the correct command <ESC>&l14H is sent.

This happens with both the hpijp and the hpcups filter.


Description of problem:

Trying to use my kewpie program to print to a DVD using my HP Photosmart C5580 All-In-One usb printer. It acts as if the DVD tray info disappears on the way to the printer. I get a message on the printer that basically says "Hey! You have the DVD tray loaded, unload it so I can print to regular paper".

If I reboot the same computer back to fedora 13 and print using the same kewpie program to the same C5580 printer, then I get a nicely printed DVD with my image centered on the DVD as intended, so the hardware seems to be functioning perfectly well.

Version-Release number of selected component (if applicable):

Here's all the rpms I could think of that are printer related on my f14
system where this fails:


Here's the same list of stuff from fedora 13 where it works:


Here's the link to the kewpie program I use to print with (uses Qt):


How reproducible:

Every single time I print on f14 I see the same error from the printer.

Steps to Reproduce:
1. try to print a nice 1394x1394 .png file with the image to go on the dvd
2. get error from printer about the DVD try being loaded

Actual results:

error from printed

Expected results:

printed DVD

Additional info:

Here is the config info the kewpie program uses:


The C5500-DVD printer is a duplicate I made of the auto installed printer
def, then edited to say default to DVD tray and DVD media size.

I see the hplip version numbers are identical in the f14 and f13 packages,
so maybe it isn't an hplip problem, but someone is losing the tray info
somewhere, and I just picked the highest probability candidate from past
experience with DVD printing not working.

Just tried a very simple test printing from GIMP, just putting a line of
text well within the borders of the DVD, and that was able to print correctly.

So it seems like this might either be a Qt printer interface problem or the
margin handling has gotten tweaked somewhere and my exactly right size full
width image now looks too big for the printer to think it can go on a DVD.

On my f14 system I have this Qt:


On the f13 system I have:


You might be able to narrow down the problem by running the filters in the chain by hand.

You can find out the job attributes that were sent for the job by examining the /var/spool/cups/c* file like this:

import cups, pprint

First of all, check that they look correct.

If they are fine, run the next filter in the chain. If your print job is the PNG file as-is, and you're using the hpcups driver, the next filter will be "imagetoraster".

You can run it like:

PPD=/etc/cups/ppd/myprinter.ppd \
  /usr/lib/cups/filter/imagetoraster 1 me '' 1 \
    'number-up=1 InputSlot=Auto other-job-attributes...' \
    /var/spool/cups/data/d00038-1 \
    > image.rast

where the relevant attributes you got from examining the c* file go on line 3, and line 4 is the PNG file you sent.

You can then examine the "CUPS Raster" format output using the rasterview package.

Download full text (7.3 KiB)

I'm not actually sending a .png file directly, I'm using the Qt library interface to paint an image on a printer device. What that does internally, I have no idea, but it clearly does something different than gimp. If I copy my margin values from the definition I have setup for the kewpie program into gimp's print... dialog (telling it first to ignore predefined margins), then gimp can print a perfectly centered image on the DVD just like I used to be able to do with kewpie (and I wrote kewpie because gimp printing was all messed up and I couldn't get it to set the margins, so we have now come full circle :-).

Here's the attributes of the job kewpie sent to the printer (which did not work):

[root@zooty cups]# python
Python 2.7 (r27:82500, Sep 16 2010, 18:02:00)
[GCC 4.5.1 20100907 (Red Hat 4.5.1-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cups, pprint
>>> r=cups.IPPRequest()
>>> r.readIO(file("c00052").read)
>>> pprint.pprint(r.attributes)
[<cups.IPPAttribute attributes-charset (1:71): ['utf-8']>,
 <cups.IPPAttribute attributes-natural-language (1:72): ['en']>,
 <cups.IPPAttribute printer-uri (2:69): ['ipp://localhost:631/printers/C5500-DVD']>,
 <cups.IPPAttribute job-originating-user-name (2:66): ['tom']>,
 <cups.IPPAttribute job-name (2:66): ['']>,
 <cups.IPPAttribute document-format (2:73): ['application/pdf']>,
 <cups.IPPAttribute media (2:68): ['CDDVD120']>,
 <cups.IPPAttribute job-priority (2:33): [50]>,
 <cups.IPPAttribute job-uuid (2:69): ['urn:uuid:278e3b24-cfd5-3e4b-4678-52822ea1a3e9']>,
 <cups.IPPAttribute output-bin (2:66): ['face-down']>,
 <cups.IPPAttribute output-mode (2:66): ['color']>,
 <cups.IPPAttribute print-quality (2:35): [4]>,
 <cups.IPPAttribute job-originating-host-name (2:66): ['localhost']>,
 <cups.IPPAttribute time-at-creation (2:33): [1304105977]>,
 <cups.IPPAttribute time-at-processing (2:33): [1304105977]>,
 <cups.IPPAttribute time-at-completed (2:33): [1304106019]>,
 <cups.IPPAttribute job-id (2:33): [52]>,
 <cups.IPPAttribute job-state (2:35): [9]>,
 <cups.IPPAttribute job-media-sheets-completed (2:33): [1]>,
 <cups.IPPAttribute job-printer-uri (2:69): ['ipp://zooty:631/printers/C5500-DVD']>,
 <cups.IPPAttribute job-k-octets (2:33): [58]>,
 <cups.IPPAttribute job-hold-until (2:68): ['no-hold']>,
 <cups.IPPAttribute job-sheets (2:66): ['none', 'none']>,
 <cups.IPPAttribute job-printer-state-message (2:65): [u'']>,
 <cups.IPPAttribute job-printer-state-reasons (2:68): ['none']>]

And here's the attributes from the job gimp sent (which did work):

[root@zooty cups]# python
Python 2.7 (r27:82500, Sep 16 2010, 18:02:00)
[GCC 4.5.1 20100907 (Red Hat 4.5.1-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cups, pprint
>>> r=cups.IPPRequest()
>>> r.readIO(file("c00053").read)
>>> pprint.pprint(r.attributes)
[<cups.IPPAttribute attributes-charset (1:71): ['utf-8']>,
 <cups.IPPAttribute attributes-natural-language (1:72): ['en']>,
 <cups.IPPAttribute job-originating-user-name (2:66): ['tom']>,
 <cups.IPPAttribute printer-uri (2:69): ['ipp://localhost:631/printers/C5500-DVD']>,
 <cups.IPPAttribute job-name (2:66...


Perhaps it's something specific in the generated PDF file that causes the PDF filter problems in Fedora 14 (but not 13).

Change the 'PreserveJobFiles' option to 'Yes' by running this command, as root:
  cupsctl PreserveJobFiles=Yes

Now submit the job again and the server will have a copy of the file it received in /var/spool/cups/d*.

Perhaps you could attach that file here, along with the PPD for the queue (from the /etc/cups/ppd/ directory)?

Created attachment 500206
pdf file from the print job that did not work on F14

Created attachment 500207
C5500-DVD.ppd file from the Fedora 14 systems that does not work

Created attachment 500208
pdf file from the fedora 13 system that printed correctly

Created attachment 500209
C5500DVD.ppd printer def from the fedora 13 system that prints correctly

Just read the external bug report, and it sure seems like my problem. I'll have to try printing to the C5500-Letter printer I have defined then changing the media and tray to DVD and see if that works. Shucks, maybe if I define a ppd file to go to the photo tray, it will go to DVD instead :-).

Srikanth (srikanth-lokare) wrote :

Verified this Bug with HP Photosmart C5380 All-in-One printer on Ubuntu10.04 32bit OS using the latest HPLIP build internal build, print job from GNOME image viewer with default options, the filter use the CD/DVD tray to complete the job. This is expected behavior. But the print from hp-toolbox with default options, the filter use the photo tray to print.

Note: CD/DVD tray is set as default tray.

OK, I finally tried the solution in the external bug report, and it worked. If I start with the C5500-Letter printer and painstakingly specify all the output tray and media size options and manually plug in my carefully calibrated margins, then I can print a DVD on Fedora 14 with my kwepie program and it works just as well as it used to work when all the information came from the C5500-DVD ppd file and I didn't have to manually fix it. Now if only someone would fix hplip :-).

Tom Horsley (tom-horsley) wrote :

This isn't isolated to ubuntu either. See:


My DVD printing program designed specifically to allow printing without doing all kinds of printer and margins setup can now only print if I start with the wrong printer definition and manually do all the printer and margin setup. For me it is a C5580 printer, but the results are the same.

Tom Horsley (tom-horsley) wrote :

The latest fedora hplip package, hplip-3.11.5-1.fc14.x86_64, still has this problem. (I'm never sure if it was supposed to fix any given problem or not :-).

Grrr! The launchpad bugzilla seems to imply that the 3.11.7 hplip fixed this, but in f16 beta, I still see the same behavior of not going to the DVD tray. I had hoped that someday I'd be able to print to DVD without having to reboot to my old fedora 13 partition (which was the last time it worked :-).

Tom Horsley (tom-horsley) wrote :

So I just tested an early TC2 version of fedora 16 beta, and it has hplip-3.11.7-2.fc16.x86_64 which still exhibits the same symptoms. So here is a question: Can someone point me to a place where I can hack the hpcups source code so that it *always* prints to the CD/DVD tray no matter what was specified? I'd be perfectly willing to swap in a hacked filter executable in place of the normal one when I am about to print a DVD :-).

Changed in fedora:
importance: Unknown → Undecided
status: Unknown → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

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