[sane-devel] Canon Pixma G2000
Olaf Meeuwissen
paddy-hack at member.fsf.org
Sun Sep 10 03:19:54 UTC 2017
Hi Iam,
Iam Droidzone writes:
> So, with the latest PPA updates, Ubuntu Xenial recognizes my G2000 as a
> scanner. But I'm having the issue where usblp is claiming the device,
> causing this to appear in dmesg, and the scanning jobs just stutter out:
> "usb 1-1.4: usbfs: interface 1 claimed by usblp while 'scangui' sets config
> #1"
This brings back memories. Mind you, they're not particularly good
ones.
> I tried many workarounds including writing C code to release the device
> from usblp as documented here:
> https://bugzilla.redhat.com/show_bug.cgi?id=723696#c2
>
> But usblp releases it and then claims it.
> scanimage does not work from command line, or via xsane or scangearmp2.
The libusb_reset_device() function[1] basically does a disconnect and
reconnect of the device, so usblp claiming it again is not a surprise.
[1]: http://libusb.sourceforge.net/api-1.0/group__dev.html#ga7321bd8dc28e9a20b411bf18e6d0e9aa
> Is there a known resolution?
Not that I'm aware of, but you might try modifying your C code to use
the OS specific kernel related libusb APIs[2] to check for an active
kernel driver and detach or attach it as needs be.
[2]: http://libusb.sourceforge.net/api-1.0/group__dev.html#gab14d11ed6eac7519bb94795659d2c971
That's basically what I ended up doing in the sanei_usb.c code for the
third party epkowa backend way back when. You can find its code at
http://support.epson.net/linux/src/scanner/iscan/iscan_2.30.3-1.tar.gz
in case you're interested.
I notice that there is now also libusb API that lets you automate this.
Cool, might be something for the sane-backends sanei_usb.c code.
Patches welcome ;-)
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