Re: Looking to add support for Avision AV50F plus scanner
Ralph Little <[email protected]> Wed, 4 Sep 2024 11:20:21 -0700
| Newsgroups | gmane.comp.graphics.scanning.sane.devel |
|---|---|
| Message-ID | <CAFNXwePTm6pAK9Un6C-DDF8jFOB3JCqBuq0LJpP3CPkAU2f2fg@mail.gmail.com> |
Hi, On Wed, Sep 4, 2024 at 10:11 AM Ove Laurum <[email protected]> wrote: > Thanks Ralph, > > I found the code on GitLab. Very useful. > > I also managed to add my scanner to the config file > /etc/sane.d/avision.conf > usb 0x0638 0x2b6a > Great. > > I didn't get much of a trace out until I ran it as root, see abbreviated > output below > SANE_DEBUG_AVISION=100 scanimage -L > (I don't think I can use the -d option unless the device is listed with > "scanimage -L") > > When I do: > SANE_DEBUG_AVISION=50 sane-find-scanner > I get no trace, is that because the backend is not involved at this stage? > Yeah, that won't work. sane-find-scanner is not using the SANE API at all. It merely looks for devices that might be scanners. You should use scanimage or another SANE frontend instead. This *should* work once the avision backend knows about your scanner. I *think* that you can use -d avision to pick the first avision device. > > In the trace that I did get, it looks like the backend is opening the > correct device "libusb:001:003" and tries a first command which is > "Inquiry". > It builds the query and tries to write it but fails with error code 9. > > I am running the command as root (not as sudo) so it should not be a > permissions issue unless the backend is run by a different user. > If I run as an unprivileged user then I do not even get this far. In that > case it tries to access the scanner but fails and is not even getting to > the stage of Attaching to the scanner. > Also worth noting is that my Canon LiDE220 works fine with sane, which is > another indicator that it is unlikely a permissions issue. > Permissions are generally handled by udev which has rules based on USB ids to give permissions to non-root users. Just adding the USB ids to the backend will not be sufficient. You *could* add the USB ids to a udev file such as /lib/udev/hwdb.d/20-sane.hwdb followed by running something like *udevadm control --reload-rules* ...as root. This should allow you to connect to the device as a regular scanning user. > > So based on the trace and on the source code it looks like it is: > > - Attaching to the scanner. > - SANE_Status = SANE_STATUS_GOOD in reply to sanei_usb_open > - starts building an inquiry > - tries to send the inquiry > - fails to do sanei_usb_write_bulk > - sanei_usb.c responds with error > > How can I see log entries from sanei_usb.c code? > > I believe SANE_DEBUG_SANEI_USB=5 will give you some info about sanei USB operations. Greater value gives you more info. Cheers, Ralph