<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div><span>Hi Wilhelm,</span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; background-color: transparent; font-style: normal;"><span><br></span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; background-color: transparent; font-style: normal;"><span>Thanks! I checked out the code from svn and found the markers without problems.</span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; background-color: transparent; font-style: normal;"><span><br></span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; background-color: transparent; font-style: normal;"><span>It is first time I reviewed scanbd code, so I got few questions, maybe you can answer
 and save me some time.</span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; background-color: transparent; font-style: normal;"><span><br></span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; background-color: transparent; font-style: normal;"><span>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?</span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif;
 background-color: transparent; font-style: normal;"><span><br></span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; background-color: transparent; font-style: normal;"><span>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. </span><span style="font-size: 10pt;"> </span><span style="font-size: 10pt;">Am I right?</span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; background-color: transparent; font-style: normal;"><span><br></span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; background-color: transparent; font-style: normal;"><span>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? If it is, then I don't have an option #2... or better said it gets very complicated very quickly.</span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; background-color: transparent; font-style: normal;"><span>--</span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; background-color: transparent; font-style: normal;"><span>Ilya</span></div><div><br></div>  <div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"> <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div
 dir="ltr"> <hr size="1">  <font size="2" face="Arial"> <b><span style="font-weight:bold;">From:</span></b> Wilhelm <wilhelm.meier@fh-kl.de><br> <b><span style="font-weight: bold;">To:</span></b> Ilya V. Ivanchenko <iva2k@yahoo.com> <br><b><span style="font-weight: bold;">Cc:</span></b> "w.meier@unix.net" <w.meier@unix.net>; "sane-devel@lists.alioth.debian.org" <sane-devel@lists.alioth.debian.org> <br> <b><span style="font-weight: bold;">Sent:</span></b> Thursday, August 29, 2013 12:33 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: scanbd daemon does not load firmware<br> </font> </div> <div class="y_msg_container"><br>Am 29.08.2013 16:03, schrieb Ilya V. Ivanchenko:<br>>> >>  2. When using scanbuttond-backends, fix loading firmware on USB insert.<br>>>><br>>>> what I could imagine is to fix this problem with a special<br>>>> shell-callback, when scanbd detects a
 device inserion / removal.<br>>><br>>>Forgot to say: would you like to write a patch for that? I will provide<br>>>you with the neccessary info to do that. Shouldn't be too much work ;-)<br>><br>> Not a problem. I'm a software/systems engineer, so I know what I (will<br>> be) doing. Only I have short window before I leave for a business trip.<br><br>I just marked the code with four place to insert code to start such a <br>callback:<br><br>// TODO: call the device insertion / removal callback<br><br>(if you use qtcreator you'll quickly find them)<br><br><br>I'm looking forward to your patches ;-)<br><br>><br>>>>  >>  2. When using scanbuttond-backends, fix loading firmware on USB insert.<br>>>>  ><br>>>>  >what I could imagine is to fix this problem with a special<br>>>>  >shell-callback, when scanbd detects a device inserion /
 removal.<br>>>> This is in the nutshell how I patched the problem from udev.<br>>><br>>>yes, but you had to stop / restart the scanbd and that's more a<br>>>workaround than a solution ...<br>><br>> I agree.<br>><br>> --<br>> Ilya<br><br><br>-- <br>Wilhelm<br><a ymailto="mailto:w.meier@unix.net" href="mailto:w.meier@unix.net">w.meier@unix.net</a><br><br><br></div> </div> </div>  </div></body></html>