Solving Ubuntu printer “broken pipe” problem (DocuPrint C525A)

Are you having a problem with your printer under the latest versions of Ubuntu (perhaps it worked under an older version)? Are you able to print short documents, but not longer, or more graphics-intensive, documents? (e.g. the unfortunate people at http://ubuntuforums.org/showthread.php?t=625493). Do they sit there as Processing for ages and then switch to Held? If you have the same problem I had the solution I tried may work for you too. Firstly, check your cups error log:

sudo gedit /var/log/cups/error_log

If you see anything like the following, the solution may be simple:

[Job 201] Unable to write print data: Broken pipe
PID 13359 (/usr/lib/cups/backend/socket) stopped with status 1!

System > Administration > Printing and right click on your printer, selecting Properties. Settings > Device URI
If you see something like socket://your_printer_ip_address:9100 just change socket to lpd and remove the :9100 off the end. Then click on apply.

Apparently lpd is a more modern protocol which works with most printers whereas socket is more raw (and potentially faster but riskier in a network situation). Somewhere along the line, the default Ubuntu/Gnome setup for networked printers shifted from lpd to socket. Some primitive printers will have benefited whereas a larger number of more modern printers will have suffered.

Please correct me if I am wrong (which is highly possible) but the underlying problem could be that socket may make the printer wait a long time for a large file to be processed ready for printing. Some printers, such as the Fuji Xerox DocuPrint C525A, may drop the socket if things take too long to start coming through.

Changing timeout settings might work but lpd is better than socket so it is the preferred solution in any case.

If this works for you, please leave a comment to let others know (ideally with a description of the printer and Ubuntu version). Printer may be relevant if it doesn’t support the direct stream protocol properly. NB I may take a while to let your comment through because of the volume of spam. Sorry about that.

Finally, thanks to sphilli8 for the steer in the right direction at http://ubuntuforums.org/showthread.php?p=6245626.