After upgrading from breezy to dapper I run into similar problems with my hp 1022 usb printer. I'm not sure whether I had tracked down this bug completely but finally I created a working patch for cups.
/var/log/cups/error.log says:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
D [26/May/2006:20:56:35 +0200] Get-Jobs ipp://localhost.localdomain:631/printers/HP1022
D [26/May/2006:20:56:35 +0200] cupsdProcessIPPRequest: 5 status_code=0 (successful-ok)
D [26/May/2006:20:56:35 +0200] cupsdCloseClient: 5
D [26/May/2006:20:56:38 +0200] [Job 71] LPGETSTATUS returned a port status of 00...
W [26/May/2006:20:56:38 +0200] [Job 71] Printer fault!
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
this is the code snipped from backend/usb-unix.c that generates these logging output:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
while (!ioctl(fd, LPGETSTATUS, &status))
{
fprintf(stderr, "DEBUG: LPGETSTATUS returned a port status of %02X...\n", status);
if (status & LP_POUTPA)
{
fputs("WARNING: Media tray empty!\n", stderr);
fputs("STATUS: +media-tray-empty-error\n", stderr);
paperout = 1;
}
if (!(status & LP_PERRORP))
fputs("WARNING: Printer fault!\n", stderr);
else if (!(status & LP_PSELECD))
fputs("WARNING: Printer off-line.\n", stderr);
else
break;
first !ioctl(fd, LPGETSTATUS, &status) is ever evaluated to true (even if status is 0). Maybe this is a side effect from a bug in the kernel. Second I really don't know why the break statement is never reached, so i applied following (ugly) patch that enabled printing for me:
--- cupsys-1.2.0/backend/usb-unix.c.orig 2006-05-26 22:08:53.000000000 +0200
+++ cupsys-1.2.0/backend/usb-unix.c 2006-05-26 22:09:43.000000000 +0200
@@ -158,7 +158,7 @@
* Show the printer status before we send the file...
*/
- while (!ioctl(fd, LPGETSTATUS, &status))
+ while (!ioctl(fd, LPGETSTATUS, &status) && status != 0)
{
fprintf(stderr, "DEBUG: LPGETSTATUS returned a port status of %02X...\n", status);
After upgrading from breezy to dapper I run into similar problems with my hp 1022 usb printer. I'm not sure whether I had tracked down this bug completely but finally I created a working patch for cups.
/var/log/ cups/error. log says:
>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>> 2006:20: 56:35 +0200] Get-Jobs ipp://localhost .localdomain: 631/printers/ HP1022 2006:20: 56:35 +0200] cupsdProcessIPP Request: 5 status_code=0 (successful-ok) 2006:20: 56:35 +0200] cupsdCloseClient: 5 2006:20: 56:38 +0200] [Job 71] LPGETSTATUS returned a port status of 00... 2006:20: 56:38 +0200] [Job 71] Printer fault! <<<<<<< <<<<<<< <<<<<<< <<<<<<
D [26/May/
D [26/May/
D [26/May/
D [26/May/
W [26/May/
<<<<<<<
this is the code snipped from backend/usb-unix.c that generates these logging output:
>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>
while (!ioctl(fd, LPGETSTATUS, &status))
{
fprintf(stderr, "DEBUG: LPGETSTATUS returned a port status of %02X...\n", status);
if (status & LP_POUTPA) "WARNING: Media tray empty!\n", stderr); "STATUS: +media- tray-empty- error\n" , stderr);
{
fputs(
fputs(
paperout = 1;
}
if (!(status & LP_PERRORP)) "WARNING: Printer fault!\n", stderr); "WARNING: Printer off-line.\n", stderr);
fputs(
else if (!(status & LP_PSELECD))
fputs(
else
break;
sleep(5); <<<<<<< <<<<<<< <<<<<<< <<<<<<< <<<<<<< <<<<<
}
<<<<<<<
first !ioctl(fd, LPGETSTATUS, &status) is ever evaluated to true (even if status is 0). Maybe this is a side effect from a bug in the kernel. Second I really don't know why the break statement is never reached, so i applied following (ugly) patch that enabled printing for me:
--- cupsys- 1.2.0/backend/ usb-unix. c.orig 2006-05-26 22:08:53.000000000 +0200 1.2.0/backend/ usb-unix. c 2006-05-26 22:09:43.000000000 +0200
+++ cupsys-
@@ -158,7 +158,7 @@
* Show the printer status before we send the file...
*/
- while (!ioctl(fd, LPGETSTATUS, &status)) stderr, "DEBUG: LPGETSTATUS returned a port status of %02X...\n", status);
+ while (!ioctl(fd, LPGETSTATUS, &status) && status != 0)
{
fprintf(