[sane-devel] sane-backend 1.0.27 USB broken on Mac with Homebrew

Olaf Meeuwissen paddy-hack at member.fsf.org
Sat Jul 29 08:12:30 UTC 2017


Hi,

schmo-fu writes:

> Hey Olaf and Yurii,
>
> thank you for your support, there is some progress:
> First i replaced usb-compat- with libusb-dependency in the formula.
> sane-backends compiled, but still no usb-support.
> Then i put »depends_on "pkg-config"« into the formula.

That should allow you to build sane-backends with USB support.  The
backends should be using libusb-1.0 if I understood the libusb formula
Yurii pointed out.

> And here we go:
> [sanei_usb] sanei_usb_init: initializing libusb-1.0

That's libusb-1.0, all right.

> [sanei_usb] sanei_usb_scan_devices: marking existing devices
> [sanei_usb] libusb_scan_devices: Looking for libusb-1.0 devices
> [sanei_usb] libusb_scan_devices: device 0x04a9/0x221c at 038:002 is not
> configured
> [sanei_usb] libusb_scan_devices: found libusb-1.0 device (0x05ac/0x8215)
> interface 0 at libusb:006:003
> [sanei_usb] store_device: add dn 0 with libusb:006:003
>
> Wow! This looked so good, until i realized that the device 0x04a9 "is
> not configured" (and the other one is just the Bluetooth-USB-Controller).
> So »scanimage -L« tells me, that there is still no scanner.
> But this may be an unrelated issue, or isn't it?

It should be unrelated.  I'm assuming that the [sanei_usb] log messages
above were produced by running »scanimage -L«.  Have you tried running
this with root privileges?  That is, something like

  sudo SANE_DEBUG_SANEI_USB=127 scanimage -L

It could be a permissions issue, in which case the above should work
around that.  Another thing you may want to try is replugging the USB
cable (or power-cycle the device) *after* you install 1.0.27 and wait
for a bit, say half a minute to be on the safe side, to let the "dust
settle".

# I know next to nothing about the Mac's (BSD's?) USB support and device
# hotplug handling but normally when you replug or power-cycle, the
# kernel notices and issues a number of events that the OS can react to.
# One of the things the OS could do is change device access permissions.
# These things may take a little time to be dealt with.

On the other hand, it may also be that your device is still getting its
act together.  In that case, you should wait and try again after a
suitable amount of time (30s? 1m?)  Or that the software that wants to
use it, scanimage, should somehow set the USB configuration first, in
which case the code probably needs to be changed.

Another thing to check is whether the genesys.conf file is installed
*and* found by the backend (and that your backend is actually enabled).
For that, something like

  SANE_DEBUG_DLL=127 SANE_DEBUG_GENESYS=127 scanimage -L

should provide some insight.

# Combining with the earlier sudo command, you could run
#
#   sudo SANE_DEBUG_SANEI_USB=127 SANE_DEBUG_DLL=127 \
#        SANE_DEBUG_GENESYS=127 scanimage -L
#
# and paste the debug log somewhere where we can all admire it ;-)

> (The scanner btw. is a CanoScan LiDE 60. Switching back to sane-backends
> 1.0.25 shows this:
> found USB scanner (vendor=0x04a9 [Canon], product=0x221c [CanoScan],
> chip=GL842) at libusb:038:002).

Which is supported by the genesys backend, but isn't this the output of
sane-find-scanner and not »scanimage -L«?  Both programs report *very*
different things.  The former just says whether your device might be a
scanner, irrespective of any SANE support; the latter says whether your
device is usable by SANE under your current configuration settings.

> Ah, here is the log:
> https://gist.github.com/6875017d99847cd4bfa5613f61216306

That only shows the build bits.  Those are fine now.  You have a
run-time issue now.

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



More information about the sane-devel mailing list