Wrong driver for my Canon iP3000

Bug #131990 reported by Patrice Vetsel
10
Affects Status Importance Assigned to Milestone
system-config-printer (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: hal-cups-utils

Under Tribe4 uptodate plugin my printer, hal-cups-utils install it but with
Samsung ML-2250 Foomatic/Postscript driver not available Canon iP3000

here syslog :

Aug 12 15:24:37 satori kernel: [ 624.944000] usb 2-1: new full speed USB device using uhci_hcd and address 2
Aug 12 15:24:37 satori kernel: [ 625.120000] usb 2-1: configuration #1 chosen from 1 choice
Aug 12 15:24:37 satori NetworkManager: <debug> [1186925077.655897] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_4a9_1094_220C45').
Aug 12 15:24:38 satori kernel: [ 625.520000] /build/buildd/linux-source-2.6.22-2.6.22/drivers/usb/class/usblp.c: usblp0: USB Bidirectional printer dev 2 if 0 alt 0 proto 2 vid 0x04A9 pid 0x1094
Aug 12 15:24:38 satori kernel: [ 625.520000] usbcore: registered new interface driver usblp
Aug 12 15:24:38 satori kernel: [ 625.524000] /build/buildd/linux-source-2.6.22-2.6.22/drivers/usb/class/usblp.c: v0.13: USB Printer Device Class driver
Aug 12 15:24:38 satori NetworkManager: <debug> [1186925078.040870] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_4a9_1094_220C45_if0').
Aug 12 15:24:38 satori NetworkManager: <debug> [1186925078.219141] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_4a9_1094_220C45_usbraw').
Aug 12 15:24:38 satori hal_lpadmin: add
Aug 12 15:24:38 satori hal_lpadmin: URIs: ['usb://Canon/iP3000', 'hal:///org/freedesktop/Hal/devices/usb_device_4a9_1094_220C45_if0_printer_noserial']
Aug 12 15:24:38 satori hal_lpadmin: HPLIP Fax URIs: None
Aug 12 15:24:38 satori hal_lpadmin: Calling GetReady
Aug 12 15:24:48 satori kernel: [ 635.856000] audit(1186925088.322:9): REJECTING m access to /etc/passwd (whoami(6313) profile /usr/sbin/cupsd active /usr/sbin/cupsd)
Aug 12 15:24:48 satori hal_lpadmin: Added printer iP3000
Aug 12 15:24:48 satori NetworkManager: <debug> [1186925088.676523] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_4a9_1094_220C45_if0_printer_noserial').

Revision history for this message
Patrice Vetsel (vetsel-patrice) wrote :

Is there a way to know useful debug informations (like vendor/modl/ppd detected by h-c-u) when printer is plugged?

Revision history for this message
Tim Waugh (twaugh) wrote :

The PPD will be the one set in /etc/cups/ppd/iP3000.ppd.

Revision history for this message
Patrice Vetsel (vetsel-patrice) wrote :

screenshot of problem

Revision history for this message
Tim Waugh (twaugh) wrote :

Hmm. To get the Device ID string for the printer you can run '/usr/sbin/lpinfo -l -v'.

Revision history for this message
Patrice Vetsel (vetsel-patrice) wrote :

Is it normal to have "redhat" occurences in sources ?!

kagou@satori:~$ cat hal-cups-utils-0.6.11/systemv/hal_lpadmin | grep -i redhat
            obj = bus.get_object("com.redhat.NewPrinterNotification",
                                 "/com/redhat/NewPrinterNotification")
                                          "com.redhat.NewPrinterNotification")
kagou@satori:~$

Revision history for this message
Patrice Vetsel (vetsel-patrice) wrote :

kagou@satori:~$ /usr/sbin/lpinfo -l -v
Matériel : URI = socket
          classe = network
            info = AppSocket/HP JetDirect
   marque/modèle = Unknown
     ID matériel =
Matériel : URI = beh
          classe = network
            info = Backend Error Handler
   marque/modèle = Unknown
     ID matériel =
Matériel : URI = hal:///org/freedesktop/Hal/devices/usb_device_4a9_1094_220C45_if0_printer_noserial
          classe = direct
            info = Canon iP3000
   marque/modèle = Canon iP3000
     ID matériel = MFG:Canon;MDL:iP3000;CLS:PRINTER;
Matériel : URI = usb://Canon/iP3000
          classe = direct
            info = Canon iP3000 USB #1
   marque/modèle = Canon iP3000
     ID matériel = MFG:Canon;CMD:BJL,BJRaster3,BSCCe;SOJ:TXT01;MDL:iP3000;CLS:PRINTER;DES:Canon iP3000;VER:1.09;STA:10;FSI:03;
Matériel : URI = canon:/dev/usb/lp0
          classe = direct
            info = Gutenprint USB Printer #1
   marque/modèle = Canon iP3000
     ID matériel =
Matériel : URI = http
          classe = network
            info = Internet Printing Protocol (http)
   marque/modèle = Unknown
     ID matériel =
Matériel : URI = ipp
          classe = network
            info = Internet Printing Protocol (ipp)
   marque/modèle = Unknown
     ID matériel =
Matériel : URI = lpd
          classe = network
            info = LPD/LPR Host or Printer
   marque/modèle = Unknown
     ID matériel =
Matériel : URI = parallel:/dev/lp0
          classe = direct
            info = LPT #1
   marque/modèle = Unknown
     ID matériel =
Matériel : URI = mfp:/dev/mfp/0
          classe = direct
            info = MFP Parallel Port #0
   marque/modèle = Unknown
     ID matériel =
Matériel : URI = mfp:/dev/mfp/4
          classe = direct
            info = MFP USB Port #0
   marque/modèle = Canon iP3000
     ID matériel =
Matériel : URI = cups-pdf:/
          classe = file
            info = Print into PDF file
   marque/modèle = Generic PDF file generator
     ID matériel = MFG:Generic;MDL:PDF file generator;DES:Generic PDF file generator;CLS:PRINTER;CMD:POSTSCRIPT;
Matériel : URI = scsi
          classe = direct
            info = SCSI Printer
   marque/modèle = Unknown
     ID matériel =
Matériel : URI = smb
          classe = network
            info = Windows Printer via SAMBA
   marque/modèle = Unknown
     ID matériel =
kagou@satori:~$

Revision history for this message
Tim Waugh (twaugh) wrote :

"com.redhat.NewPrinterNotification" is the D-Bus interface name.

Try this:

cd /usr/share/system-config-printer
python -c 'import cups, ppds;c=cups.Connection();a=c.getPPDs();p=ppds.PPDs(a);print p.getPPDNameFromDeviceID("Canon","iP3000","Canon iP3000")'

You can try changing ppds.py to set 'debugging' to True on line 28; perhaps that will show us why the wrong driver is being chosen.

Revision history for this message
Patrice Vetsel (vetsel-patrice) wrote :

kagou@satori:~$ cd /usr/share/system-config-printer
kagou@satori:/usr/share/system-config-printer$ python -c 'import cups, ppds;c=cups.Connection();a=c.getPPDs();p=ppds.PPDs(a);print p.getPPDNameFromDeviceID("Canon","iP3000","Canon iP3000")'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/share/system-config-printer/ppds.py", line 309, in getPPDNameFromDeviceID
    if uri.startswith ("hp:") or uri.startswith ("hpfax:"):
AttributeError: 'NoneType' object has no attribute 'startswith'
kagou@satori:/usr/share/system-config-printer$

Revision history for this message
Tim Waugh (twaugh) wrote :

I fixed that in SVN earlier today. :-/ Try this, it will work around that problem:

python -c 'import cups, ppds;c=cups.Connection();a=c.getPPDs();p=ppds.PPDs(a);print p.getPPDNameFromDeviceID("Canon","iP3000","Canon iP3000",uri='foo')'

Revision history for this message
Patrice Vetsel (vetsel-patrice) wrote :

hal-cups-utils 0.6.11-0ubuntu3
s-c-p 0.7.71+-svn1399-0ubuntu1
cupsys 1.3.0-2ubuntu1

kagou@satori:~$ cd /usr/share/system-config-printer/
kagou@satori:/usr/share/system-config-printer$ python -c 'import cups, ppds;c=cups.Connection();a=c.getPPDs();p=ppds.PPDs(a);print p.getPPDNameFromDeviceID("Canon","iP3000","Canon iP3000",uri='foo')'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'foo' is not defined
kagou@satori:/usr/share/system-config-printer$

Revision history for this message
Tim Waugh (twaugh) wrote :

Sorry, put double-quotes around foo instead of single quotes, so it's like: …,uri="foo")'

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

I get the following:

------------------------------------
till@till-laptop:~/printing/system-config-printer/system-config-printer$ cd /usr/share/system-config-printer/
till@till-laptop:/usr/share/system-config-printer$ python -c 'import cups, ppds;c=cups.Connection();a=c.getPPDs();p=ppds.PPDs(a);print p.getPPDNameFromDeviceID("Canon","iP3000","Canon iP3000",uri="foo")'
No ID match for device foo:
  <manufacturer>Canon</manufacturer>
  <model>iP3000</model>
  <description>Canon iP3000</description>
  <commandset></commandset>
Using hpijs/HP/HP-LaserJet_1220-hpijs.ppd
(3, 'hpijs/HP/HP-LaserJet_1220-hpijs.ppd')
till@till-laptop:/usr/share/system-config-printer$
------------------------------------

It seems that when entering any unknown printer model always the PPD hpijs/HP/HP-LaserJet_1220-hpijs.ppd gets auto-selected. Should it not better be the Generic PostScript printer or the Generic text-only printer?

Revision history for this message
Patrice Vetsel (vetsel-patrice) wrote :

@Tim: oh that's right ! I get different than Till (it's strange …). For Till it's hpijs and for me it's Samsung.

I should say that Canon iP3000 driver is available on the system.

kagou@satori:~$ cd /usr/share/system-config-printer/kagou@satori:/usr/share/system-config-printer$ python -c 'import cups, ppds;c=cups.Connection();a=c.getPPDs();p=ppds.PPDs(a);print p.getPPDNameFromDeviceID("Canon","iP3000","Canon iP3000",uri="foo")'
No ID match for device foo:
  <manufacturer>Canon</manufacturer>
  <model>iP3000</model>
  <description>Canon iP3000</description>
  <commandset></commandset>
Using foomatic:Samsung-ML-2250-Postscript.ppd
(3, 'foomatic:Samsung-ML-2250-Postscript.ppd')
kagou@satori:/usr/share/system-config-printer$

Revision history for this message
Patrice Vetsel (vetsel-patrice) wrote :

kagou@satori:/usr/share/system-config-printer$ lpinfo -m | grep -i ip3000
gutenprint.5.0://bjc-PIXMA-iP3000/expert/C Canon PIXMA iP3000 - CUPS+Gutenprint v5.0.1
gutenprint.5.0://bjc-PIXMA-iP3000/simple/C Canon PIXMA iP3000 - CUPS+Gutenprint v5.0.1 Simplified
kagou@satori:/usr/share/system-config-printer$

Revision history for this message
Patrice Vetsel (vetsel-patrice) wrote :

I'm thinking that in module the complete name is with a "PIXMA" included.
lpinfo do not report "Canon iP3000" but "Canon PIXMA iP3000" may be it's the cause ?!…

Revision history for this message
Tim Waugh (twaugh) wrote :

Okay, I think I see the problem. If you run this command (the same as before but with debugging) I think it will become apparent:

cd /usr/share/system-config-printer/kagou@satori:/usr/share/system-config-printer$ python -c 'import cups, ppds;ppds.debugging=True;c=cups.Connection();a=c.getPPDs();p=ppds.PPDs(a);print p.getPPDNameFromDeviceID("Canon","iP3000","Canon iP3000",uri="foo")'

You don't seem to have a textonly.ppd file where CUPS can see it. I've committed a change to fall back to postscript.ppd in this case.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

I have run the command now.

With the current cupsys package of Ubuntu the textonly.ppd gets installed. Problem is that the current system-config-printer needs an absolute path in /usr/share/system-config-printer/ppds.py to find the file (patch attached).

My suggestion to make it working with any distro without patching is to put some search functionality here, so that simply a textonly.ppd is selected, with any path. If there is no textonly.ppd as postscript.ppd should get selected.

Revision history for this message
Tim Waugh (twaugh) wrote :

Oh, we'll select it with the name "Text-Only printer" then. I've checked that in.

I've also checked in a smarter last-resort algorithm for model name matching. See if it gets your iP3000 now.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

I have checked in now an improvement that textonly.ppd and postscript.ppd will be found without needing an absolute path in ppds.py. So the distro can place these files wherever CUPS finds them.

The correct PPD for the ip3000 gets selected for me now.

What is still not working correctly is the interactive selection in system-config-printer. If I select an unknown or unsupported printer on the fiurst screen on the second screen "Generic" gets correctly chosen, but on the third simply the first entry of the list ("ESC/P Dot Matrix Printer") is chosen and not the text-only printer.

Changed in hal-cups-utils:
status: New → In Progress
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Note that according to the console output the textonly.ppd is correctly selected also if using the interactive wizard, only the cursor in the lists is not set to the correct position.

I have moved this bug to system-config-printer, as we have fixed it by editing /usr/share/system-config-printer/ppds.py which belongs to system-config-printer.

Changed in system-config-printer:
status: In Progress → Fix Committed
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

system-config-printer (0.7.71+-svn1410-0ubuntu1) gutsy; urgency=low

  * New upstream release
     o Subversion snapshot r1410
     o Allow textonly.ppd and postscript.ppd (for fallback on
       unknown printer models) to be at any arbitrary place in the PPD
       file directories
     o Fall back to postscript.ppd if no textonly.ppd is available.
     o If no match is found at all, try searching for the model ID word,
       with decreasing significant figures (fixes LP: #131990).

 -- Till Kamppeter <email address hidden> Thu, 16 Aug 2007 17:05:09 +0100

Changed in system-config-printer:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.