[sane-devel] Using "scanimage" under Gentoo

Bruce Schultz brulzki at gmail.com
Sun Dec 22 03:31:47 GMT 2019

On 2019-12-20 04:37, Dr Rainer Woitok wrote:
> Bruce and All,
> On Tuesday, 2019-12-17 07:07:14 +1000, Bruce Schultz wrote:
>> ...
>> You could try rebuilding the backends with the following command:
>> emerge -av1 =media-gfx/sane-backends-9999
>> That will install git commit 6b7052c4, which should get you pretty close
>> to the same version of the backend that you originally reported working
>> on Ubuntu, which was version 1.0.28+git20190831-xenial0 from the PPA.
> Doesn't work either.   But that is  again 1.0.28,  a version  I possibly
> missed by hair's breadth [1]:
>     $ scanimage -V
>     scanimage (sane-backends) 1.0.28-348-g6b7052c4-dirty; backend version 1.0.28

Just for reference, the version string "1.0.28-348-g6b7052c4-dirty" a 
git version reference which can be broken down as follows
  - 1.0.28 - that is the last git tag referenced before the current 
commit (in this case it's the 1.0.28 release)
  - 348 - the number of commits since the tagged commit
  - g6b7052c4 - 'g' for git; '6b7052c4' is the short version of the 
commit hash
  - dirty - means that the source tree is modified from the git commit; 
in this case, it should be the build patches applied by the ebuild

>     $ scanimage '--batch=.%03d0.png' --batch-increment 1 --batch-print --batch-start 1 --device pixma:MX880_new-host --source 'Automatic Document Feeder' --format png --mode Color --resolution 300 -l 3 -t 0 -x 210 -y 297
>     Scanning infinity pages, incrementing by 1, numbering from 1
>     Scanning page 1
>     Scanned page 1. (scanner status = 5)
>     Scanning page 2
>     scanimage: sane_read: Document feeder out of documents
>     Scanned page 2. (scanner status = 7)
>     Batch terminated, 2 pages scanned
>     $
> [1]: I've again checked my old Ubuntu installation logs and in particul-
>       ar compared them  to the time stamps  of my scanned  "*.pdf" files.
>       Under Ubuntu the last multi-page scan  not using the flatbed appar-
>       ently was on 2019-08-08.
>       I installed sane-backends 0.1.28+git20190810-xenial0  on 2019-08-17
>       due to a routine upgrade.  Even though there are some "*.pdf" files
>       scanned thereafter, these were flatbed scans.  So I honestly cannot
>       tell whether or not this version was able to scan from the ADF und-
>       er Ubuntu.   And the sane-backends 1.0.28+git20190831-xenial0 inst-
>       alled via just another routine upgrade was possibly never ever used
>       at all.
>       The version installed when I did my last successful ADF scans under
>       Ubuntu then has to be 0.1.27+git20190731-xenial0, which I installed
>       on 2019-08-01.
In that case, the 1.0.28 release was tagged on 31 Jul 2019, so I imagine 
that the version you had installed there was effective a pre-release 
version of 1.0.28. You've already tested that version on Gentoo with no 
success, but it is interesting that your initial tests reported scanner 
status 9 (I/O error) versus the later behaviour where it fails with 
scanner status 7 (out of documents); I have no idea what that means, 

Back on 15-Dec, Olaf's provided the following advice:
> > I know about the existence of environment variable "SANE_DEBUG_BJNP" but
> > have no idea what value to set it to  to provide reasonable information.
> > Could someone please guide me?
> Just set it to 127 if you don't know.  The developers should be able to
> slice and dice the result as needed.
I'd suggest that from here, your best way forward is probably to 
re-install back to the latest git version and capture the debug logs.

Also, you might want to consider Louis's earlier suggestion of adding 
'auto_detection=no' to the config file.


More information about the sane-devel mailing list