Scanimage/usbfs device IO error with Canon MP700 scanner

Bug #313504 reported by Markus Kilås
72
This bug affects 12 people
Affects Status Importance Assigned to Milestone
sane-backends (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Scanimage fails:

$ scanimage
P6
# SANE data follows
638 877
255
scanimage: sane_read: Error during device I/O

In dmesg:
[22955.082523] usb 1-1.2: usbfs: interface 0 claimed by usblp while 'scanimage' sets config #1
[22956.440402] usb 1-1.2: usbfs: interface 0 claimed by usblp while 'scanimage' sets config #1
[22956.442197] usb 1-1.2: usbfs: interface 0 claimed by usblp while 'scanimage' sets config #1
[22956.656083] usb 1-1.2: usbfs: process 13214 (scanimage) did not claim interface 0 before use
[22956.657216] usb 1-1.2: usbfs: process 13214 (scanimage) did not claim interface 0 before use

Ubuntu: 8.10
libsane: 1.0.19-6ubuntu1
sane-utils: 1.0.19-6ubuntu1
xsane: 0.995-3ubuntu2

$ scanimage -L & lsusb
Bus 002 Device 002: ID 04d9:a015 Holtek Semiconductor, Inc.
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 006: ID 04a9:2630 Canon, Inc. MultiPASS MP700
Bus 001 Device 005: ID 05a9:a518 OmniVision Technologies, Inc. D-Link DSB-C310 WebCam
Bus 001 Device 004: ID 07b8:e004 D-Link Corp. Mass Storage Device
Bus 001 Device 002: ID 0409:0058 NEC Corp. HighSpeed Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
device `pixma:04A92630_00000001D372' is a CANON Canon MultiPASS MP700 multi-function peripheral

Revision history for this message
Flo (doc-nice) wrote :

This problem is occuring with any multi function usb device that supports [scanning and [printing or cardreader] ].

The problem is that the usblp and/or usb_storage kernel modules claim the usb device (at least de sub-intrefaces for printing/usb storage).

The sane usb backends seem to try to claim the whole usb device, but this is rejected as the "other" interfaces are already claimed.
There seems to be a workaround in sane 1.0.17-1 that ignored the EBUSY state of the usb device, which worked for most devices.
Somehow this seems to be broken in the newer versions.

One solution to use the scanner is to do "modprobe -r usblp" and "modprobe -r usb_storage" before scanning and re-insert the modules using "modprobe usblp; modprobe usb_storage" afterwards but this seems no practical way to work...

You may try to downgrade the sane packages to 1.0.17-1 (some websites show that 1.0.18 also works) and try with these.

I have the same issue with a Debian system and a Brother MFC-215C, having scanner, card reader, printer and fax function.

I will try this downgrade fix next week and report back.

Revision history for this message
Jeff Fortin Tam (kiddo) wrote :

Ew, I tried the modprobe trick, and even after re-modprobing (and usblp and usb_storage are indeed listed in lsmod currently), now I can't use the scanner: it gives an error about invalid argument or something.

Revision history for this message
Jeff Fortin Tam (kiddo) wrote :

Well, I was ready to panic, but then I just removed the settings in ~/.sane/xsane and now it works without any problems. No i/o or arguments error.

That sneaky bastard.

Revision history for this message
Guillaume Millet (guimillet) wrote :

The version 1.0.17-1 does not contain libsane-pixma. I have the same problem with a Canon MP360. I did not succeed to scan with modprobe trick. I still have "usbfs: process 3022 (scanimage) did not claim interface 0 before use" messages.
The only way I succeeded with is to use the version from http://home.arcor.de/wittawat/pixma/

Revision history for this message
Guillaume Millet (guimillet) wrote :

And the problem continues with the 1.0.20-4ubuntu2 version in Karmic.

Revision history for this message
Michiel Eghuizen (michieleghuizen) wrote :

Same problem here with a Brother DCP-7010 USB scanner. Although, I'm using the latest Debian unstable version and not Ubuntu. But because I know Ubuntu is using Debian packages, I would say it here as well.

Version: 1.0.20-6

Revision history for this message
Michiel Eghuizen (michieleghuizen) wrote :

I still have the same problem in Karmic.

I have found a kind of solution, but I'm not sure if it even solves the problem:

I added the module 'usblp' to the file /etc/modprobe.d/blacklist.conf
  blacklist usblp

And added the device to the following udev rules file /lib/udev/rules.d/40-libsane.rules
  # Brother scanners
  ATTRS{idVendor}=="04f9", ENV{libsane_matched}="yes"
  # Brother DCP-7010
  ATTRS{idVendor}=="04f9", ATTRS{idProduct}=="0182", ENV{libsane_matched}="yes"

Revision history for this message
Flo (doc-nice) wrote :

It does solve the scanning of course, but without usblp, you will not be able to print any more, do you?

Jean-François Fortin Tam mentioned removing the sane-user-config, maybe that helps you, too?
BTW. Jean-François, you'd have had to scan without usblp inserted, not after re-modprobing it, I think that was the problem in your first post...

I cannot test any more as I no longer work in that company having this problem... :D

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in sane-backends (Ubuntu):
status: New → Confirmed
Revision history for this message
Rolf Leggewie (r0lf) wrote :

Is this still an issue in precise or later?

Changed in sane-backends (Ubuntu):
assignee: nobody → Rolf Leggewie (r0lf)
status: Confirmed → Incomplete
Revision history for this message
haad (haaaad) wrote :

I can reproduce it on 12.04 with canon Lide 110

[ 364.611751] usb 3-1: usbfs: interface 0 claimed by usbfs while 'scanimage' sets config #1
[ 364.612466] usb 3-1: usbfs: interface 0 claimed by usbfs while 'scanimage' sets config #1
[ 365.927848] usb 3-1: usbfs: interface 0 claimed by usbfs while 'scanimage' sets config #1
[ 451.723889] usb 3-1: usbfs: interface 0 claimed by usbfs while 'scanimage' sets config #1
[ 451.724599] usb 3-1: usbfs: interface 0 claimed by usbfs while 'scanimage' sets config #1
[ 453.039928] usb 3-1: usbfs: interface 0 claimed by usbfs while 'scanimage' sets config #1
[ 500.493244] usb 3-1: usbfs: interface 0 claimed by usbfs while 'scanimage' sets config #1
[ 500.494154] usb 3-1: usbfs: interface 0 claimed by usbfs while 'scanimage' sets config #1
[ 501.811636] usb 3-1: usbfs: interface 0 claimed by usbfs while 'scanimage' sets config #1

Revision history for this message
Mikhail Polozov (michpol) wrote :

I have same issue in 12.04 with Canon MF5750

Rolf Leggewie (r0lf)
Changed in sane-backends (Ubuntu):
assignee: Rolf Leggewie (r0lf) → nobody
importance: Undecided → Medium
status: Incomplete → Confirmed
Revision history for this message
David Newman (drdrnewman) wrote :

The problem has reappeared in the latest three Ubuntu kernels, including 3.16.0-31-generic. I can no longer scan.

There seems to have been a change that meant the system started to recognise the card reader in my Canon MP550 printer, so I get messages like:

[ 386.757298] usb 2-1.5: SerialNumber: 14E912
[ 386.759466] usb-storage 2-1.5:1.2: USB Mass Storage device detected
[ 386.760192] scsi17 : usb-storage 2-1.5:1.2
[ 386.790059] WARNING! power/level is deprecated; use power/control instead
[ 387.774767] scsi 17:0:0:0: Direct-Access Canon MP550 series 0104 PQ: 0 ANSI: 2
[ 387.775169] sd 17:0:0:0: Attached scsi generic sg10 type 0
[ 387.779965] sd 17:0:0:0: [sdi] Attached SCSI removable disk
[ 413.540101] usb 2-1.5: usbfs: interface 2 claimed by usb-storage while 'KSaneIface::Fin' sets config #1
[ 417.598741] usb 2-1.5: usbfs: interface 2 claimed by usb-storage while 'skanlite' sets config #1
[ 418.123578] usb 2-1.5: usbfs: interface 2 claimed by usb-storage while 'skanlite' sets config #1

I blacklisted usblp, as CUPS no longer needs it, so I can print. But when I tried to blacklist usb-storage, it was ignored.

In any case, I do use other usb-storage devices.

Is there a way to tell Ubuntu to ignore the card slot inside the printer, so not use usb-storage?

Revision history for this message
penalvch (penalvch) wrote :

Markus Kilås, thank you for reporting this and helping make Ubuntu better.

As per https://wiki.ubuntu.com/Releases 8.10 is EOL.

If you have an issue in a supported release (ex. 16.04) please file a new report, and feel free to subscribe me to it.

Changed in sane-backends (Ubuntu):
importance: Medium → Undecided
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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