Re: [sane-devel] Interactive use of scanner buttons

2021-12-02 Thread Andy Bennett

Hi,


  So, for scanning books, it would be nice to be able to control such a
frontend as XSane with the scanner's hardware buttons. Because most of
the time you can reach the hardware button even if you handle the book
using both hands (however, a configurable delay after the button is
pressed may be helpful option).

  (The other possible way to solve the described problem is to use a
separate triggering device. May be a pedal! But that's another 
story...)


  I want to know/discuss, what a design of a button monitor for
use with interactive frontends would fit into SANE better. Any ideas?


I had a similar but slightly different set of requirements a few years 
ago.
I have an ix500 that has a sheet feeder and a hopper and I wanted to be 
able to load up the hopper and then press the button to start the scan.


I wrote some patches for scanimage that allowed it to "trigger" on one 
of the "buttons": it turned out that the hopper load event was exposed 
as a button push as was the actual hard-button on the scanner itself.


I submitted them to the list a couple of times but they never got any 
interest. I've been using them ever since tho' so I'd be happy to 
re-share them for comment and improvements.


The patch itself is quite simple. It adds command line options to 
scanimage
that allowed me to write a bash script that calls it in a loop where it 
would wait for a hopper load event then pop up a dialog for tags whilst 
waiting for the button push event. Then it would do the scanning and 
show the preview before going back to wait for the next hopper load 
event.



--
andy...@ashurst.eu.org
http://www.ashurst.eu.org/
http://www.gonumber.com/andyjpb
0x7EBA75FF



Re: [sane-devel] Interactive use of scanner buttons

2021-12-02 Thread Kelly Price
Allan hit it there.  You may have buttons that are exposed as USB
keyboard or HID devices, or it may piggyback on the protocol being
used for just scanning.  You may need a system notification app on
your desktop that integrates XSane (probably a localized saned over
Unix sockets).

That said... I cannot think of a scanner connected over the network
with saned will have any use for the buttons on the scanner itself.
The only useful button in that case would be "Copy" and only if you
attached a printer there... and in which case, the computer it's
attached to can handle a basic copy job by itself.  I can think of
extreme edge cases but that's it.  Hell, at my workplace we have
all-in-one copy/scan/fax network printers... and those things scanned
to a PDF and required an email address.

On Thu, Dec 2, 2021 at 8:43 PM m. allan noah  wrote:
>
> There is a great deal of variation between scanners and backends regarding 
> what buttons are available and how they are exposed. You also have the 
> exclusive device access problem. In the end, I think you need a new frontend, 
> or modifications to an existing one, rather than a separate monitor.
>
> allan
>
> On Thu, Dec 2, 2021 at 5:35 PM Paul Wolneykien  wrote:
>>
>>
>>   Hi!
>>
>>   As I can see, XSane doesn't poll the scanner's hardware buttons.
>> And if I understand the scanbd manual right, the daemon locks the SANE
>> interface to the scanner until a button is pressed, and then gives
>> exclusive access to the scanner for the frontend. So, the daemon is
>> primarily for launching a frontend, but not for controlling the
>> frontend while it is running. Am I right?
>>
>>   I've grep'ed the mailing list archives a little and it seems that the
>> main purpose of various button daemons (scanbuttond, scanbd) is to
>> implement such a facility as "push scan": the user goes to a remote
>> (possibly, network) scanner, places a standard material into it,
>> presses a button on the scanner and the system performes an automatic
>> (that's important!) scan.
>>   It also seems that in other situations, when a user wants to use an
>> interactive frontend (for making previews, selecting the scan
>> area, adjusting black and white points and gamma) the scanner is
>> expected to be placed on the table near PC. Or, at least, that the
>> material for scan can be placed into the scanner without a need for
>> further attention (i.e. a sheet material), so the user can set it up
>> and then back to his/her keyboard and mouse to make a scan or a number
>> of scans with different settings using the GUI frontend.
>>
>>   These two stories (the "push story" and the "desktop story") are nice
>> and simple, but are more or less unapplicable in the world of book
>> scanning!
>>
>>   Firstly, books are all different, so you need to make previews,
>> select areas and adjust things for each one. Secondly, books aren't
>> flat, so even if you use a special hardware you almost always need
>> to handle the book with both your hands!
>>
>>   So, for scanning books, it would be nice to be able to control such a
>> frontend as XSane with the scanner's hardware buttons. Because most of
>> the time you can reach the hardware button even if you handle the book
>> using both hands (however, a configurable delay after the button is
>> pressed may be helpful option).
>>
>>   (The other possible way to solve the described problem is to use a
>> separate triggering device. May be a pedal! But that's another story...)
>>
>>   I want to know/discuss, what a design of a button monitor for
>> use with interactive frontends would fit into SANE better. Any ideas?
>>
>
>
> --
> "well, I stand up next to a mountain- and I chop it down with the edge of my 
> hand"



-- 
Kelly "STrRedWolf" Price
http://redwolf.ws



Re: [sane-devel] Interactive use of scanner buttons

2021-12-02 Thread m. allan noah
There is a great deal of variation between scanners and backends regarding
what buttons are available and how they are exposed. You also have the
exclusive device access problem. In the end, I think you need a new
frontend, or modifications to an existing one, rather than a separate
monitor.

allan

On Thu, Dec 2, 2021 at 5:35 PM Paul Wolneykien  wrote:

>
>   Hi!
>
>   As I can see, XSane doesn't poll the scanner's hardware buttons.
> And if I understand the scanbd manual right, the daemon locks the SANE
> interface to the scanner until a button is pressed, and then gives
> exclusive access to the scanner for the frontend. So, the daemon is
> primarily for launching a frontend, but not for controlling the
> frontend while it is running. Am I right?
>
>   I've grep'ed the mailing list archives a little and it seems that the
> main purpose of various button daemons (scanbuttond, scanbd) is to
> implement such a facility as "push scan": the user goes to a remote
> (possibly, network) scanner, places a standard material into it,
> presses a button on the scanner and the system performes an automatic
> (that's important!) scan.
>   It also seems that in other situations, when a user wants to use an
> interactive frontend (for making previews, selecting the scan
> area, adjusting black and white points and gamma) the scanner is
> expected to be placed on the table near PC. Or, at least, that the
> material for scan can be placed into the scanner without a need for
> further attention (i.e. a sheet material), so the user can set it up
> and then back to his/her keyboard and mouse to make a scan or a number
> of scans with different settings using the GUI frontend.
>
>   These two stories (the "push story" and the "desktop story") are nice
> and simple, but are more or less unapplicable in the world of book
> scanning!
>
>   Firstly, books are all different, so you need to make previews,
> select areas and adjust things for each one. Secondly, books aren't
> flat, so even if you use a special hardware you almost always need
> to handle the book with both your hands!
>
>   So, for scanning books, it would be nice to be able to control such a
> frontend as XSane with the scanner's hardware buttons. Because most of
> the time you can reach the hardware button even if you handle the book
> using both hands (however, a configurable delay after the button is
> pressed may be helpful option).
>
>   (The other possible way to solve the described problem is to use a
> separate triggering device. May be a pedal! But that's another story...)
>
>   I want to know/discuss, what a design of a button monitor for
> use with interactive frontends would fit into SANE better. Any ideas?
>
>

-- 
"well, I stand up next to a mountain- and I chop it down with the edge of
my hand"


Re: [sane-devel] Interactive use of scanner buttons

2021-12-02 Thread Ralph Little

Hi,

On 2021-12-02 2:35 p.m., Paul Wolneykien wrote:

   As I can see, XSane doesn't poll the scanner's hardware buttons.
And if I understand the scanbd manual right, the daemon locks the SANE
interface to the scanner until a button is pressed, and then gives
exclusive access to the scanner for the frontend. So, the daemon is
primarily for launching a frontend, but not for controlling the
frontend while it is running. Am I right?

   I've grep'ed the mailing list archives a little and it seems that the
main purpose of various button daemons (scanbuttond, scanbd) is to
implement such a facility as "push scan": the user goes to a remote
(possibly, network) scanner, places a standard material into it,
presses a button on the scanner and the system performes an automatic
(that's important!) scan.
   It also seems that in other situations, when a user wants to use an
interactive frontend (for making previews, selecting the scan
area, adjusting black and white points and gamma) the scanner is
expected to be placed on the table near PC. Or, at least, that the
material for scan can be placed into the scanner without a need for
further attention (i.e. a sheet material), so the user can set it up
and then back to his/her keyboard and mouse to make a scan or a number
of scans with different settings using the GUI frontend.

   These two stories (the "push story" and the "desktop story") are nice
and simple, but are more or less unapplicable in the world of book
scanning!

   Firstly, books are all different, so you need to make previews,
select areas and adjust things for each one. Secondly, books aren't
flat, so even if you use a special hardware you almost always need
to handle the book with both your hands!

   So, for scanning books, it would be nice to be able to control such a
frontend as XSane with the scanner's hardware buttons. Because most of
the time you can reach the hardware button even if you handle the book
using both hands (however, a configurable delay after the button is
pressed may be helpful option).

   (The other possible way to solve the described problem is to use a
separate triggering device. May be a pedal! But that's another story...)

   I want to know/discuss, what a design of a button monitor for
use with interactive frontends would fit into SANE better. Any ideas?

Button control has always been lacking in SANE and the Linux scanning 
world compared to the Windows counterpart. scanbd is not well documented 
and setting it up is not straightforward.

There are two modes that I can think of, that are actually implemented:

1) Button launch - you need some process to monitor/poll for button 
presses, then launch a pre-programmed application to perform the 
requested function. This would be the scanbd scenario. I have not 
experimented with scanbd myself.


2) Scan on button press - some backends allow you to defer the scan 
function having launched it in some frontend, until a button is pressed. 
The support for this is often provided in the backend and I think this 
is a poor solution. The backend should surely just expose the button 
press functionality to the frontend.


Surely some work could improve this area.

There are also some other considerations that impinge on this aspect. 
Some time ago, I added some functionality to a backend to add support 
for a scanner that has a little LCD window that shows a number which you 
can increment/decrement with some buttons. This might be used to 
indicate a number of print copies perhaps. The backend can now do this, 
but for it to be effective in the frontend, the value has to be 
regularly polled. xsane can show this value in the Advanced window after 
requesting it from the scanner. However, regular polling can be 
detrimental as a general feature. One commentator suggested that over a 
network, this could become an unnecessary bandwidth hog. In SANE we 
would want to add polling features in a generic fashion and we should 
wary of undesirable side-effects. Flooding a network just because you 
are sitting in an idle instance of xsane is certainly such an example. 
It is something that we should discuss carefully before enhancing the 
standard.


I would certainly be happy to see this area improved.

Cheers,
Ralph



[sane-devel] Interactive use of scanner buttons

2021-12-02 Thread Paul Wolneykien


  Hi!

  As I can see, XSane doesn't poll the scanner's hardware buttons.
And if I understand the scanbd manual right, the daemon locks the SANE
interface to the scanner until a button is pressed, and then gives
exclusive access to the scanner for the frontend. So, the daemon is
primarily for launching a frontend, but not for controlling the
frontend while it is running. Am I right?

  I've grep'ed the mailing list archives a little and it seems that the
main purpose of various button daemons (scanbuttond, scanbd) is to
implement such a facility as "push scan": the user goes to a remote
(possibly, network) scanner, places a standard material into it,
presses a button on the scanner and the system performes an automatic
(that's important!) scan.
  It also seems that in other situations, when a user wants to use an
interactive frontend (for making previews, selecting the scan
area, adjusting black and white points and gamma) the scanner is
expected to be placed on the table near PC. Or, at least, that the
material for scan can be placed into the scanner without a need for
further attention (i.e. a sheet material), so the user can set it up
and then back to his/her keyboard and mouse to make a scan or a number
of scans with different settings using the GUI frontend.

  These two stories (the "push story" and the "desktop story") are nice
and simple, but are more or less unapplicable in the world of book
scanning!

  Firstly, books are all different, so you need to make previews,
select areas and adjust things for each one. Secondly, books aren't
flat, so even if you use a special hardware you almost always need
to handle the book with both your hands!

  So, for scanning books, it would be nice to be able to control such a
frontend as XSane with the scanner's hardware buttons. Because most of
the time you can reach the hardware button even if you handle the book
using both hands (however, a configurable delay after the button is
pressed may be helpful option).

  (The other possible way to solve the described problem is to use a
separate triggering device. May be a pedal! But that's another story...)

  I want to know/discuss, what a design of a button monitor for
use with interactive frontends would fit into SANE better. Any ideas?



Re: [sane-devel] Sane / Canon Pixma TS5100

2021-12-02 Thread Thierry Huchard

Le 2021-11-30 15:11, Udo Feustel a écrit :

Hello,

maybe This is Interresting for you.

Yours UF

sudo apt install sane xsane libsane

OK

sane-find-scanner

found USB scanner (vendor=0x04a9 [Canon], product=0x1825 [TS5100
series]) at libusb:007:002

~$ sudo chmod u+w /dev/bus/usb/007/002

No Failure

Dokument -Scanner:

Scan Failed, connection to the scanner not possible


Hi,

Can you give us your distribution and its version?
$ cat /etc/os-release
Can you tell us which version of sane you have
$ scanimage -L

Thierry



[sane-devel] Sane / Canon Pixma TS5100

2021-12-02 Thread Udo Feustel

Hello,

maybe This is Interresting for you.

Yours UF


|sudo apt install sane xsane libsane OK |


sane-find-scanner

found USB scanner (vendor=0x04a9 [Canon], product=0x1825 [TS5100
series]) at libusb:007:002


~$ sudo chmod u+w /dev/bus/usb/007/002

No Failure



Dokument -Scanner:

Scan Failed, connection to the scanner not possible