Spurious "Media tray empty!" message on successful CUPS print job #667

Closed
michaelrsweet opened this Issue Apr 5, 2004 · 1 comment

Comments

Projects
None yet
1 participant
Collaborator

michaelrsweet commented Apr 5, 2004

Version: 1.1.20
CUPS.org User: jmrasor.donboscowest

See several posts about this issue in cups.bugs, cups.general. Users get message "Media tray empty!" even when there is paper in the tray; their jobs print correctly in spite of the error message.

When I get this message, it's always for a job given to a USB printer connected to a Red Hat 9 file and print server. The error_log file (LogLevel debug in cupsd.conf) says LPGETSTATUS returns port status 18.

I think the problem is in the CUPS source. I grabbed the 1.1.20 source, installed it, then changed line 249 in backend/usb.c from

if (!(status & LP_POUTPA))

to read

if (status & LP_POUTPA)

.. then re-compiled. The resulting cupsd prints correctly without showing that "media tray empty" gripe, while the old one prints correctly while showing that gripe. If I take all the paper out of the tray then print with the recompiled cups 1.1.20, the message is issued as it should be.

Background: the kernel source tree for 2.4.20 has, in include/linux/lp.h, a define in line 37:

define LP_POUTPA 0x20 /* unchanged input, active high */

Sure looks like the CUPS code tests the bit in the wrong sense. If status byte is 0x18, we are not out of paper: bit 5 is clear. But status & LP_POUTPA will be (0x18 & 0x20) = zero, and the CUPS code will find !(status & LP_POUTPA) to be true, and therefore throw the error.

My setup:

Server:
Red Hat 9 with stock 2.4.20-8 kernel.
CUPS 1.1.20.
Samba 2.2.7a.
Workstations submitting jobs are WinXP, Win98, Mac OS 9.2. Client OS makes no difference.

Collaborator

michaelrsweet commented Apr 9, 2004

CUPS.org User: mike

Already fixed - see STR #660.

michaelrsweet added this to the Stable milestone Mar 17, 2016

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