I loaded Ubuntu 12.04 as a dual boot on a Windows desktop several months ago and, after much fiddling, was able to send a text file to a dumb printer on my parallel port using the “cat Test_File.txt > /dev/lp0” sort of commands, but haven’t been able to figure out how to define the port for use with the printer from within an application. My other printers, all on USB ports, seem to work just fine. All I need to set up a printer is a really plain-vanilla fixed pitch text-only generic driver.
I am still unable to assign this port in the Add Printers app. Although I can select parallel:/dev/lp0 as the device URI, the “Print Test Page” button is still grayed out, and I am unable to use this printer definition from any app (although it shows up as a choice).
I’ve attempted to follow the many pieces of often conflicting advice on the web with no success. Here’s a list of various commands and their results:
cat /etc/modules GIVES:
(I manually added the first two lines per some instructions from the web.)
The command “lspci -vv” gives the following lines about the parallel port adapter card:
Code:
03:07.0 Communication controller: NetMos Technology PCI 1 port parallel adapter (rev 01)
Subsystem: LSI Logic / Symbios Logic Device 0010
Control: I/O+ Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Interrupt: pin A routed to IRQ 3
Region 0: I/O ports at ce00 [size=8]
Region 1: I/O ports at cd00 [size=8]
Region 2: I/O ports at cc00 [size=8]
Region 3: I/O ports at cb00 [size=8]
Region 4: I/O ports at ca00 [size=8]
Region 5: I/O ports at c900 [size=16]
Kernel modules: parport_pc
dmesg | grep parport GIVES
Code:
[ 11.042481] parport 0xce00 (WARNING): CTR: wrote 0x0c, read 0x09
[ 11.042502] parport0: PC-style at 0xce00 [PCSPP,TRISTATE,EPP]
[ 11.478695] lp0: using parport0 (polling).
[19506.637541] parport0: ppdev0 forgot to release port
Me@MyMachine:/usr/lib/cups/backend$ ls -l GIVES
Code:
total 724
-rwxr-xr-x 1 root root 7250 Jul 6 07:16 beh
-rwxr-xr-x 1 root root 138024 Mar 21 2012 bluetooth
-rwx------ 1 root root 27032 Apr 2 17:44 cups-pdf
-rwxr--r-- 1 root root 18976 Aug 20 09:09 dnssd
-rwxr-xr-x 1 root root 18864 Jul 10 03:37 hp
-rwxr-xr-x 1 root root 9042 Jul 10 03:37 hpfax
-rwxr--r-- 1 root root 64736 Aug 20 09:09 http
-rwxr--r-- 1 root root 64736 Aug 20 09:09 https
-rwxr--r-- 1 root root 64736 Aug 20 09:09 ipp
-rwxr--r-- 1 root root 48096 Aug 20 09:09 ipp14
-rwxr--r-- 1 root root 64736 Aug 20 09:09 ipps
-rwxr--r-- 1 root root 43856 Aug 20 09:09 lpd
-rwxr--r-- 1 root root 18976 Aug 20 09:09 mdns
-rwxr-xr-x 1 root root 18824 May 18 03:05 parallel
-rwxr-xr-x 1 root root 14664 May 18 03:05 serial
lrwxrwxrwx 1 root root 21 Sep 8 10:37 smb -> ../../../bin/smbspool
-r-xr-xr-x 1 root root 27296 Aug 20 09:09 snmp
-r-xr-xr-x 1 root root 35536 Aug 20 09:09 socket
-r-xr--r-- 1 root root 31408 Aug 20 09:09 usb
Me@MyMachine:/usr/lib/cups/backend$ lpinfo -v GIVES
Code:
network ipp
network https
network socket
network http
network lpd
network ipp14
network beh
network ipps
direct parallel:/dev/lp0
file cups-pdf:/
network smb
direct usb://HP/Officejet%20Pro%20K5400?serial=MY6CQ1806V
dmesg | grep par GIVES
Code:
[ 11.042481] parport 0xce00 (WARNING): CTR: wrote 0x0c, read 0x09
[ 11.042502] parport0: PC-style at 0xce00 [PCSPP,TRISTATE,EPP]
[ 11.476990] ppdev: user-space parallel port driver
[ 11.478695] lp0: using parport0 (polling).
[19506.637541] parport0: ppdev0 forgot to release port
dmesg | grep ppdev GIVES
Code:
[ 16.603004] ppdev: user-space parallel port driver
The line “parport0: ppdev0 forgot to release port ” seems unusual.
The output of the command lpinfo -v includes the following line:
Code:
direct parallel:/dev/lp0
Running the command sudo /usr/lib/cups/backend/parallel gives the following:
Code:
direct parallel:/dev/lp0 "unknown" "LPT #1" "" ""
I was told by more than one individual that Linux hasn’t supported parallel port printing for quite a few years, but I found that a little difficult to believe given the mention of the port in all of the above outputs. Then finally, I discovered the following URL:
https://lkml.org/lkml/2012/9/1/94 - which states:
Code:
Error handling of parport_register_driver() in ppdev_init()
is broken because it deallocates all resources but still
returns zero.
Currently parport_register_driver() always succeeds.
Nevertheless it is worth to fix the issue.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
---
drivers/char/ppdev.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c
index 3fcf80f..d0d824e 100644
--- a/drivers/char/ppdev.c
+++ b/drivers/char/ppdev.c
@@ -783,7 +783,8 @@ static int __init ppdev_init (void)
err = PTR_ERR(ppdev_class);
goto out_chrdev;
}
- if (parport_register_driver(&pp_driver)) {
+ err = parport_register_driver(&pp_driver);
+ if (err < 0) {
printk (KERN_WARNING CHRDEV ": unable to register with parport\n");
goto out_class;
}
--
1.7.9.5
So, ppdev “deallocates all resources but still returns” an error.
And my machine is reporting that ppdev “forgot to release port.”
Is this actually the problem I have? Is there any way to use a printer in Ubuntu without having to create a text file from an application and then redirecting it to a port?
Any help would be greatly appreciated.