RFC: Adding smarts to handle Canon Sephy dyesub printers
Solomon Peachy
pizza at spam.shaftnet.org
Wed Jan 4 07:06:33 PST 2012
Howdy!
To make a long story short, newer Canon Selphy printers (all ES-series
and the newer CP-series) require an intelligent print spooler, because
if you just blindly dump the raw data to the printer, it will lock up.
The rough sequence is as follows:
Wait for "ready to print" readback
Dump init sequence (first 12-16 bytes of print job, depending on model)
Wait for a "ready for first plane" readback
Dump first image plane (header + plane data)
Wait for a "ready for next plane" readback
[repeat for all planes]
Wait for "all planes complete" readback
Write footer sequence (only some models)
All readbacks are 12 bytes, and vary based on model family. The various
headers are embedded in the print job, and are distinct enough to
identify the model family. I've identified five families so far.
I wrote a standalone tool [1] that interfaces directly to Linux's
/dev/usblpX chardev and uses stdio to read/write the appropriate chunks.
However this is non-portable and isn't properly integrated into the rest
of the system. I was thinking of rewriting it to use libusb, but the
proper solution is to write a CUPS filter that will do the appropriate
buffering/readbacks so that it JustWorksWhenYouPlugItInAndHitPrint(tm).
I'm not sure how it would all tie together but I'm guessing we'd just
bundle the filter with gutenprint and modify gutenprint's ppd file to
reference the filter where necessary. (I'm assuming that's feasible)
Unfortunately there's a bit of a problem:
In backend/usb-unix.c, the backchannel from Canon USB printers is
explicitly disabled. This would have to be changed, but both
whitelisting and blacklisting aproaches have their downsides. (Also, it
doesn't seem to call cupsBackChannelWrite() anywhere..)
backend/usb-libusb.c doesn't seem to support backchannels at all.
And finally, backend/usb-darwin.c seems to support the backchannel,
without the explicit disabling of all Canon USB printers.
So, how should I proceed from here? I can start writing a CUPS filter
that assumes the various USB backends work properly, but that's not
going to get me very far since I wouldn't have a good way of testing it.
[1] http://www.shaftnet.org/~pizza/es_print_assist.c
Thanks,
- Solomon
--
Solomon Peachy pizza at shaftnet dot org
Melbourne, FL ^^ (mail/jabber/gtalk) ^^
Quidquid latine dictum sit, altum viditur.
More information about the cups-devel
mailing list