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

Louis Lagendijk louis at fazant.net
Sat Apr 6 14:14:46 BST 2019


On Sat, 2019-04-06 at 21:13 +0900, Olaf Meeuwissen wrote:
> 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.
> > > > ...
> > > > 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 ...
> > > > rom 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.
Yeah, the setting for a scanner should not be overriden, I apparently
missed that, will correct that at least.
> 
> > > Thanks, Olaf, for pointing this out.
> 
> 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 ...

@Olaf: No, if I remember correctly the tiemout is NOT used during
detection, but onBJNP_UDP_RETRY_MAly in normal traffic. UDP traffic
with the printer is retried BJNP_UDP_RETRY_MAX times (3) to ascertain
delivery. 


I just started wondering if there is a command that is not accepted in
case of this specific scanner. I have never seen that before, but who
knows...Will need destailed traces to check that...

@Rainer, to be sure can you do the following:
- please describe what happens after a scanimage listing, does it list
the scanner? Are there timeouts?
	- SANE_DEBUG_BJNP=11 scanimage -L 2> list.txt

- what happens with a scanimage 
	- SANE_DEBUG_BJNP=4 scanimage  > out.pnm 2> scan.txt
         are there timeouts?


Make for each attempt a wiresharktrace and mail me the list.txt and
scan.txt files with the wireshark traces?

 BR, Louis

P.s. apologies for dropping the ball on this: I am suffering from a
pretty stubborn burnout, so am low on energy







More information about the sane-devel mailing list