bobbymg
Posts: 25
Joined: Tue Mar 12, 2019 11:48 pm

How does the CUPS server deliver the right driver for the RPi

Mon Jan 20, 2020 7:32 pm

I recently installed a driver for my new Epson ET-2760 printer from CUPS. I'm curious on how CUPS managed to provide the correct machine code for the Raspberry Pi 3B+. I assume there are many UNIX machines out there with different instruction sets! Does CUPS merely provide source code, and lets the host compile it? (I remember, in the early days of UNIX, all programs were delivered as source code.)

Bob D.

User avatar
PeterO
Posts: 5442
Joined: Sun Jul 22, 2012 4:14 pm

Re: How does the CUPS server deliver the right driver for the RPi

Mon Jan 20, 2020 7:36 pm

bobbymg wrote:
Mon Jan 20, 2020 7:32 pm
I recently installed a driver for my new Epson ET-2760 printer from CUPS. I'm curious on how CUPS managed to provide the correct machine code for the Raspberry Pi 3B+. I assume there are many UNIX machines out there with different instruction sets! Does CUPS merely provide source code, and lets the host compile it? (I remember, in the early days of UNIX, all programs were delivered as source code.)

Bob D.
I would expect the "driver" just tallks to the printer using a standard protocol. (Like IPP https://en.wikipedia.org/wiki/Internet_ ... g_Protocol)

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
scruss
Posts: 2816
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: How does the CUPS server deliver the right driver for the RPi

Mon Jan 20, 2020 8:39 pm

Yeah, this one's an IPP printer. IPP's a bit clever, as it combines
  • mDNS, so the printer can announce its presence to other computers on the network. Try the ippfind command to list all the IPP printers on your network
  • a query mechanism, so the printer can tell the client what input formats it supports and its resolution, colour capabilities, paper handling, etc. I put a sample ipptool query on the forum a while back.
  • support for relatively few printer languages: something like PDF, HP PCL (application/vnd.hp-pcl), PWG Raster (image/pwg-raster), and Apple Raster (image/urf). The Brother laser I have here only supports the latter two, so despite PCL and PostScript support in the past, this printer accepts bitmaps only. Big files, yes, but really easy to generate on almost any computer, especially one with accelerated graphics.
All the code in CUPS is open source and portable. Apple bought the CUPS project a few years back and employs its main developer. From the user's point of view, though, this really is driverless printing. It hasn't come soon enough, frankly.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

bobbymg
Posts: 25
Joined: Tue Mar 12, 2019 11:48 pm

Re: How does the CUPS server deliver the right driver for the RPi

Mon Jan 20, 2020 10:20 pm

So, the CUPS server does not download any executable code? It only tells the host what printer protocol to use? And, the printer protocols are already known to Raspian?

Still confused Noob
Bob D.

User avatar
scruss
Posts: 2816
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: How does the CUPS server deliver the right driver for the RPi

Mon Jan 20, 2020 11:49 pm

Not quite sure what you mean by "download executable code".

So I just printed a PNG image. Digging about in the CUPS debug logs, I see that it runs two filters when printing:

PNG file → imagetorasterrastertopwg → Brother DCP-L2550DW

These two filters are binary programs that live in /usr/lib/cups/filter and are part of the cups-filters package. Yes, they are Raspberry Pi-specific binaries, but the source is portable.

So Raspbian "knows" the printer protocols only if it has the CUPS filters to do so. With IPP, there are relatively few filters, not like the myriad drivers we used to need — ever looked at the driver list output by GhostScript when you type gs -h? That's a lot of output drivers!

I'd recommend taking a look at the copious output of ipptool for your printer: while there are few drivers, there is SO MUCH configuration information shared. It's a far cry from those "clever" Laserjets that could send their model over the parallel port so you could install the right driver in MS-DOS …
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

User avatar
DougieLawson
Posts: 37075
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: How does the CUPS server deliver the right driver for the RPi

Tue Jan 21, 2020 10:55 am

scruss wrote:
Mon Jan 20, 2020 8:39 pm
  • mDNS, so the printer can announce its presence to other computers on the network. Try the ippfind command to list all the IPP printers on your network
You'll need to use sudo apt install cups-ipp-utils to get ippfind.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
scruss
Posts: 2816
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: How does the CUPS server deliver the right driver for the RPi

Tue Jan 21, 2020 4:57 pm

The OP had already installed cups-ipp-utils to get their IPP printer working in another thread.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

User avatar
DougieLawson
Posts: 37075
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: How does the CUPS server deliver the right driver for the RPi

Tue Jan 21, 2020 5:24 pm

scruss wrote:
Tue Jan 21, 2020 4:57 pm
The OP had already installed cups-ipp-utils to get their IPP printer working in another thread.
That wasn't obvious for the random reader of this new thread.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Return to “Raspbian”