> Hi,
>
> Would it be possible for someone to look at the button daemon and see if
> there are obvious errors that you lead to issues as discussed here.
>
> The code is attached again to this mail.

Finally I found out how this can be solved. The following patch does the
trick:

@@ -59,7 +59,11 @@ int
 main (int argc, char **argv)
 {
        int i, idx;
-       struct timespec ts = { .tv_sec = 0, .tv_nsec = 100000000L };
+       /* Important query rate limiting, the old value of 0.1s was too
+        * small. USB scanners can block on newer Linux systems if the
+        * query rate is too high.
+        */
+       struct timespec ts = { .tv_sec = 0, .tv_nsec = 500000000L };
        time_t last_reopen;
        SANE_Bool new, print_err;
        const SANE_Option_Descriptor *opt[MAX_BUTTONS];

Thank God this is solved now before I gave up on it! Still, I believe this
is a bug in recent Linux systems and shouldn't happen. But I tested from
MX Linux to latest Fedora so many systems and it's always there.

Regards,
Simon

>
> Thanks,
> Simon
>
>> I start to believe the problem is not in SANE itself but in the button
>> daemon we are using (see attachement).
>>
>> Our software is running the button daemon and waits for events, then
>> terminates the button daemon and does the appropriate scanimage job, and
>> then starts the button daemon again.
>>
>> The button daemon is a modified version of some daemon which was
>> floating
>> around many years ago. It has worked well for the last 15 years or so.
>> Maybe there is some modification needed to make it work well with newer
>> SANE.
>>
>> If someone who knows SANE better than me would take a look at it, that
>> would be much appreciated.
>>
>> Thanks,
>> Simon
>>
>>> We need to isolate the problem if possible- I expect if you compile an
>>> older, known working sane-backends on your current computer, the
>>> problem
>>> will persist. That would indicate hardware or OS level issue.
>>>
>>> allan
>>>
>>> On Wed, Jan 14, 2026 at 9:35 AM Simon Matter via sane-devel <
>>> [email protected]> wrote:
>>>
>>>> >
>>>> > Hello,
>>>> >
>>>> > On 2026-01-14 14:59, Simon Matter via sane-devel wrote:
>>>> >> These scanners work perfectly fine with very old sane-backends
>>>> >> and operating system.
>>>> >
>>>> > Does it work on the exact same computer
>>>> > where it fails or does it work on old computers?
>>>>
>>>> It works fine on old computers with old software.
>>>>
>>>> >
>>>> > I ask because of possible USB 3 related issues, see
>>>> > https://en.opensuse.org/SDB:Configuring_Scanners#USB
>>>>
>>>> Thanks, I'll check it out.
>>>>
>>>> Simon
>>>>
>>>>
>>>>
>>>
>>> --
>>> "well, I stand up next to a mountain- and I chop it down with the edge
>>> of
>>> my hand"
>>>
>>
>



Reply via email to