Bug Description

Binary package hint: libsane

In Feisty, using xsane or Kooka, my Canon Lide25 scanner, which uses the plustek backend, does not produce any scanned image, though both gui applications go through the motions (progress dialogs, etc) and produce a black preview. Using the command line 'scanimage' does produce a scan correctly

Related branches

CVE References

I have a Canon LiDE 25 scanner, woking perfectly with sane-backends-1.0.17. After an upgrade to version 1.0.18 (Gentoo
release 1.0.18-r2), the scanner didn't work anymore; other people also experienced problems with other scanners (seehttp://forums.gentoo.org/viewtopic-t-506227.html -- German).

I am not sure what I can do about this, but I will check the source differences and sane CVS as soon as I find some time (which is quite a problem at the moment).

About the forums thread:
Sorry, but sane-backends 1.0.18 has been in ~x86 since july 2006 and in x86 since september. Since no developer has all the hardware I have to rely on user feedback. This is the first time I am told about such problems with .18.

Additionally the scanner was not recognized by udev and I had to add the following to /etc/udev/rules.d/45-libsane.rules:
# Canon CanoScan N670U/N676U/LiDE20
SYSFS{idVendor}=="04a9", SYSFS{idProduct}=="2220", MODE="664", GROUP="scanner"

From the gentoo bug listed abovehttp://bugs.gentoo.org/show_bug.cgi?id=165315#c3
I compiled a kernel with the 'USB selective suspend/resume and wakeup' disabled, and it does fix this issue in kooka, xsane and xscanimage. The option is marked as experimental

Bug is confirmed in Ubuntu Feisty with a Canon N1240U Scanner. The scanner is recognized when plugged in ("dmesg" and "lsusb" list it correctly), but scanning with any GUI (xsane, gnomescan or from within GIMP) is not possible. Using "scanimage" from the command line works, but even that sometimes needs a kick off by first invoking "sane-find-scanner" and then "scanimage -L". After that, the scanning starts smoothely.

Until the kernel/sane problems are solved I propose a small workaround. Edit the file .bashrc in your home directory and add the following alias (everything on one line, modifications of are up to you):

From now on you can scan an image by simply typing "scan" in the command line. The file will be saved as TIFF with a resolution of 300 dpi as scanned_image to your Desktop. And dont' forget: If it doesn't scan, you have to try "sane-find-scanner" and/or "scanimage -L" first. Good luck!

Here the Scanner works with the original Feisty Herd5 Iso release(kernel 2.6.20-9 without any updates) but stopped working after applying all updates incl. kernel 2.6.20-12. A reboot with the kernel 2.6.20-9 after applying the updates, don't solved the problem.

So i think that the problem is not only caused by that (USB selective suspend/resume) kernel option!

confirmed for Feisty with all updates (29.3.07) or from Live-CD:
Canon N650U doesn't work.
Same machine with edgy works out of the box.
Is anyone working on this?
I need a working scanner more than suspend/resume...

As I was informed, the USB_SUSPEND seems to be needed for many people to be able to suspen/resume their laptops, and there are a *lot* of laptops out there these days. I think it has to be fixed in the sane code, not in the kernel, but there are not enough entries in Sane's bug reports/mailing lists

@Clay Weber: In Debian Etch it works fine and iirc it's even the same xsane version as in ubuntu feisty. So the problem cant be the xsane code! But maybe depends of compilation options or something else.

@ llimaa, as I noted, if you compile a kernel without USB_SUSPEND, it works fine. and as Ubuntu kernel dev Ben Collins also noted, this option is needed for laptop suspend/resume, so either libusb or sane-backends/xsane/kooka/quiteinsane/etc needs to be patched somehow to resolve this. And as i don't see *all* scanners broken, I am guessing this may need to be done for each sane backend (driver) that is exhibiting these issues. Easier than kernel/libusb hacking I am sure.

I have lost the link, but I did find that someone had determined that the scanners were being set to 'sleep' much too quickly so the scanner never even starts, or for those that do, it stops before finishing its path

I'm using backend with no problems in kernel 2.6.20 disabling such
option. Most backends use libusb to establish communitation between device
and PC. Libusb doesn't provide functions to check that condition. May be
I'm wrong but If it's not a kernel problem (USB_SUSPEND is yet experimental)
I think that problem must be fixed in libusb libraries.

I have recompiled the ubuntu feisty kernel disabling the 'USB selective suspend/resume and wakeup' option, but in my case the problem remained. With my HP ScanJet 4070 (hp3900 backend) xsane freezes while triyng to find the device. xscanimage, instead, works if the correct device name is supplied.
I then used strace to see what happens with xsane and found that it was continuosly writing to /dev/parport0:

Finally I found that removing the 'ppdev' kernel module (rmmod ppdev) solved the problem.
This module was not automatically loaded in edgy, but I have read that it has been introduced in feisty to allow automatic detection of parallel printers.
I tried this also for an Epson Perfection 1260 (plustek backend) and it works too.
So maybe that the problem is not the 'USB selective suspend/resume and wakeup' option but the 'ppdev' kernel module.

disabling ppdev didn't help in my case. On my canon LiDE25 9plustek, it does let e get a preview scan (as it would on occasion let me) but the scan head does not return all the way (also as would do when it would actually scan) and on a second scan attempt, it would do the ususal.

What specific command can I run, and where do I look do get strace results for comparison?

Bug still here on a LiDE20 - hopefully this will be fixed (or a workaround found) by release. Feisty supported ALL my hardware nicely up until the last few weeks, unlike Dapper and Edgy, so it's a bit heartbreaking to see another bit of my hardware support dropping away :(

The kernel has gone from 2.6.20-14 to 2.6.20-15, but this regression is still unfixed - like a large number of people I bought this hardware specifically due to its mature support under linux. I don't really understand why experimental suspend/resume functionality for laptops should be allowed to break support for scanners attached to desktop machines - is it not possible for the installer to detect laptop/desktop initially, and install laptop-specific stuff like this (and NetworkManager!) only for laptops?

Workaround to enable GUI tools:
I can use the command line workaround mentioned earlier, but it isn't acceptable for the rest of my family. I have written a short shell script that "prods" the scanner every second and stops after around 15-20 minutes. This enables the standard GUI scanner utitlities (Kooka and so on) to work. Apologies for the quality of the solution, as I am far from a skilled technical type, however I don't think anyone is likely to sort this problem out so close to release.

save the above as "scantouch.sh". Activate the script by typing "sh scantouch.sh" - while the script is running (around 17 minutes max), the GUI scanner utilities can be used. Thanks to this horrible hack, my wife is able to get on with her work, and my ears no longer ring!

Warning: This worked for me, it might not for you, it might not be safe, there are surely better ways of doing this.

I also have some problems with Mustek BearPaw 1200 when using sane-backends-1.0.18. The obtained image looks overexposed - I suspect that there are problems with calibration. Downgrading to sane-backends-1.0.17 solves this problem.

you can do a preview and a full scan in e.g. kooka, but usually only one time. When it stops working, the scanning application has to be restarted. Looks like the backend or libusb cannot keep the device awake long enough.

On Sun, 2007-10-28 at 02:13 +0000, huffy318 wrote:
> After upgrading to 7.10 Gutsy, I no longer need to run the kernel that
> had no suspend compiled in it. My scanner is working fine.
>
> After the initial post-upgrade restart, it did take awhile for the 1st
> preview to run after xsane was started. If xsane was left running,
> subsequent previews were as fast as usual.
>
> Now that I shutdown and restarted, the scanner works as expected.
>
> Eric
>

>From some bug report I got the impression, that this bug was actually
the reason for bug #88746. Is this the case?

I don't have this device. You should get in contact with Seagate
support. They have investigated the problem.

On Sun, 2007-12-09 at 09:42 +0000, fishor wrote:
> 1. this is not a bug.
> 2. this report is used to collect information about usb devices which claim to support usb-suspend but do not do it correctly.
>
> do you have this device?
> if yes, please report lsusb and demsg about it.
>

This bug was marked "Fix Released" against the 2.6.22 Gutsy kernel. Just adding a note that the 2.6.20 Feisty kernel task is being closed as this does not qualify for a stable release update - https://wiki.ubuntu.com/StableReleaseUpdates . If anyone is still experiencing issues, please test against the latest Hardy Heron 8.04 Beta release and open a new bug report if the issue still exists: http://www.ubuntu.com/testing. Unfortunately, sifting through 450+ comments and 17 duplicate bug reports it not exactly easy on the development teams trying to resolve any remaining outstanding issues. Thanks.

Unfortunately Hewlett-Packard ScanJet 7400c also is affected by this bug.
I tried sane-backends-1.0.19 and my scanner was not working at all. I recompiled kernel without USB suspend support and still no go.
Downgraded to 1.0.17 and everything started to work.
With 1.0.18-r6 it's starts to scan but hangs in middle of A4 sheet.

I don't when the variable was first introduced but for canon lide25,
SANE_BACKENDS should be setted to plustek and not canon in make.conf
sane-find-scanner look for the sane db so no problem but scanimage -L needs the correct backend to be available to test the device.
This solved the problem for me.

Per a decision made by the Ubuntu Kernel Team, bugs will longer be assigned to the ubuntu-kernel-team in Launchpad as part of the bug triage process. The ubuntu-kernel-team is being unassigned from this bug report. Refer to https://wiki.ubuntu.com/KernelTeamBugPolicies for more information. Thanks.

I have the same problem on my Hardy (2.6.27-7-generic). My scanner (UMAX, forgot the type) at home works perfectly without any hassles of scanning any document.

But I'm now outside my hometown and I have to scan some pictures for my homework. Here, there is an EPSON Perfection 660. Because no drivers released for Windows Vista for this model, I have been trying to use my hardy.

I just plugged it into one of my USB socket in my laptop. At first, it was unable to access the scanner at all so I installed the firmware file to "/usr/share/sane/snapscan" and input the firmware file location to the config file in "/etc/sane.d/snapscan.conf".

Then I opened Xsane. It worked fine in a few seconds when I tried to scan a book cover in Xsane, and in several seconds, Xsane was no longer able to access my scanner. I restarted Xsane but now It didn't even able to contact my scanner. Then I restarted my computer for several times and it didn't work at all.

So, I googled around and tried to install scanbuttond: No luck. Using other programs didn't give me any outcome to be able to access my scanner. I have also tried to use the command-line method "scanimage" and it produces the same error as in Xsane.

> Can we consider this bug closed?
>
> --
> some usb_devices fault if usb_suspend enabled
> https://bugs.launchpad.net/bugs/85488
> You received this bug notification because you are a direct subscriber
> of the bug.
>