Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Sep 2009 15:51:58 +0200
From:      "Wojciech A. Koszek" <wkoszek@freebsd.org>
To:        Hans Petter Selasky <hselasky@c2i.net>
Cc:        freebsd-current@freebsd.org, current@freebsd.org
Subject:   Re: [libusb] Problems with USB-based scanner
Message-ID:  <20090913135158.GC82285@FreeBSD.org>
In-Reply-To: <200909131333.25960.hselasky@c2i.net>
References:  <20090913093706.GA82285@FreeBSD.org> <200909131333.25960.hselasky@c2i.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Sep 13, 2009 at 01:33:23PM +0200, Hans Petter Selasky wrote:
> On Sunday 13 September 2009 11:37:06 Wojciech A. Koszek wrote:
> > Hi,
> >
> > Recently, I updated my laptop to the newest sources:
> >
> > 	FreeBSD laptop.freebsd.czest.pl 9.0-CURRENT FreeBSD 9.0-CURRENT #0
> > r197059M: Thu Sep 10 19:08:58 UTC 2009
> >
> > This is the very first time I tried to use my Canon CanoScan 1220u
> > scanner:
> >
> > [..]
> > ugen0.4: <CanoScan Canon> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
> >
> >   bLength = 0x0012
> >   bDescriptorType = 0x0001
> >   bcdUSB = 0x0100
> >   bDeviceClass = 0x0000
> >   bDeviceSubClass = 0x0000
> >   bDeviceProtocol = 0x0000
> >   bMaxPacketSize0 = 0x0008
> >   idVendor = 0x04a9
> >   idProduct = 0x2207
> >   bcdDevice = 0x0100
> >   iManufacturer = 0x0040  <Canon>
> >   iProduct = 0x004d  <CanoScan>
> >   iSerialNumber = 0x0000  <no string>
> >   bNumConfigurations = 0x0001
> >
> > since uscanner(4) removal. It worked without a problem with
> > the old driver and I could use scanimage(8) with no effort:
> >
> > 	http://freebsd.czest.pl/~wkoszek/wlog/0/
> >
> > Right now I'm getting segmentation fault from plustek driver (and pretty
> > much any other driver, if I comment "plustek" in dll.conf and add necessary
> > quirk to other driver):
> 
> Hi,
> 
> This is a fault in the plustek driver, because it does not refresh the device 
> pointer after a USB-rescan!
> 
> /usr/ports/graphics/sane-backends/work/sane-backends-1.0.20/sanei
> 
> Try the following patch:
> 
> --- sanei_usb.c.orig    2009-09-13 13:27:29.000000000 +0200
> +++ sanei_usb.c 2009-09-13 13:29:32.000000000 +0200
> @@ -337,6 +337,16 @@
>         && devices[i].vendor == device.vendor
>         && devices[i].product == device.product)
>         {
> +         /* 
> +          * Need to update the LibUSB device pointer, hence it might
> +          * have changed after the latest USB scan.
> +          */
> +#ifdef HAVE_LIBUSB
> +         devices[i].libusb_device = device.libusb_device;
> +#endif
> +#ifdef HAVE_LIBUSB_1_0
> +         devices[i].lu_device = device.lu_device;
> +#endif
>            devices[i].missing=0;
>           DBG (3, "store_device: not storing device %s\n", device.devname);
>           return;
> 
> If it works, are you able to get this patch committed to the SANE project?
> 

It seems to fix my problem. Thanks.

I'll write a post to sane-devel@ and provide links to this report.

-- 
Wojciech A. Koszek
wkoszek@FreeBSD.org
http://FreeBSD.czest.pl/~wkoszek/



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