Am 30.08.2013 19:44, schrieb Ilya V. Ivanchenko: > Hi Wilhelm, > > Thanks! I checked out the code from svn and found the markers without > problems. > > It is first time I reviewed scanbd code, so I got few questions, maybe > you can answer and save me some time.
I hope so ... > > It looks like the backend selection sane vs. scanbuttond is exclusive > (compiled with #ifdef). What I gathered is in sane branch the calling > sequence will be sane_init(), sane_get_devices(). I peeked into sanei > code, and it seems it will call sane_open() from sane_get_devices(). > sane_open() does load firmware for the scanner if it is required (each > sane backend has its own implementation). So my understanding is that > scanbd with sane backend will load the firmware and have no problem. Is > that correct? yes! > Now to the scanbuttonbd backend of scanbd. It looks like it won't call > into sane backends as it has its own backends library. And scanbuttond > backend has no code that loads firmware. As such, the bug of not loading > the firmware is only happens with scanbuttond backend. Am I right? yes! > Now I have to select an appropriate fix for the firmware issue, and my > #1 option is to call sane_get_devices(), even when using scanbuttond > backend which now is exclusive from sane backend. Will that be a > problem? The scanbuttons backends exists only for old scanners / for historical reasons. So, the preferred way is to use sane-backends. Because there are scanbuttond backends for scanners with no sane-backend I don't want to couple scanbuttond and sane together. Therefore I would suggest a generic solution to call an external programm / script in the case a device is inserted / removed. This external programm / script can then load the firmware by any means - even calling simply scanimage if sane is configured correctly. One can aruge that using scanbd/scanbuttond for a scanner with no sane-support is sort of useless in case the buttons should trigger a scan-operation. But there might be other scan-applications than sane ... > If it is, then I don't have an option #2... or better said it > gets very complicated very quickly. > > -- > Ilya > > ------------------------------------------------------------------------ > *From:* Wilhelm <wilhelm.meier at fh-kl.de> > *To:* Ilya V. Ivanchenko <iva2k at yahoo.com> > *Cc:* "w.meier at unix.net" <w.meier at unix.net>; > "sane-devel at lists.alioth.debian.org" <sane-devel at > lists.alioth.debian.org> > *Sent:* Thursday, August 29, 2013 12:33 PM > *Subject:* Re: scanbd daemon does not load firmware > > Am 29.08.2013 16:03, schrieb Ilya V. Ivanchenko: > >> >> 2. When using scanbuttond-backends, fix loading firmware on USB > insert. > >>> > >>> what I could imagine is to fix this problem with a special > >>> shell-callback, when scanbd detects a device inserion / removal. > >> > >>Forgot to say: would you like to write a patch for that? I will provide > >>you with the neccessary info to do that. Shouldn't be too much work ;-) > > > > Not a problem. I'm a software/systems engineer, so I know what I (will > > be) doing. Only I have short window before I leave for a business trip. > > I just marked the code with four place to insert code to start such a > callback: > > // TODO: call the device insertion / removal callback > > (if you use qtcreator you'll quickly find them) > > > I'm looking forward to your patches ;-) > > > > >>> >> 2. When using scanbuttond-backends, fix loading firmware on > USB insert. > >>> > > >>> >what I could imagine is to fix this problem with a special > >>> >shell-callback, when scanbd detects a device inserion / removal. > >>> This is in the nutshell how I patched the problem from udev. > >> > >>yes, but you had to stop / restart the scanbd and that's more a > >>workaround than a solution ... > > > > I agree. > > > > -- > > Ilya > > > -- > Wilhelm > w.meier at unix.net <mailto:w.meier at unix.net> > > -- Wilhelm w.meier at unix.net