A Linux Printer Debugging Guide
2021-09-20 - By Robert Elder
I recently spent $1,459.00 on a brand new Epson SureColor P900 printer. Unfortunately, this model of printer is not officially compatible with Linux. Clearly, this is unacceptable, and the only reasonable course of action is to force this printer to be compatible with Linux regardless of how much time, money, or resources it will cost to do so.
This article will assume that the reader is interested in knowing how they can force their printer to work with Linux. Therefore, the rest of this article will focus on providing a general overview of how to debug and analyze printer problems on Linux for most printer models. Finally, the article will end with a discussion on how I was able to force my specific Epson P900 printer to work with Linux.
Try 'Obvious' Things First
Before we dive into the details, let's get some of the obvious things to try out of the way first:
- Just plug your printer in and see if it automatically appears as a new printer in your list of devices. Sometimes, the printer will just auto install and work immediately even if it's not 'officially' supported.
- Go into your distribution's 'settings' page and try to manually add it as a new printer. Usually, it will at least be detected as a 'generic' printer and give you basic printing functionality with the 'official' manufacturer's driver.
- Check the manufacturer's web page for drivers that you can install on Linux. Some manufacturers do offer Linux drivers, and if they provide Linux drivers at all, there is a very good chance that they'll make your printer work. This can be worth doing even if the printer will 'auto-install' with a default Linux driver, since you may gain additional functionality. Also, if you can even find the drivers at all, it's a good idea to download and save a copy. Most likely, they won't be available for download in a couple years, but you'll probably still have the printer then and want to use it.
- If you can't find the driver for your exact model of printer on the manufacturers page, or through the default Linux printer menu, try adding the printer as another one in the same series from the same manufacturer. For example, my printer is an Epson P900, but when I install it through the Gutenprint drivers I can see that the PPD file it installs is just one for the P800.
So, It's Not Officially Supported... Now What?
First of all, try connecting to the printer via every different connection method that is supports: USB, Ethernet, Wireless etc. It's possible that the issue is only with one of the connection methods but not the others.
Another thing that's easy to forget about, is that not all USB ports are created equally. Both the printer and the USB port itself will use different versions of the USB protocol. It's not unheard-of for certain devices to only work in some of the USB ports on your computer.
If your printer still isn't working, you can try installing some of the generic 'printer driver' packages. In my case, I had luck with the 'Gutenprint' drivers on Ubuntu 20.04:
sudo apt-get install printer-driver-gutenprint
In Ubuntu 20.04, there is also another 'meta' printer driver package called 'printer-driver-all' that appears to include the above 'gutenprint' driver package:
sudo apt-get install printer-driver-all
If you decide to install the open source printer drivers from a repository, you can try adding the printer again through your distribution's settings panel and cross your fingers.
Finally, there is also another collection of printing software and drivers for Linux called 'Turboprint'. Turboprint costs money to buy, and it's not open source, but it's good to know that there is at least someone actively developing printing software for the Linux platform. Turboprint does come with a trial version so you can test to see if it works with your printer before you buy it. Turboprint comes with its own dedicated and separate application for adding new printers.
Printer Still Doesn't Work - Now What?
Well, it looks like we're now going to have to dive into the world of command-line debugging. The goal of the rest of this article will not be to help you debug every printer problem, but rather to make you aware of the concepts that are available to help you debug and analyze the problem. I have tried to organize this article so that topics are presented in a way that's well suited to someone learning about them for the first time. I have also assumed that many people are unlikely to read this entire article because they just want to fix their printer as fast as possible, and that they want the most applicable knowledge first. It may at times feel like the topics in this article jump around a lot, but there's just too much detail to cram it all into one section. Here's an overview of the topics discussed in the rest of this article:
- lsusb Command
- Printer Device Nodes In /dev/
- CUPS Backends
- What Is CUPS?
- What Is udev?
- What Is Systemd?
- What Is ippusbxd?
- What Is Apparmor?
- What Is D-Bus?
- lp Command
- lpr Command
- What Are Printer Drivers?
- What Is GTK?
- Logs Files To Check
- Even More About Udev Rules & Your Printer
- Debugging Kernel Events & udev
- Device Major/Minor Numbers & Kernel Drivers
- CUPS Filters
- How Was I able To Force My Printer To Work With Linux?
- The Future Of Printing On Linux
lsusb Command
The first thing that I'd suggest doing is to try and identify whether your system is even able to detect the printer. To do this, you can plug in the printer via USB and run this command:
lsusb
The exact output of this command will depend on what USB devices you have plugged in. When I run this command, I see the following:
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 06cb:00bd Synaptics, Inc.
Bus 001 Device 003: ID 04f2:b6be Chicony Electronics Co., Ltd Integrated Camera
Bus 001 Device 009: ID 03f0:0024 HP, Inc KU-0316 Keyboard
Bus 001 Device 012: ID 258a:1007
Bus 001 Device 011: ID 03f0:c111 HP, Inc Deskjet 1510
Bus 001 Device 010: ID 04b8:00bb Seiko Epson Corp.
Bus 001 Device 002: ID 0e8f:0016 GreenAsia Inc. 4 port USB 1.1 hub UH-174
Bus 001 Device 007: ID 8087:0026 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Whatever the output is for you, try to spot anything that resembles your printer model/manufacturer name. If you're not sure, you can unplug the printer and run the command again to check if the results of this output changes. If one of the devices in the output above disappears after you unplug your printer, that was probably your printer device!
You can also use the '-s' flag to show only information about a specific bus/device number:
lsusb -s 001:010
which outputs the following for me:
Bus 001 Device 010: ID 04b8:00bb Seiko Epson Corp.
You can also add the -v flag and run the command as root to get more information about each device:
sudo lsusb -sv 001:010
The results will contain lots of information that looks something like this:
...
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x04b8 Seiko Epson Corp.
idProduct 0x00bb
bcdDevice 1.00
iManufacturer 1
iProduct 2
iSerial 3
bNumConfigurations 1
...
Without knowing in advance what your printing problem is, it's difficult to say what you should look for here, but in my case it is re-assuring that the output of lsusb indicates that this device is a 'printer:
bInterfaceClass 7 Printer
A common cause of hardware devices not working correctly is when they are 'identified' as the wrong type of device. If the output above had indicated that the 'printer' was a USB storage device, or a USB mouse, this would provide one possible avenue of investigation. The solution to this hypothetical problem could involve making tweaks to device/product/manufacturer ids in the Linux kernel, for example.
Printer Device Nodes In /dev/ - usblp and libusb
If your printer shows up in the output of 'lsusb', you should also check the contents of '/dev/usb/':
ls -l /dev/usb/lp*
On my computer, the output is currently:
crw-rw---- 1 root lp 180, 0 Sep 13 09:43 /dev/usb/lp1
Take note that this device shows up in the group 'lp' which is a good sign for a printer device, since this group is associated with 'printers' on Debian based distributions.
In my experience, a USB printer does not necessarily need to show up above for it to be able to print. However, it does sometimes appear (or disappear) at the above location. I did not take the time to research exactly why it occasionally disappears, but I believe that this may be due to logic (and occasionally race conditions) inside another application called 'ippusbxd' (discussed later). There are many forum posts online where people suggest that printer devices in '/dev/usb/' are part of the 'old' way of doing things, and should no longer be relied upon.
A related topic of discussion is the kernel module 'usblp' and the library 'libusb'. There are many discussion threads where people suggest that they needed to selectively rely upon 'libusb' or 'usplp' to get their printer to work. A common statement people make is that they needed to blacklist 'usblp'. These two pieces of software have a long and complex history that I don't completely understand myself. If you want to get started reading about it, you can start with this thread titled 'Cups and kernel USB printer support (/dev/usb/lp0)'. You can also read about references to the idea that 'usblp' is deprecated (although, it is enabled by default still in my version of Ubuntu 20.04 in today in 2021). You can also read about some reports that usblp and libusb have conflicts.
Another location worth checking is here:
ls -latr /dev/bus/usb/*/*
the output that I get looks like this:
crw-rw-r-- 1 root root 189, 0 Aug 8 11:27 /dev/bus/usb/001/001
crw-rw-r-- 1 root root 189, 1 Aug 8 11:27 /dev/bus/usb/001/002
crw-rw-r-- 1 root root 189, 2 Aug 8 11:27 /dev/bus/usb/001/003
crw-rw---- 1 root plugdev 189, 4 Aug 8 23:35 /dev/bus/usb/001/005
crw-rw-r-- 1 root root 189, 6 Aug 8 11:27 /dev/bus/usb/001/007
crw-rw-r-- 1 root root 189, 31 Aug 9 00:04 /dev/bus/usb/001/032
crw-rw-r-- 1 root root 189, 32 Aug 9 00:04 /dev/bus/usb/001/033
crw-rw-r-- 1 root lp 189, 33 Aug 9 00:25 /dev/bus/usb/001/034
crw-rw-r-- 1 root root 189, 128 Aug 8 11:27 /dev/bus/usb/002/001
crw-rw-r-- 1 root root 189, 256 Aug 8 11:27 /dev/bus/usb/003/001
crw-rw-r-- 1 root root 189, 384 Aug 8 11:27 /dev/bus/usb/004/001
Again, we can see one device above that appears to be in the 'lp' group, which is a give-away that this device must be associated with a printer. The fact that we can see printer device nodes at all is a very good sign that the printer is being detected by Linux.
CUPS Backends
Your printer might not be plugged in via USB, or it may use some kind of alternate USB protocol that causes it to not show up in '/dev' anywhere. In these cases, you should check to see what CUPS backends are installed on your system:
ls /usr/lib/cups/backend*
For my system, I get the following:
/usr/lib/cups/backend:
beh bjnp bluetooth cups-brf dnssd driverless hp hpfax http https implicitclass ipp ipps lpd mdns parallel serial snmp socket tpu usb
/usr/lib/cups/backend-available:
dnssd lpd snmp socket usb
According to the CUPS documentation, these programs aren't supposed to be run by users, but they do provide a way to test out communication with printers using various different communication methods. Each executable corresponds to a communication protocol indicated by its name.
In the CUPS documentation, it says: "CUPS backends are not generally designed to be run directly by the user. .... Unless you are a developer and know what you are doing, please do not run backends directly. Instead, use the lp(1) or lpr(1) programs to send print jobs or lpinfo(8) to query for available printers using the backend. " ... "CUPS printer drivers and backends are deprecated and will no longer be supported in a future feature release of CUPS."
However, despite the above warning, I would not be surprised if we still find ourselves using CUPS backends long into the future anyway. Let's go ahead and run the one for USB:
sudo /usr/lib/cups/backend-available/usb
and here is the result that I get:
DEBUG: Loading USB quirks from "/usr/share/cups/usb".
DEBUG: Loaded 95 quirks.
DEBUG: list_devices
DEBUG: libusb_get_device_list=11
DEBUG2: Printer found with device ID: MFG:Brother;CMD:PJL,PCL,PCLXL,URF;MDL:HL-L2360D series;CLS:PRINTER;CID:Brother Laser Type1;URF:W8,CP1,IS4-1,MT1-3-4-5-8,OB10,PQ4,RS300-600,V1.3,DM1; Device URI: usb://Brother/HL-L2360D%20series?serial=U
direct usb://Brother/HL-L2360D%20series?serial=U"Brother HL-L2360D series" "Brother HL-L2360D series" "MFG:Brother;CMD:PJL,PCL,PCLXL,URF;MDL:HL-L2360D series;CLS:PRINTER;CID:Brother Laser Type1;URF:W8,CP1,IS4-1,MT1-3-4-5-8,OB10,PQ4,RS300-600,V1.3,DM1;" ""
You can experiment with the different CUPS backend executables to get more information about what works with your printer.
Another command that you can use to get information about printers on your system is 'lpstat':
lpstat -v -t
On my machine, this command currently outputs the following:
device for Deskjet-1510-series: hp:/usb/Deskjet_1510_series?serial=
device for HL-L2360D-series: usb://Brother/HL-L2360D%20series?serial=
device for SC-P900: usb://EPSON/SC-P900%20Series?serial=
device for SureColorP900-TurboPrint: tpu://Epson/SC-P900_Series/SN=
scheduler is running
system default destination: Deskjet-1510-series
device for Deskjet-1510-series: hp:/usb/Deskjet_1510_series?serial=
device for HL-L2360D-series: usb://Brother/HL-L2360D%20series?serial=
device for SC-P900: usb://EPSON/SC-P900%20Series?serial=
device for SureColorP900-TurboPrint: tpu://Epson/SC-P900_Series/SN=
Deskjet-1510-series accepting requests since Tue 14 Sep 2021 09:05:11 PM EDT
HL-L2360D-series accepting requests since Tue 14 Sep 2021 09:04:56 PM EDT
SC-P900 accepting requests since Fri 20 Aug 2021 06:28:07 PM EDT
SureColorP900-TurboPrint accepting requests since Mon 13 Sep 2021 07:58:31 PM EDT
printer Deskjet-1510-series is idle. enabled since Tue 14 Sep 2021 09:05:11 PM EDT
printer HL-L2360D-series disabled since Tue 14 Sep 2021 09:04:56 PM EDT -
Unplugged or turned off
printer SC-P900 is idle. enabled since Fri 20 Aug 2021 06:28:07 PM EDT
printer SureColorP900-TurboPrint is idle. enabled since Mon 13 Sep 2021 07:58:31 PM EDT
And yet another command you can run is 'lpinfo':
lpinfo -v
which currently outputs the following for me:
file cups-brf:/
network ipps
network http
network lpd
network https
network socket
network beh
network ipp
direct hp:/usb/Deskjet_1510_series?serial=
direct usb://HP/Deskjet%201510%20series?serial=&interface=1
direct tpu://HP/Deskjet_1510_series/SN=
direct tpu://Epson/SC-P900_Series/SN=
direct hpfax
network bjnp
network lpd://BRN30055C4/BINARY_P1
What Is CUPS?
We've already mentioned 'CUPS' in this article, but we haven't formally introduced it. CUPS stands for 'Common Unix Printing System', and if you've never heard of it before, then you should know that it's the most important piece of software that's mentioned in this article! If you spend any amount of time debugging your printer on Linux, you'll become very familiar with the term 'CUPS'.
For starters, let's see what 'cups' packages are installed on my system:
dpkg -l "*cups*"
and here is the result:
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=========================-=================-============-===================================================================
ii bluez-cups 5.53-0ubuntu3.2 amd64 Bluetooth printer driver for CUPS
ii cups 2.3.1-9ubuntu1.1 amd64 Common UNIX Printing System(tm) - PPD/driver support, web interface
ii cups-browsed 1.27.4-1 amd64 OpenPrinting CUPS Filters - cups-browsed
ii cups-bsd 2.3.1-9ubuntu1.1 amd64 Common UNIX Printing System(tm) - BSD commands
ii cups-client 2.3.1-9ubuntu1.1 amd64 Common UNIX Printing System(tm) - client programs (SysV)
ii cups-common 2.3.1-9ubuntu1.1 all Common UNIX Printing System(tm) - common files
ii cups-core-drivers 2.3.1-9ubuntu1.1 amd64 Common UNIX Printing System(tm) - driverless printing
ii cups-daemon 2.3.1-9ubuntu1.1 amd64 Common UNIX Printing System(tm) - daemon
ii cups-filters 1.27.4-1 amd64 OpenPrinting CUPS Filters - Main Package
ii cups-filters-core-drivers 1.27.4-1 amd64 OpenPrinting CUPS Filters - Driverless printing
un cups-filters-ippusbxd <none> <none> (no description available)
ii cups-ipp-utils 2.3.1-9ubuntu1.1 amd64 Common UNIX Printing System(tm) - IPP developer/admin utilities
un cups-pdf <none> <none> (no description available)
ii cups-pk-helper 0.2.6-1ubuntu3 amd64 PolicyKit helper to configure cups with fine-grained privileges
ii cups-ppdc 2.3.1-9ubuntu1.1 amd64 Common UNIX Printing System(tm) - PPD manipulation utilities
ii cups-server-common 2.3.1-9ubuntu1.1 all Common UNIX Printing System(tm) - server common files
un cupsys <none> <none> (no description available)
un ghostscript-cups <none> <none> (no description available)
un hplip-cups <none> <none> (no description available)
ii libcups2:amd64 2.3.1-9ubuntu1.1 amd64 Common UNIX Printing System(tm) - Core library
ii libcupsfilters1:amd64 1.27.4-1 amd64 OpenPrinting CUPS Filters - Shared library
ii libcupsimage2:amd64 2.3.1-9ubuntu1.1 amd64 Common UNIX Printing System(tm) - Raster image library
ii printer-driver-hpcups 3.20.3+dfsg0-2 amd64 HP Linux Printing and Imaging - CUPS Raster driver (hpcups)
un python-cupshelpers <none> <none> (no description available)
ii python3-cups 1.9.73-3build1 amd64 Python3 bindings for CUPS
ii python3-cupshelpers 1.5.12-0ubuntu1.1 all Python utility modules around the CUPS printing system
un python3.8-cups <none> <none> (no description available)
As you can see from the above output, there are a lot of 'cups' related packages on my system, and I have no idea what most of them do! One of the above packages that's worth paying attention to is 'cups-browsed'. This is a web server that you can usually visit by browsing to localhost port 631:
The above web-based GUI for interacting with CUPS will let you review some of the information about your printers and read documentation about CUPS internals.
What Is udev?
The next important piece of 'printer-related' software to consider is called 'udev'. The purpose of 'udev' is to forward information about kernel events to user space, whenever a device is added or removed from your system. This includes any type of hardware device, not just printers! For example, when you plug in your USB printer, this will most likely trigger a udev rule that initiates further actions. Here's an example of a 'udev' rule on my system:
ACTION=="add", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device" ENV{ID_USB_INTERFACES}=="*:070104:*", OWNER="root", GROUP="lp", MODE="0664", TAG+="systemd", PROGRAM="/bin/systemd-escape --template=ippusbxd@.service $env{BUSNUM}:$env{DEVNUM}", ENV{SYSTEMD_WANTS}+="%c"
Note that above rule mentions something called 'systemd', which is the topic of the next section.
What Is Systemd?
'Systemd' is a process that runs on many Linux distributions. It's purpose is to start and stop other services and processes on the system. Not all Linux distributions use systemd. You can do a web search for 'what init process does X Linux distribution use?' to find out if your distribution uses it. If your Linux distribution does use systemd, this is important because it means systemd will be the first process to run when your system boots up. After systemd starts, it will be responsible for spawning all kinds of processes and services, including ones that make your printer work. If these necessary printing services are never started, or they start but then immediately fail, then you should expect problems getting your printer to work correctly.
What Is ippusbxd?
The process 'ippusbxd' is relevant to printing because it can make your USB printers available over the local area network. IPP stands for Internet Printing Protocol, and is supposedly gaining traction as a new standard for printing. In my experience, I believe that 'ippusbxd' has been responsible for a few issues that caused my printer to not work due to ippusbxd's interaction with printer devices, although I haven't take the time to confirm exactly what the issue is.
What Is Apparmor?
AppArmor is a piece of software that can control what kind of system access other programs have. For example, if a user program tries to read a system file, AppArmor may invoke a security policy to deny the access. A common cause of programs failing is when they try to do some action for which they don't have access, and AppArmor will deny them, causing the program to fail or crash. In these cases you won't know anything went wrong unless you check the log files. If you try to run a print job that mysteriously fails without any message, check your system logs to see if there are any AppArmor statements related to printing software. For example, here's a random AppArmor denied statement that's in my logs right now (although this one isn't causing me any issues):
kernel: [13451.207913] audit: type=1400 audit(1631678416.238:88): apparmor="DENIED" operation="capable" profile="/usr/sbin/cups-browsed" pid=19138 comm="cups-browsed" capability=23 capname="sys_nice"
What Is D-Bus?
'D-Bus' is a piece of software that provides inter-process communication services on many Linux systems. D-Bus important because it interacts with CUPS services. Therefore, if D-Bus experiences problems, then CUPS may also experience problems.
lp Command
The 'lp' command can be used to print things from the command-line:
echo "Hello World!" | lp -d HL-L2360D-series
Running the above command will cause my printer to print out a single page with 'Hello World!' to my printer named 'HL-L2360D-series'. You'll have to replace 'HL-L2360D-series' with your printer device name. See next section for more details.
lpr Command
The 'lpr' command is yet another command that can be used to print things from the command-line (note that it uses different flags):
echo "Hello World!" | lpr -P HL-L2360D-series
To obtain a list of printer identifiers for use with lp or lpr, you can use this command:
lpstat -a
on my computer, the output of the following command is:
Deskjet-1510-series accepting requests since Fri 17 Sep 2021 02:21:14 PM EDT
HL-L2360D-series accepting requests since Tue 14 Sep 2021 09:04:56 PM EDT
SC-P900 accepting requests since Fri 20 Aug 2021 06:28:07 PM EDT
SureColorP900-TurboPrint accepting requests since Mon 13 Sep 2021 07:58:31 PM EDT
The 'lp' and 'lpr' commands have a long and complex history, and neither one of them is a complete substitute for the other. On modern systems, these two command-line applications are considered to be replaced by CUPS, however, for compatibility reasons, these two programs are still in use.
What Are Printer Drivers?
When people talk about 'drivers', most people think about pre-compiled binaries. However, when it comes to talking about 'printer drivers', things are much more complicated. For example, if you ask 'what driver is associated with my printer?' and poke around on your system, you'll probably find things like 'usblp' or 'libusb'. These are fairly 'generic' drivers and libraries that handle lower-level details of the USB communication protocol, and aren't likely to know any intimate details of your individual printer.
If you're looking for a 'printer driver' that contains information about your individual printer, the closest thing you're likely to find is called a PPD, or 'Postscript Printer Description' file. PPD files contain a programming language called 'postscript' that was developed by Adobe. Here is an example of the first few lines of a PPD file for one of my printers:
*PPD-Adobe: "4.3"
*%%%% PPD file for HL-L2360D with CUPS.
*%%%% Created by the CUPS PPD Compiler CUPS v2.3.1.
*ModelName: "Brother HL-L2360D"
*ShortNickName: "Brother HL-L2360D"
*NickName: "Brother HL-L2360D series, using brlaser v6"
*1284DeviceID: "MFG:Brother;CMD:PJL,PCL,PCLXL,URF;MDL:HL-L2360D series;CLS:PRINTER;CID:Brother Laser Type1;URF:W8,CP1,IS4-1,MT1-3-4-5-8,OB10,PQ4,RS300-600,V1.3,DM1;"
*cupsManualCopies: False
*cupsFilter: "application/vnd.cups-raster 33 rastertobrlaser"
...
Now if this seems too simple, don't worry because it's more complicated than this. Back when printers first started being sold, the first few commercially successful printers implemented the postscript language for describing printed document. Therefore, it was only natural to create the 'description' of how to interact with the printer from the computer end in the postscript language as well. However, Adobe's vision for the future was one where every printer manufacturer would need to buy a license to use their implementation of the 'postscript' language on the printer.
Of course, what happened instead was that many printers came to not support postscript at all, and the idea of creating a PPD file for them written in postscript didn't really make sense anymore. However, the CUPS software attempts to maintain this PPD-file based abstraction for printers, by inventing the concept of a 'CUPS-PPD' file, where the printer is described in the postscript language anyway, even though the printer may not support reading postscript files.
In addition to PPD files, there may also be a vendor-specific (Epson, HP, Cannon etc.) driver somewhere on your system that handles the communication details of a 'family' of printers from that vendor.
Some printers do support being directly fed postscript files, however some will require their own custom binary in addition to all the CUPS-ppd files in order accept print jobs.
What Is GTK?
GTK is a collection of software for creating graphical user interfaces on Linux. If you open a drop-down menu in a program and click 'print', there is a very good chance that you're interacting with GTK library functions related to printing. For example, the GIMP image editor calls the function 'gtk_print_operation_run' in the file 'print.c' on line 332. This function is a GTK library function.
The GTK libraries include a number of 'printer backends' that make references to 'CUPS' and 'lpr':
./modules/printbackends
./modules/printbackends/gtkprintercups.c
./modules/printbackends/gtkcupsutils.h
./modules/printbackends/gtkprintbackendlpr.c
./modules/printbackends/gtkcupssecretsutils.h
./modules/printbackends/gtkprintbackendcups.h
./modules/printbackends/meson.build
./modules/printbackends/gtkprintbackendlpr.h
./modules/printbackends/gtkprintercups.h
./modules/printbackends/gtkcupsutils.c
./modules/printbackends/gtkprintbackendcups.c
./modules/printbackends/gtkcupssecretsutils.c
./modules/printbackends/gtkprintbackendfile.c
./modules/printbackends/gtkprintbackendfile.h
It appears that there's a lot going on in these backends, because the file 'modules/printbackends/gtkprintbackendcups.c' alone is 7100 lines of code.
Logs Files To Check
Now that you know the basics of the most important printing related components on your system, then next thing you should do is monitor the log files for error messages. Here's a command that I like to use that will monitor for any new lines that are added to these files:
tail -f -n 0 /var/log/apport.log /var/log/kern.log /var/log/syslog /var/log/cups/*
- /var/log/apport.log - This log file contains information about crash reports.
- /var/log/kern.log - This log file contains information about kernel events.
- /var/log/syslog - This log file contains more general system information.
- /var/log/cups/* - These are the log files for CUPS services.
Depending on what log files are present at '/var/log' on your system, you may want to add more items to this list.
It's a good idea to monitor what appears in these log files in the following circumstances:
- Immediately after booting the system during the startup process.
- After plugging in the printer or unplugging it.
- During the process of adding a new printer through your settings pannel.
- During the process of trying to print.
In the most challenging cases, the source of the problem might happen at a completely different time than the actual symptoms of the problem. This is why it is important to look for relevant statements in the log files at startup time. If an important configuration file is missing, you might see complaints in the log files when the program starts up, but then only see the symptoms of the problem much later.
The number of statements in these log files can be overwhelming. That's why it's also helpful to use the 'grep' command to look for specific keywords (such as the name of a suspected application):
grep cups /var/log/apport.log /var/log/kern.log /var/log/syslog /var/log/cups/*
Even More About Udev Rules & Your Printer
Now let's return to the topic of 'udev' and kernel events so we can explore them in greater detail. First, let's talk about system udev rules that are stored at the location '/usr/lib/udev/rules.d/' on your machine. Every Linux distribution is likely to have a different collection of files at this location. Here are a few examples of printer-related udev rules from my Ubuntu 20.04 machine:
Here are the contents of the file at '/usr/lib/udev/rules.d/55-ippusbxd.rules':
# ippusbxd udev rules file
ACTION=="add", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device" ENV{ID_USB_INTERFACES}=="*:070104:*", OWNER="root", GROUP="lp", MODE="0664", TAG+="systemd", PROGRAM="/bin/systemd-escape --template=ippusbxd@.service $env{BUSNUM}:$env{DEVNUM}", ENV{SYSTEMD_WANTS}+="%c"
Here are the contents of the file at '/usr/lib/udev/rules.d/70-printers.rules':
# Low-level USB device add trigger
ACTION=="add", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}=="*:0701??:*", ENV{ID_USB_INTERFACES}!="*:070104:*", TAG+="systemd", ENV{SYSTEMD_WANTS}="configure-printer@usb-$env{BUSNUM}-$env{DEVNUM}.service"
# Low-level USB device remove trigger
ACTION=="remove", SUBSYSTEM=="usb", ENV{INTERFACE}=="7/1/*", ENV{INTERFACE}!="7/1/4", RUN+="udev-configure-printer remove %p"
The contents of the file at '/usr/lib/udev/rules.d/50-udev-default.rules' is quite long, so here we'll filter it through this command: 'cat /usr/lib/udev/rules.d/50-udev-default.rules | grep -P 'lp':
SUBSYSTEM=="tty", KERNEL=="sclp_line[0-9]*", GROUP="tty", MODE="0620"
SUBSYSTEM=="tty", KERNEL=="ttysclp[0-9]*", GROUP="tty", MODE="0620"
KERNEL=="parport[0-9]*", GROUP="lp"
SUBSYSTEM=="printer", KERNEL=="lp*", GROUP="lp"
SUBSYSTEM=="ppdev", GROUP="lp"
KERNEL=="lp[0-9]*", GROUP="lp"
KERNEL=="irlpt[0-9]*", GROUP="lp"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}=="*:0701??:*", GROUP="lp"
And, here's the contents of the file at '/usr/lib/udev/rules.d/56-hpmud.rules':
# HPLIP udev rules file. Notify console user if plugin support is required for this device.
ACTION!="add", GOTO="hpmud_rules_end"
SUBSYSTEM=="ppdev", OWNER="root", GROUP="lp", MODE="0664"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GOTO="hpmud_usb_rules"
GOTO="hpmud_rules_end"
LABEL="hpmud_usb_rules"
ENV{ID_USB_INTERFACES}=="", IMPORT{builtin}="usb_id"
# ENV{ID_HPLIP}="1" is for Ubuntu udev-acl
ATTR{idVendor}=="03f0", ENV{ID_USB_INTERFACES}=="*:0701??:*|*:ffcc00:", OWNER="root", GROUP="lp", MODE="0664", ENV{libsane_matched}="yes", ENV{hp_test}="yes", ENV{ID_HPLIP}="1"
# This rule will check the smart install feature, plugin status and firmware download for the required printers.
ENV{hp_test}=="yes", PROGRAM="/bin/sh -c 'logger -p user.info loading HP Device $env{BUSNUM} $env{DEVNUM}'", RUN+="/bin/sh -c '/usr/bin/nohup /usr/bin/hp-config_usb_printer $env{BUSNUM}:$env{DEVNUM}'"
LABEL="hpmud_rules_end"
The above are a few of the udev rules on my system that appear to be obviously related to printers. I did not take the time to review all of the rules files, because there are 111 of them! Whenever you plug in or remove a device from your system, it is important that the correct udev rule for that device is run. A common cause of hardware problems is when the wrong udev rule (or no udev rule at all) runs for a particular device. There is also the possibility of conflicts between multiple sets of rules, and the need to consider the order in which rules are run.
Occasionally, it can also be useful to 'override' the udev rules that are found at '/usr/lib/udev/rules.d'. This can be done by creating a corresponding rules file under '/etc/udev/rules.d/'. For example, if you run this command:
sudo touch /etc/udev/rules.d/55-ippusbxd.rules
This will create an empty file under '/etc/udev/rules.d/'. Having a correspondingly named empty file in this location will cause the system udev rules at '/usr/lib/udev/rules.d/55-ippusbxd.rules' to not run, since the 'empty' rules file will be considered instead.
Debugging Kernel Events & udev
If your printer doesn't appear to show up in the output from the 'lsusb' command, you may start to wonder if it's even being detected by your kernel at all. You can use the 'udevadm' command to help you monitor and debug kernel events:
man udevadm
For example, if I run this command:
udevadm monitor --udev --kernel --property
and plug in my printer, I'll see lots of output including the following:
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent
KERNEL[33764.033632] add /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-1
SUBSYSTEM=usb
DEVNAME=/dev/bus/usb/001/026
DEVTYPE=usb_device
PRODUCT=4b8/bb/100
TYPE=0/0/0
BUSNUM=001
DEVNUM=026
SEQNUM=5764
MAJOR=189
MINOR=25
...Removed lines
KERNEL[33764.048747] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/usbmisc/lp1 (usbmisc)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/usbmisc/lp1
SUBSYSTEM=usbmisc
DEVNAME=/dev/usb/lp1
SEQNUM=5766
MAJOR=180
MINOR=1
...Removed lines
UDEV [33764.069158] bind /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
ACTION=bind
DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-1
SUBSYSTEM=usb
DEVNAME=/dev/bus/usb/001/026
DEVTYPE=usb_device
DRIVER=usb
PRODUCT=4b8/bb/100
TYPE=0/0/0
BUSNUM=001
DEVNUM=026
SEQNUM=5770
USEC_INITIALIZED=33764057458
ID_VENDOR=EPSON
ID_VENDOR_ENC=EPSON
ID_VENDOR_ID=04b8
ID_MODEL=SC-P900_Series
ID_MODEL_ENC=SC-P900\x20Series
ID_MODEL_ID=00bb
ID_REVISION=0100
ID_SERIAL=EPSON_SC-P900_Series_
ID_SERIAL_SHORT=
ID_BUS=usb
ID_USB_INTERFACES=:070102:070104:ffaa01:ff0100:
ID_VENDOR_FROM_DATABASE=Seiko Epson Corp.
ID_PATH=pci-0000:00:14.0-usb-0:1
ID_PATH_TAG=pci-0000_00_14_0-usb-0_1
SYSTEMD_WANTS=printer.target
SYSTEMD_USER_WANTS=printer.target
MAJOR=189
MINOR=25
TAGS=:systemd:
In the output from this command, you'll see a reference to a 'major' and 'minor' number. Take note of this since it will be discussed in the next section.
udevadm info -a /dev/usb/lp1
You can also use the 'udevadm' command to show information about device nodes in '/dev':
looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-1':
KERNELS=="1-1"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{idProduct}=="00bb"
ATTRS{devnum}=="26"
ATTRS{configuration}==""
ATTRS{version}==" 2.00"
ATTRS{maxchild}=="0"
ATTRS{bNumInterfaces}==" 3"
ATTRS{bNumConfigurations}=="1"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{tx_lanes}=="1"
ATTRS{urbnum}=="13"
ATTRS{bConfigurationValue}=="1"
ATTRS{product}=="SC-P900 Series"
ATTRS{idVendor}=="04b8"
ATTRS{serial}==""
ATTRS{bmAttributes}=="c0"
ATTRS{ltm_capable}=="no"
ATTRS{bcdDevice}=="0100"
ATTRS{rx_lanes}=="1"
ATTRS{bDeviceSubClass}=="00"
ATTRS{devpath}=="1"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{bDeviceClass}=="00"
ATTRS{bMaxPower}=="2mA"
ATTRS{bDeviceProtocol}=="00"
ATTRS{removable}=="removable"
ATTRS{manufacturer}=="EPSON"
ATTRS{busnum}=="1"
ATTRS{speed}=="480"
ATTRS{quirks}=="0x0"
ATTRS{authorized}=="1"
Device Major/Minor Numbers & Kernel Drivers
If you run the ls command like this:
ls -latr /dev/usb/lp1
on one of your devices in '/dev', you'll see output like this:
crw-rw---- 1 root lp 180, 1 Aug 21 09:16 /dev/usb/lp1
Take note of the '180, 1' part. This shows that the 'major' number for this device node is 180, and the 'minor' number is 1. If I put this major and minor number together as '180:1' in the following command:
ls /sys/dev/char/180:1/device/
the output will show me a bunch of files and directories that are automatically populated by the kernel about this device:
authorized bInterfaceClass bInterfaceProtocol bNumEndpoints ep_04 firmware_node interface power supports_autosuspend usbmisc
bAlternateSetting bInterfaceNumber bInterfaceSubClass driver ep_85 ieee1284_id modalias subsystem uevent
If I read from this file:
cat /sys/dev/char/180:1/device/ieee1284_id
the output is the following
MFG:EPSON;CMD:ESCPL2,BDC,D4,D4PX,ESCPR7,END4,GENEP;MDL:SC-P900 Series;CLS:PRINTER;DES:EPSON SC-P900 Series;CID:EpsonRGB;RID:01;DDS:401900;ELG:13F0;SN:;
If I read from this file:
cat /sys/dev/char/180:1/device/uevent
the output is the following:
DEVTYPE=usb_interface
DRIVER=usblp
PRODUCT=4b8/bb/100
TYPE=0/0/0
INTERFACE=7/1/2
MODALIAS=usb:v04B8p00BBd0100dc00dsc00dp00ic07isc01ip02in00
Note that the above output includes 'DRIVER=usblp' which is the same 'usblp' mentioned earlier. Some people suggest blacklisting the kernel module. If you want to do that, you can do so by adding 'usblp' to this file:
ls /etc/modprobe.d/blacklist.conf
and then reboot to be sure the changes have taken effect. If you want to check if the 'usblp' module is loaded, you can use this command:
lsmod | grep usblp
In my case, the usblp module is currently loaded, so the output is the following:
usblp 28672 0
Now, let's look at the other printer device node:
ls -latr /dev/bus/usb/*/*
crw-rw-r-- 1 root root 189, 128 Aug 21 09:15 /dev/bus/usb/002/001
crw-rw-r-- 1 root root 189, 0 Aug 21 09:15 /dev/bus/usb/001/001
crw-rw-r-- 1 root root 189, 6 Aug 21 09:15 /dev/bus/usb/001/007
crw-rw-r-- 1 root root 189, 1 Aug 21 09:15 /dev/bus/usb/001/002
crw-rw-r-- 1 root lp 189, 3 Aug 21 09:15 /dev/bus/usb/001/004
crw-rw-r-- 1 root root 189, 7 Aug 21 09:15 /dev/bus/usb/001/008
crw-rw-r-- 1 root root 189, 5 Aug 21 09:15 /dev/bus/usb/001/006
crw-rw-r-- 1 root root 189, 384 Aug 21 09:15 /dev/bus/usb/004/001
crw-rw-r-- 1 root root 189, 256 Aug 21 09:15 /dev/bus/usb/003/001
crw-rw-r-- 1 root root 189, 2 Aug 21 09:16 /dev/bus/usb/001/003
crw-rw---- 1 root plugdev 189, 4 Aug 21 15:06 /dev/bus/usb/001/005
Take note of the one device above that's in the group 'lp'. It has a major number 189 and minor number 3. Again, you can use a similar command to show system files that contain information related to this device:
ls /sys/dev/char/189:3/
For example, if I run this command:
cat /sys/dev/char/189:3/product
I see the following result:
SC-P900 Series
which is the model number of the printer that I have plugged in. If I check the 'uevent' file:
cat /sys/dev/char/189:3/uevent
I see the following result:
MAJOR=189
MINOR=3
DEVNAME=bus/usb/001/004
DEVTYPE=usb_device
DRIVER=usb
PRODUCT=4b8/bb/100
TYPE=0/0/0
BUSNUM=001
DEVNUM=004
which shows that this device node is associated with the driver 'usb'.
You can learn a lot about how Linux sees devices by poking around in these files. I won't pretend to understand everything about the contents of these files, but this should hopefully point you in the right direction.
If you are unfortunate enough to discover that your printer is not correctly recognized by the Linux kernel, you may need to dive even further into the world of enabling, disabling, or even editing or writing modules in your kernel. You may also need to edit or even write your own udev rules. These topics are beyond the scope of this article.
CUPS Filters
CUPS filters are executables that transform documents from one format to another. Let's take a look at what CUPS filters are installed on my system:
ls /usr/lib/cups/filter/
and the output is the following:
bannertopdf gstopxl pdftops rastertopwg
brftoembosser gstoraster pdftoraster rastertoqpdl
brftopagedbrf gziptoany pstops rastertosag-gdi
c2esp hpcups pstoqpdl svgtopdf
c2espC hpcupsfax pstotiff sys5ippprinter
cgmtopdf hpps pstoturboprint textbrftoindexv3
cmxtopdf imagetobrf rastertobrlaser textbrftoindexv4
command2esp imagetopdf rastertoepson texttobrf
command2foo2lava-pjl imagetops rastertoescpx texttopdf
commandtoescpx imagetoraster rastertohp texttops
commandtopclx imagetoubrl rastertolabel texttotext
commandtops imageubrltoindexv3 rastertopclm vectortobrf
commandtoturboprint imageubrltoindexv4 rastertopclx vectortopdf
emftopdf mupdftoraster rastertopdf vectortoubrl
foomatic-rip musicxmltobrf rastertops wmftopdf
gstopdf pdftopdf rastertoptch xfigtopdf
As you can see, most of these executables are of the from XtoY meaning that they will transform a document from format X to format Y. For example, 'pdftops' will transform documents from pdf format to 'postscript' or 'ps' format. 'rastertoepson' will transform from 'raster' format to 'epson' format.
Filters are important because they're one potential source of your printer not working. If you ever have printing problems that only occur with a specific document type, you should suspect that a CUPS filter problem might be the culprit.
If you read through the CUPS documentation, it also says that CUPS filters are 'deprecated', however just like with the 'deprecated' backends, I have feeling that we'll be working with them long into the future. The documentation also says that CUPS filters are not meant to be run directly by users and that they require a number of environment variables to be set. The documentation isn't kidding either, because the API for filters is awful to work with as you'll see in a moment.
Let's first do some experiments with printing to my Brother laser printer using documents that are created by directly running CUPS filters manually. Throughout these example, you'll note that these commands are very verbose with lots of 'dummy' variables and extra environment variables that don't seem to do anything. These commands were all found through trial and error and have been simplified as much as possible. First I'll use the 'texttops' to try and transform text on the command-line into a postscript file:
echo "Hello World!" | CUPS_SERVERBIN=/usr/lib/cups/ CUPS_DATADIR=./ TMPDIR=./ /usr/lib/cups/filter/texttops 1 1 1 1 1 > out.ps
The above command does indeed produce a postscript file that says 'Hello World!' in 'out.ps'. Now, I'll try to print this postscript file by piping its contents directly to my printer. Note that piping random data into files in '/dev/' can be quite dangerous if you don't know what you're doing. Don't try this yourself if you're not sure what you're doing:
sudo sh -c 'cat out.ps > /dev/usb/lp1'
After running the above command with my Brother printer plugged in, it does indeed start up and begin printing. However, it actually just prints out the first line of the postscript file, and then prints out tons of blank pages until the printer runs out of paper. The text 'Hello World!' is nowhere in sight. Not quite what I wanted.
Now, let's try poking around to see if there are some more appropriate filters that can give us a document format that is compatible with this printer. After running these commands:
# Search for filter that output to brlaser:
ls /usr/lib/cups/filter/*brlaser
# Search for filter that output to raster:
ls /usr/lib/cups/filter/*raster
# Search for filter that output to pdf:
ls /usr/lib/cups/filter/*pdf
I can see that there are CUPS filters for 'texttopdf', 'pdftoraster' and 'rastertobrlaser'. I can run the text 'Hello World!' through these filters and try to print again using these commands:
echo "Hello World!" | CUPS_SERVERBIN=/usr/lib/cups/ CUPS_DATADIR=./ TMPDIR=./ /usr/lib/cups/filter/texttopdf 1 1 1 1 1 > out.pdf
cat out.pdf | CUPS_SERVERBIN=/usr/lib/cups/ CUPS_DATADIR=./ TMPDIR=./ /usr/lib/cups/filter/pdftoraster 1 1 1 1 1 > out.raster
cat out.raster | CUPS_SERVERBIN=/usr/lib/cups/ CUPS_DATADIR=./ TMPDIR=./ /usr/lib/cups/filter/rastertobrlaser 1 1 1 1 1 > out.brlaser
sudo sh -c 'cat out.brlaser > /dev/usb/lp1'
This gives me exactly the result that I want! It prints a single page containing only the text 'Hello World!'.
Now, let's try a more advanced example. Here's some SVG xml that will produce a happy face that I'll put in the file 'face.svg':
<svg viewBox="0 0 200 200" width="400" height="400" xmlns="http://www.w3.org/2000/svg">
<circle cx="100" cy="100" fill="white" r="78" stroke="black" stroke-width="3"/>
<g>
<circle cx="66" cy="66" r="12"/>
<circle cx="132" cy="66" r="12"/>
</g>
<path d="m132 120 c 0 0 -33 60 -66 0" style="fill:none; stroke: black; stroke-width: 3;"/>
</svg>
and here is the image produced by the above SVG document:
This time, I need to use a different series of filters since the starting document format is different. The use of 'sudo' was necessary to allow 'svgtopdf' to read the ppd file. Here are the commands I used to successfully print this document on my Brother laster printer:
cat face.svg | sudo CUPS_SERVERBIN=/usr/lib/cups/ CUPS_DATADIR=./ TMPDIR=./ PPD=/etc/cups/ppd/HL-L2360D-series.ppd /usr/lib/cups/filter/svgtopdf 1 1 1 1 'page-left=0 page-right=0 page-top=0 page-bottom=0 TextDotDistance=220 TextDots=6 LineSpacing=123 GraphicDotDistance=6 LibLouis=en_US.tbl LibLouis2=en_US.tbl LibLouis3=en_US.tbl LibLouis4=en_US.tbl' > out.pdf
cat out.pdf | CUPS_SERVERBIN=/usr/lib/cups/ CUPS_DATADIR=./ TMPDIR=./ /usr/lib/cups/filter/pdftoraster 1 1 1 1 1 > out.raster
cat out.raster | CUPS_SERVERBIN=/usr/lib/cups/ CUPS_DATADIR=./ TMPDIR=./ /usr/lib/cups/filter/rastertobrlaser 1 1 1 1 1 > out.brlaser
sudo sh -c 'cat out.brlaser > /dev/usb/lp1'
The first time I ran the 'svgtopdf' filter, it actually failed for me since it appears to have a dependency on 'inkscape'. I was able to make this filter work by running the following command:
sudo apt-get install inkscape
Interestingly, while I was browsing around these filter files, I found that 'svgtopdf' is actually just a symlink to 'vectortopdf' which is a script. Inside 'vectortopdf', there is a reference to this script:
/usr/share/cups/braille/cups-braille.sh
The above script is responsible for many of the extra dependencies for the 'mandatory' 'option' variables that are needed by the 'svgtopdf' filter. I also found that this script uses 'grep' to search through the printer PPD file to extract certain constants that it then never uses.
Finally, I also tested out this process of generating documents with filters with my Epson printer too. Here are the commands I used for this:
echo "Hello World!" | CUPS_SERVERBIN=/usr/lib/cups/ CUPS_DATADIR=./ TMPDIR=./ /usr/lib/cups/filter/texttopdf 1 1 1 1 1 > out.pdf
cat out.pdf | CUPS_SERVERBIN=/usr/lib/cups/ CUPS_DATADIR=./ TMPDIR=./ /usr/lib/cups/filter/pdftoraster 1 1 1 1 1 > out.raster
sudo CUPS_SERVERBIN=/usr/lib/cups/ CUPS_DATADIR=./ TMPDIR=./ PPD=/etc/cups/ppd/SC-P900.ppd /usr/lib/cups/filter/rastertoepson 1 1 1 1 1 out.raster > out.epson
sudo sh -c 'cat out.epson > /dev/usb/lp1'
Running the commands above did result in the Epson printer waking up and acknowledging that it was about to print, however the printer didn't actually print the page. Instead, the display panel just got stuck in an endless loop asking me to add the paper roll attachment:
This model of printer can pull paper from several different trays and directions, so clearly there must be a protocol for instructing this printer which tray to pull paper from. In this case, piping the print job data directly to the printer device clearly does not provide the necessary printer tray information. Since I already got this printer working correctly via other means, I did not pursue any further investigation into directly printing through filters this way. I suspect that there may be an additional option that needs to be provided to the filer, or perhaps a more elaborate communication protocol than piping job data directly to the printer device.
How Did I Force My Printer To Work With Linux?
First I went through the automatic install process without installing any extra drivers. It auto-detected the printer and I was able to add it, but whenever I tried to print to it, I would get the same issue that was discussed previously where it would try to print from the wrong tray and endlessly ask me to add the roll paper feed attachment.
Then, I installed the Gutenprint drivers and re-added the printer with a better driver that was based on the Epson P800. This was able to print color right away, although the colors were a bit off off and I wasn't easily able to figure out how to print with custom icc paper profiles. When I was experimenting with Gutenprint, I also had a couple instances where it would produce a print that was completely flooded with ink and made a huge mess. I didn't test out printing much with Gutenprint since I moved on to try out Turboprint instead.
I installed Turboprint, and I initially found that it didn't work when the printer was attached using USB. Then I tried printing to it over ethernet which worked perfectly. The colours looked good right away, and I was able to get it to use custom .icc profiles for my paper. Not being able to print over USB was annoying, so I found that if I prevented 'ippusbxd' from starting up, I could get the printer to be detected properly. I did this by creating a udev override to prevent ippusbxd from running when a new printer was plugged in using this command:
sudo touch /etc/udev/rules.d/55-ippusbxd.rules
Something else worth noting: I found that ippusbxd crashes on my other computer that has a freshly installed copy of same version of Ubuntu 20.04. Ironically, the fact that ippusbxd crashes immediately on that computer seems to prevent it from causing the printer to not be detected when connected via USB.
After that, Turborpint worked fine with this printer over a USB connection. I was also able to produce decent prints right away with Turboprint. I'm new to the world of colour accurate printing, so I've had to do a lot of test prints to figure out what the right settings are.
Gutenprint ResultsWithout manufacturer's paper .icc profile and no calibrated profile. |
Turboprint ResultsWith manufacturer's paper .icc profile, but no calibrated profile. |
The above images should not be considered a rigorous comparison of color accuracy, and instead just a quick demo to demonstrate that printing works. Accurate color calibration requires much more fine tuning. I was eventually able to improve the Turboprint image quality further than what's shown above by setting the 'ink limit' to 300 and paying to have a custom paper profile created.
The Future Of Printing On Linux
So as of today, August 2021, what does the future of printing on Linux look like? I think we're probably going to see a continuation of the confusing mess that blends together multiple deprecated ways of printing (libusb, usblp, CUPS etc.) with many new and partially completed/supported ways of printing. The industry seems like it's trying to move toward using the 'Internet Printing Protocol' universally. This would imply that the future will involve less searching for magic 'printer device nodes' in '/dev', and would instead involve submitting print jobs using an HTTP request to a 'print server' that supports the IPP protocol.
The other thing worth noting is the seemingly ambiguous future of the CUPS package. From reading the documentation, it appears that basically everything in CUPS is 'deprecated', but what the replacement for these components will be, I don't quite know. There is also some confusing politics involving CUPS and Apple Inc. The article just linked states: "Back in 2007 Apple effectively acquired the open-source CUPS project and in 2017 then decided to no longer develop CUPS under the GPL but instead the Apache 2.0 license for this widely-used Unix/macOS/Linux print server. But then at the end of 2019 the CUPS lead developer left Apple and following that public development of CUPS seemingly halted." ... "Apple CUPS will continue seeing these bug fixes pulled in from OpenPrinting CUPS but Apple is no longer interested in feature development on this print server."
In doing research for this article, I also came across OpenPrinting WorkGroup. According to their page, it appears that they are doing active work on the CUPS package. I also found the presentation "CUPS Plenary Joint PWG / Open Printing Summit - May 2021 Michael R Sweet (Lakeside Robotics)" that appears to discuss a vision for the future of the CUPS package.
So, that's probably a lot to take in, but hopefully this guide can help you force your printer to work with Linux.
A Surprisingly Common Mistake Involving Wildcards & The Find Command
Published 2020-01-21 |
$1.00 CAD |
A Guide to Recording 660FPS Video On A $6 Raspberry Pi Camera
Published 2019-08-01 |
The Most Confusing Grep Mistakes I've Ever Made
Published 2020-11-02 |
Use The 'tail' Command To Monitor Everything
Published 2021-04-08 |
An Overview of How to Do Everything with Raspberry Pi Cameras
Published 2019-05-28 |
An Introduction To Data Science On The Linux Command Line
Published 2019-10-16 |
Using A Piece Of Paper As A Display Terminal - ed Vs. vim
Published 2020-10-05 |
Join My Mailing List Privacy Policy |
Why Bother Subscribing?
|