[sane-devel] Any love for Mac OS 10.15 (Catalina) and a PIXMA-scanner (Canoscan 8800F)?

Ola Andersson ola.andersson at ymail.com
Mon Aug 17 12:34:45 BST 2020


 Hello everyone and especially Olaf
Thank you Olaf very much for your detailed reply. I'm sorry I havent replied sooner, but work has gotten in the way.
First: Scanner is connected and on, of course.

I did try your suggestion in issuing this command (with and without sudo):


SANE_DEBUG_PIXMA=127 scanimage -o out.pnm 2> out.log


And this is the output. 




[12:55:14.510854] [sanei_debug] Setting debug level of pixma to 127.

[12:55:14.511250] [pixma] pixma is compiled without pthread support.

[12:55:14.524624] [pixma] pixma version 0.27.0

[12:55:14.526495] [pixma] pixma_collect_devices() found Canoscan 8800F at libusb:020:009

[12:55:14.528125] [pixma] WARNING:No serial number

[12:55:14.528458] [pixma] pixma_find_scanners() found 1 devices

[12:55:19.429646] [pixma] pixma_collect_devices() found Canoscan 8800F at libusb:020:009

[12:55:19.430281] [pixma] WARNING:No serial number

[12:55:19.430551] [pixma] pixma_open(): Canoscan 8800F

[12:55:19.431110] [pixma] OUT  T=4.906 len=16

[12:55:19.431136] [pixma]  00000000:ef 20 00 00 00 00 00 00  00 00 00 00 00 00 00 00 

[12:55:19.431149] [pixma] 

[12:55:19.448351] [pixma] IN   T=4.923 len=8

[12:55:19.448400] [pixma]  00000000:06 06 00 00 00 00 00 00  

[12:55:19.448416] [pixma] 

[12:55:19.449773] [pixma] Reader task id=5971 (forked)

[12:55:19.450149] [pixma] Reader task started

[12:55:19.450442] [pixma] 

[12:55:19.450601] [pixma] pixma_scan(): start

[12:55:19.450743] [pixma]   line_size=1914 image_size=1678578 channels=3 depth=8

[12:55:19.450880] [pixma]   dpi=75x75 offset=(0,0) dimension=638x877

[12:55:19.451017] [pixma]   gamma_table=0x7fdf82818a40 source=0

[12:55:19.451154] [pixma]   threshold=127 threshold_curve=0

[12:55:19.451289] [pixma]   adf-wait=0

[12:55:19.451424] [pixma]   ADF page count: 0

[12:55:19.451654] [pixma] WARNING:pixma_write(): count(0) != len(16)

[12:55:19.451802] [pixma] OUT  T=4.927 len=-1

[12:55:19.452080] [pixma]  00000000:db 20 00 00 00 00 00 00  00 00 00 00 00 00 00 00 

[12:55:19.452222] [pixma]   ERROR: EIO

[12:55:19.452358] [pixma] 

[12:55:19.452500] [pixma] WARNING:pixma_write(): count(0) != len(16)

[12:55:19.452756] [pixma] OUT  T=4.928 len=-1

[12:55:19.452915] [pixma]  00000000:ef 20 00 00 00 00 00 00  00 00 00 00 00 00 00 00 

[12:55:19.453065] [pixma]   ERROR: EIO

[12:55:19.453215] [pixma] 

[12:55:19.453365] [pixma] WARNING:abort_session() failed -1

[12:55:19.453519] [pixma] pixma_scan() failed EIO

[12:55:19.453708] [pixma] read_image():reader task closed the pipe:0 bytes received, 1678578 bytes expected

[12:55:19.453674] [pixma] Reader task terminated: EIO

scanimage: sane_read: Error during device I/O

[12:55:19.454557] [pixma] pixma_close(): Canoscan 8800F


The difference to the log in my previous mail and above is almost none. This first line from the previous mail is missing now: "Output format is not set, using pnm as a default."Debug level was 21 is now 127. The rest is pretty much idential (the usb-scanner was no 010, now 009, the numbers next to T are slightly different). 
Also, checked if I have a .sane folder in my users home folder. I do, and the contents are:


xsane




    batch-lists



    CANON/Canoscan8800f.drc



    xsane.mdf



    xsane.,rc



The permissions are these: 



ola at c-f44ce655 .sane % ls -le



total 0



drwxrwx---  7 root  staff  224 17 Aug 12:58 xsane



And: 



ola at c-f44ce655 xsane % Ls -le



total 64



-rw-rw----  1 ola   staff  16313 22 Jul 15:59 CANON:Canoscan8800F.drc



drwxrwx---  2 ola   staff     64  8 Jul 20:00 batch-lists



-rw-------  1 ola   staff   4256 22 Jul 15:59 xsane.mdf



-rw-------  1 root  staff   5206  8 Jul 19:59 xsane.rc



The folder batch-lists is empty.
Regarding permissions:I have earlier given the app Terminal (the CLI-program/command-prompt in Mac OS) access permission to entire disc. That is the new permission-features I was talking about.
The process to do that is pretty much this: https://www.wikihow.com/Give-System-Permissions-for-Apps-on-MacOS-Catalina
There is no option to give terminal and other software access to USB-devices seperatly, so I'm thinking since the scanner is found, this would not be the issue?

Also tried:Giving read/write-access to the folder .sane in my home-folder, recursive. Mening everything in it is writable by everyone.
Then tried the command 
Packagemanager BrewIf anyone is interested, the packagemanager Brew, and their package of sane-backends is here:https://formulae.brew.sh/formula/sane-backends#default
The code for the packagemanager (what it installs and where) is on github here (written in ruby):https://github.com/Homebrew/homebrew-core/blob/master/Formula/sane-backends.rb
It seems to download the sane-backends official repo from Github. So no difference there.
Anything else to try/check?
If you or anyone have any more suggestions to check, I'm happy to keep trying making this work.
/Ola






    Den söndag 26 juli 2020 14:04:12 CEST, Olaf Meeuwissen <paddy-hack at member.fsf.org> skrev:  
 
 Hi Ola,

There aren't too many Mac users out here so don't hold your breath.  Not
a Mac user myself but I'll try to help anyway.

TL;DR: Ask the folks who maintain the sane-backends brew packages.

Apologies for re-organizing your post a bit.  I just find it easier to
reply when the significant bits of the logs are inlined.

Ola Andersson via sane-devel writes:

> I would really like to get my old Canoscan 8800F to work with my
> MacMini Mac OS 10.15.6 Catalina (latest) and when I discovered
> SANE-Project I was initally very happy since my scanner was on the
> list of supported devices.
> Several days later after trying a bunch of different things, the
> scanimage command, or XSANE GUI, it just doesn't work. Any help is
> appreciated!
> Below is a list of what I have tried, but I suspect this is some form
> of permission problem with Mac OS >10.13, that has a new security
> model. For instance developer need to place their software outside of
> protected folders that are usually available on other OS's. Also as a
> user you sometimes need to give apps access to folders, disk and other
> things in the Security control panel. Another thing could be something
> strange in the USB-communication, or that maybe the OS is marking the
> scanner as busy with for some reason ( I have no way of finding that
> out). But theese are just guesses.
> Things I did:
>
>    - Installed sane-backends using Brew. Brew is a package manager for
>    Mac OS that also installs any other library that is needed, and it
>    is regularly updated. This particualar package has support for Mac
>    OS 10.15, and installs sane 1.0.30, the very latest version. Source
>    is available at Github and the link to Brew shows what other
>    libraries are installed. libusb for instance.

If you really think it's an issue with changes to the Mac OS security
model, I think you'd be better of talking to the folks that provide the
brew packages for sane-backends.  They are sure to be more knowledgeable
in that area.  Most of us hanging out here are using Linux ...

>    - Some commands work now:
>
>    - man sane
>    - man sane-pixma (In the list of supported scanners are my scanner,
>    Canoscan 8800F.)
>    - sane-find-scanner (output pasted below)
>    - sane-find-scanner -v -v (This gives very detailed output about
>    all connected USB-devices, incl my Caonscan 8800F , with same
>    manufacturer and model ID, but not serial number) as the next
>    command.
>    - scanimage -L (gives this output: "device `pixma:04A91901' is a
>    CANON Canoscan 8800F multi-function peripheral

OK, at least scanimage is able to find your device.  That's good news.

>    - This command doesn't work:
>
>    $ scanimage --format="jpeg" --progress --output-file="scan1.jpg" \
>    --resolution="600" --mode="color" --source="Flatbed" \
>    --button-controlled="no"
>    scanimage: sane_read: Error during device I/O
>
>    - Same result with sudo ifront. Dunno why.

If you get the same results with sudo preprended, it's unlikely to be a
permissions issue but then again I don't know anything about how Mac OS
handles read/write access to the device.

However, there may be something with the set of options you pass.  Have
you tried scanning with the defaults?  That is, have you tried

  SANE_DEBUG_PIXMA=127 scanimage -o out.pnm 2> out.log

and also with sudo in front.
and does that produce a good image in out.pnm?  If not, we're interested
in the out.log file.  Oh, you already included that below.  Good!

>    - Installed XSANE(also installed withBrew).
>
>    - Tried scanning with this program, and I get this error message:
>    "Could not create file: Permission denied.

I *think* that's xsane not being able to create its "state" files below
$HOME/.sane/xsane/ (or the $HOME/.sane/xsane directory itself).  Does
that directory exist?  Does it have a xsane.rc and/or xsane.mdf and/or a
*.drc file that matches your device?

>    - I click Close, and get to the gui, click the button "Get preview"
>    and get the error message:"Error during reading: Error under unit
>    I/O)".The wording might differ, since my error messages are in
>    swedish.

That's probably the same issue you see when using scanimage.

>    - Tried getting debug-info with these commands
>
>    $ export SANE_DEBUG_PIXMA=21
>    $ scanimage > test.pnm
>    Output format is not set, using pnm as a default.
>    [15:42:34.787160] [sanei_debug] Setting debug level of pixma to 21.
>    [15:42:34.788373] [pixma] pixma is compiled without pthread support.
>    [15:42:34.788782] [pixma] pixma version 0.27.0
>    [15:42:34.791163] [pixma] pixma_collect_devices() found Canoscan 8800F at libusb:020:010
>    [15:42:34.791879] [pixma] WARNING:No serial number
>    [15:42:34.792158] [pixma] pixma_find_scanners() found 1 devices
>    [15:42:39.924269] [pixma] pixma_collect_devices() found Canoscan 8800F at libusb:020:010
>    [15:42:39.925280] [pixma] WARNING:No serial number
>    [15:42:39.925672] [pixma] pixma_open(): Canoscan 8800F
>    [15:42:39.926504] [pixma] OUT T=5.137 len=16
>    [15:42:39.926541] [pixma] 00000000:ef 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>    [15:42:39.926558] [pixma]
>    [15:42:39.943538] [pixma] IN T=5.154 len=8
>    [15:42:39.943584] [pixma] 00000000:06 06 00 00 00 00 00 00
>    [15:42:39.943597] [pixma]
>    [15:42:39.944638] [pixma] Reader task id=11001 (forked)
>    [15:42:39.945097] [pixma] Reader task started
>    [15:42:39.945377] [pixma]
>    [15:42:39.945542] [pixma] pixma_scan(): start
>    [15:42:39.945686] [pixma]  line_size=1914 image_size=1678578 channels=3 depth=8
>    [15:42:39.945826] [pixma]  dpi=75x75 offset=(0,0) dimension=638x877
>    [15:42:39.945965] [pixma]  gamma_table=0x7fb98000ee40 source=0
>    [15:42:39.946103] [pixma]  threshold=127 threshold_curve=0
>    [15:42:39.946242] [pixma]  adf-wait=0
>    [15:42:39.946380] [pixma]  ADF page count: 0
>    [15:42:39.946592] [pixma] WARNING:pixma_write(): count(0) != len(16)

This looks like the pixma backend doesn't have write permissions to the
device file.  I would have expected `sudo` to "fix" this but there may
be other, Mac OS specific, access controls at play.  Again, I guess the
brew folks would be your best bet.  They ought to know much more about
this than this Linux-only user of two decades and counting ;-)

> Output in terminal from command xsane and also trying to get preview.

If scanimage doesn't work for some reason, xsane is almost certainly not
to work for the same reason.

>    - Also tried changing settings in the config-file, and also turned
>    them off again located
>    here:/usr/local/Cellar/sane-backends/1.0.30/etc/sane.d/pixma.conf. Some
>    lines that are now commented out again since they don't seem to
>    matter.
>
>    - # Dunno what the correct name is for this param, but since my
>    scanner is connected with USB, I don't think it is
>    this:bjnp-timeout=5000
>    - pixma-timeout=5000
>    - usb-timeout=5000
>    - timeout=5000
>    - # Turned off networking
>    - networking=no

As long as you are using USB, the above changes have no effect, AFAIK.

>    - # This is a suggestion from man sane-pixma, can't see it makes
>    any difference.
>    - usb 0x04a9 0x1901

This should not be needed for 1.0.30.  The Canoscan8800F has been
supported since sane-backends-1.0.21.

>    - I have also, per suggestion from man sane-pixma tried this command:
>
>    - export SANE_USB_WORKAROUND=1
>    - Which doesn't seem to help, so I have run same with a zero in the
>    end.
>
>    - Lastly I have also tried installing the installers from this
>    page, they don't work either.
>
>    - Mattias Ellert's binary installer packages of sane-backends, the
>    TWAIN SANE interface and related software.
>    - They are very old (over three years) and seems pretty useless,
>    even with Gimp.

Mattias is no longer updating these :-/

>    - Also several restarts, uninstalls and reinstalls.
>    - Tried two usb-cables.

Hope this helps,
--
Olaf Meeuwissen, LPIC-2            FSF Associate Member since 2004-01-27
 GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13  F43E B8A4 A88A F84A 2DD9
 Support Free Software                        https://my.fsf.org/donate
 Join the Free Software Foundation              https://my.fsf.org/join
  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/sane-devel/attachments/20200817/b249014e/attachment-0001.html>


More information about the sane-devel mailing list