[sane-devel] buttons-daemon for SANE genesys scanner

Pierre Willenbrock pierre at pirsoft.dnsalias.org
Sat Jan 10 20:56:20 UTC 2009


m. allan noah schrieb:
> On Sat, Jan 10, 2009 at 2:55 PM, Pierre Willenbrock
> <pierre at pirsoft.dnsalias.org> wrote:
>> m. allan noah schrieb:
>>> On Sat, Jan 10, 2009 at 1:11 PM, Pierre Willenbrock
>>> <pierre at pirsoft.dnsalias.org> wrote:
>>>> m. allan noah schrieb:
>>>>> On Fri, Jan 9, 2009 at 5:02 PM, Pierre Willenbrock
>>>>> <pierre at pirsoft.dnsalias.org> wrote:
>>>> [...]
>>>>>> Another question: Is it okay to only look at the hardware state if the
>>>>>> frontend asks for the state of the option? That way shorter presses can
>>>>>> be lost, if the frontend does not poll often enough.
>>>>> In my case, the scanners are smart enough to buffer the button presses
>>>>> for 3 seconds, and I effectively read the status of all the buttons
>>>>> from the scanner every time you ask for the value of the first option.
>>>>> So, as long as the front-end reads within that 3 second window, no
>>>>> presses are lost.
>>>>>
>>>>> If your machines dont buffer, then you might need a thread just to
>>>>> read the status really quickly? Do you know how frequently the windows
>>>>> driver reads the buttons?
>>>> The genesys chips don't help at detecting hardware buttons. The only
>>>> sensor logic in the chip is for the home-sensor. The rest is GPIO.
>>> Is it possible for a user to press and release the button and have the
>>> driver 'lose' it if you dont read the GPIO pins during the 'pressed'
>>> inteval?
>> Exactly like that. And the windows driver has the same problem.
> 
> Ahh, I love cheap scanners :) How fast would you have to poll the
> scanner to get short presses? 10Hz?

In my exerience, at 10Hz it is hard to press short enough for the press
to not get noticed. 2Hz is too slow, 8Hz is okay, and above 12Hz it is
impossible to lose presses, even when hammering the button like mad. At
least, you cannot be sure if the software lost the press or you didn't
press the button properly.

The shortest single presses i managed were 20ms, averaging at 40ms.
Normal presses are 70-110ms. Now one could calculate the odds for a
missed button press, but i will not go there.

Regards,
  Pierre



More information about the sane-devel mailing list