Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Sep 2009 15:36:36 +0200
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        freebsd-usb@freebsd.org
Cc:        Daniel O'Connor <doconnor@gsoft.com.au>
Subject:   Re: SANE vs USB scanner on 8.0
Message-ID:  <200909281536.38747.hselasky@c2i.net>
In-Reply-To: <200909282240.53802.doconnor@gsoft.com.au>
References:  <200909282240.53802.doconnor@gsoft.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday 28 September 2009 15:10:52 Daniel O'Connor wrote:
> Hi,
> I'm trying to get a USB scanner to work with FreeBSD 8.0, it did work
> with 7.2 via uscanner.
>
> It's an AcerScan 620U and I have the firmware and
> modified /usr/local/etc/sane.d/snapscan.conf.
>
> sane-find-scanner sees it, eg
> [midget 22:37] ~ >sudo sane-find-scanner  -q
> found USB scanner (vendor=0x04a5 [Color], product=0x2060 [ FlatbedScanner
> 13]) at libusb:/dev/usb:/dev/ugen0.5 found USB scanner (vendor=0x0403
> [FTDI], product=0xee18 [MaxStream PKG-U]) at libusb:/dev/usb:/dev/ugen1.2
>
> I have no idea why the FTDI serial device appears there..
>
> However scanimage -L doesn't show the scanner..
> [midget 22:40] ~ >sudo env SANE_DEBUG_SNAPSCAN=255 scanimage -v -v -L
> [sanei_debug] Setting debug level of snapscan to 255.
> [snapscan] sane_snapscan_init
> [snapscan] sane_snapscan_init: Snapscan backend version 1.4.53
> [snapscan] add_usb_device(libusb:/dev/usb:/dev/ugen0.5)
> [snapscan] add_usb_device: Detected (kind of) an USB device
> [snapscan] snapscani_usb_open(libusb:/dev/usb:/dev/ugen0.5)
> [snapscan] snapscani_mutex_open: could not parse device string: No such
> file or directory [snapscan] snapscani_usb_open: Can't get semaphore
> [snapscan] add_usb_device: error opening device
> libusb:/dev/usb:/dev/ugen0.5: Invalid argument [snapscan]
> sane_snapscan_get_devices (0x7fffffffe200, 0)
>
> No scanners were identified. If you were expecting something different,
> check that the scanner is plugged in, turned on and detected by the
> sane-find-scanner tool (if appropriate). Please read the documentation
> which came with this software (README, FAQ, manpages).
> Calling sane_exit
> [snapscan] sane_snapscan_exit
> scanimage: finished
>
> Anyone have any suggestions?

Hi,

Try this patch:

diff -u ./work/sane-backends-1.0.20/backend/snapscan-mutex.c ./snapscan-
mutex.c
--- ./work/sane-backends-1.0.20/backend/snapscan-mutex.c        2008-03-28 
21:39:02.000000000 +0100
+++ ./snapscan-mutex.c  2009-09-28 15:33:41.000000000 +0200
@@ -130,7 +130,8 @@
            return 0;
        }
 
-       if (sscanf(dev, "libusb:%d:%d", &busnum, &devnum) != 2)
+       if ((sscanf(dev, "libusb:%d:%d", &busnum, &devnum) != 2) &&
+           (sscanf(dev, "libusb:/dev/usb:ugen%d.%d", &busnum, &devnum) != 2))
        {
            DBG (DL_MAJOR_ERROR, "%s: could not parse device string: %s\n", 
me, strerror(errno));
            return 0;

If it works, get the patch sent to the sane developers.

--HPS




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200909281536.38747.hselasky>