[sane-devel] "Scanimage" or "Sane" timeouts

Olaf Meeuwissen paddy-hack at member.fsf.org
Sat Apr 6 13:13:07 BST 2019


Hi Louis,

Louis Lagendijk writes:

> On Sat, 2019-04-06 at 10:44 +0200, Dr Rainer Woitok wrote:
>> Olaf,
>>
>> On Saturday, 2019-04-06 15:27:47 +0900, you wrote:
>>
>> > ...
>> > >    bjnp-timeout=100
>> > >    bjnp://192.168.2.199/timeout=5000
>> > >    bjnp-timeout=100
>> >
>> > According to the manual page, the first line has effect.  The
>> > second is only applied for the scanner at that IP address.
>> > Everything else uses the last bjnp-timeout value.
>>
>> That was exactly my intention.  The 5000 milliseconds timeout was
>> suggested by Louis because the scanner is connected via WiFi.  But
>> even with these specifications former versions of "scanimage"
>> stubbornly produced six timeouts of 1000 milliseconds each, so I
>> suspect even former versions misinterpreted the default value as a
>> minimum as you point out below.
>>
>> > ...
>> > I had a quick look at the code in backend/pixma_bjnp.c.
>> > ...
>> >    min_timeout = /* assign value from configuration file */
>> >    if (min_timeout < BJNP_TIMEOUT_DEFAULT)
>> >       min_timeout = BJNP_TIMEOUT_DEFAULT;
>>
>> So the code clearly contradicts the documentation.  I would vote in
>> favour of the documentation and would prefer the default value to be
>> only assigned, if the configuration files don't provide any timeout
>> values.

It does get assigned from the configuration file but overwritten by a
hard-coded minimum value if less than that value.

>> Thanks, Olaf, for pointing this out.
>>
> I gave in to the many requests to increase the default, something I had
> rejected for a long time. I will reconsider the changes and see if I
> can find a better solution and if not revert the change. The argument
> was that on WIFI longer timeouts do occur, and increasing the time out
> would not affect others. It apparently does affect others, so the
> change is not warranted as is.
> Will have a look at it some time next week

Thanks.  Increasing the default *minimum* timeout does affect others.
For those that are in need of longer timeouts there is a configuration
file option just for that, IIUC.

There is one thing that bothers me a bit though and that's the occurence
of *six* timeouts, at least in Rainer's case.  Any idea why that may be
happening?  Waiting for timeouts on other network connected devices on
the same network?  Is the probe serial, as in wait for a timeout before
trying the next device?  If so, bumping the *minimum* default timeout
will really hurt if you have a few devices ...

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