1

I installed SANE backend (hardware.sane.enable = true; on NixOS) and tested if my scanner is detected by running scanimage -L (as suggested here https://nixos.wiki/wiki/Scanners).

Interestingly, the first time I run this command, I can see my scanner (and my webcam):

$ scanimage -L
device `xerox_mfp:libusb:001:012' is a Samsung Samsung SCX-3200 Series multi-function peripheral
device `v4l:/dev/video0' is a Noname HP HD Camera virtual device

but the next time I run it, I only see my webcam:

$ scanimage -L
device `v4l:/dev/video0' is a Noname HP HD Camera virtual device

I only have to unplug and replug the USB connection to see it again (only once).

I have tried using simple-scan to scan a document but I get a similar experience (I can see the scanner only if I just plug it in without testing the connection with scanimage -L but in any case, the application doesn't manage to scan even just a page).

I thought it may be the same issue as in https://unix.stackexchange.com/a/191816/115070 so I disabled USB autosuspend using TLP, I can see that it has been taken into account:

$ tlp-stat -u
--- TLP 1.0 --------------------------------------------

+++ USB
Autosuspend         = disabled

but this doesn't help actually.

Update: lsusb

The scanner is always visible with lsusb:

Bus 001 Device 006: ID 04e8:3441 Samsung Electronics Co., Ltd 

Update: sane-find-scanner

The scanner is always visible with sane-find-scanner (in normal mode or in sudo mode):

found USB scanner (vendor=0x04e8 [Samsung Electronics Co., Ltd.], product=0x3441 [SCX-3200 Series]) at libusb:001:005
  # Your USB scanner was (probably) detected. It may or may not be supported by
  # SANE. Try scanimage -L and read the backend's manpage.

Update: permissions

scanimage -L behaves the same in normal and sudo mode. It detects the scanner only the first time after plugging / restarting, including across modes (normal then sudo or sudo then normal).

Update: searching the mailing list and commit history

It really looks like the issue is just that the scanner is unsupported (see https://www.mail-archive.com/[email protected]/msg34458.html in particular). I'm just a bit surprised with the behavior of scanimage -L in this case. It would have been less confusing if it was never detected.

Important update: works on another laptop

It looks like the problem doesn't come from a lack of support after all. I have tested the SANE backend with the same scanner and an older laptop (Dell Latitude E6500). It works perfectly well with scanimage -L and simple-scan.

Given the lack of difference in the way I configured the two laptops, I can only assume that the problem I was having on my first laptop (HP EliteBook Folio 1040 G3 Notebook PC) is a hardware problem.

Zimm i48
  • 611
  • 6
  • 12
  • Is the scanner all the time visible in `lsusb`? – Tomáš Pospíšek Dec 21 '17 at 19:24
  • @TomášPospíšek Sorry for the delay in the answer. Yes, it is. – Zimm i48 Dec 22 '17 at 22:26
  • and if you switch on/off the scanner, then the next `scanimage -L` will see it again? Have a look at the sane mailing list and change log, if maybe there were fixes for your scanner. – Tomáš Pospíšek Dec 22 '17 at 22:29
  • @TomášPospíšek switching on and off allows seeing the scanner again, exactly like unplugging / plugging the USB. I could not find the link to SANE change log or a way to search the mailing list archive. – Zimm i48 Dec 22 '17 at 23:17
  • As root `sane-find-scanner` always find the scanner but `scanimage -L` continues to see it only the first time it is run. – Zimm i48 Dec 22 '17 at 23:19
  • 1
    mailing list: http://www.sane-project.org/mailing-lists.html , git repository, where you can go through the changes: http://www.sane-project.org/cvs.html - also you might want to ask on the mailing list why `sane-find-scanner` is seeing the device but `scanimage -L` is not. – Tomáš Pospíšek Dec 23 '17 at 08:24
  • f.ex. : https://anonscm.debian.org/cgit/sane/sane-backends.git/log/?showmsg=1&qt=grep&q=samsung – Tomáš Pospíšek Dec 23 '17 at 08:26
  • @Zimmi48 I agree with Tomáš, it really seems an upstream issue because `sane-find-scanner` is working. Does `scanimage -L` reports any warning? – David Costa Dec 23 '17 at 10:36
  • @Zimmi48 also, `sudo scanimage -L` is finding it? It could be related to permission like in this case https://unix.stackexchange.com/questions/184367/scanimage-does-not-find-scanner-unless-sudoed-but-shows-up-with-sane-find-scan?rq=1 – David Costa Dec 23 '17 at 10:40
  • Thanks to you two for your help. Turns out the scanner works on another laptop so I suppose the problem is a hardware problem and there is not much that can be done about it (see edit in the question). – Zimm i48 Dec 24 '17 at 19:53
  • Maybe double-check that usb autosuspend is turned off for sure? Eg. with powertop -> tunables. – olejorgenb Dec 25 '17 at 00:22
  • @Zimmi48 if the laptop has a free card slot you can buy another USB controller – David Costa Dec 27 '17 at 19:10
  • @DavidCosta So you're pretty sure the issue is with the USB controller, are you? Anyways, the issue does not bother me enough to do that. Especially, as I have the other laptop where it's working. Thanks again for your help! – Zimm i48 Dec 27 '17 at 19:12

1 Answers1

1

I just had the same problem on Scientific-Linux 6.5 with a Fujitsu Scansnap and sane-backends 1.0.24. I compiled 1.0.25 (i.e. not the most recent one, but I just had that one around) and it solved the problem. No special environment variables needed.

All other tricks recommended here and elsewhere (exchanging the scanner for another specimen of the same type, using another USB cable, using another USB socket on the computer) failed.

  • Thanks, I'll try to test this when I get the opportunity. – Zimm i48 Nov 20 '18 at 18:58
  • If even this fails, it might be a problem with older kernels doing USB2 by emulating it on USB3. The last resort is to install a PCI-USB-card with USB2 only. – Ralf Muschall Nov 22 '18 at 08:52
  • 1
    Btw., 1.0.25 added a feature to work around the problem. In 1.0.27 that feature is disabled by default. To re-enable it, say "export SANE_USB_WORKAROUND=1". – Ralf Muschall Nov 22 '18 at 08:53
  • I'm now on 1.0.27. I confirm that exporting the above environment variable solves the problem. – Zimm i48 Jan 13 '19 at 20:53
  • Appendix for people using saned: add a line "env = SANE_USB_WORKAROUND=1" to the appropriate .conf file in /etc/xinetd.d/. – Ralf Muschall May 23 '19 at 13:33