Re: [sane-devel] scanbd ... next steps / questions ...

2017-05-03 Thread Wilhelm Meier
Am 03.05.2017 um 19:50 schrieb Dr.-Ing. Dieter Jurzitza:
> Hi Axel,
> thank you very much for your feedback - I hope to have more spare time next 
> weekend to dive again into this issue.
> 
> But in general: I had had thought that there is a "generic" dll.conf having 
> only the net - backend enabled that sits in /etc/saned (after configuration 
> of 
> scanbd). This I took from the README.txt:
> 
> ***
> 6) sane config
> 
> All desktop applications should only get access to the scanners via the net
> backend, so edit /etc/sane.d/dll.conf to only contain the net-backend on the 
> desktop machines. 
> 
> example dll.conf:
> ---
> net
> ---
> ***
> 
> but somewhere there is a need to tell sane which physical device to use, so I 
> thought - maybe erratically - that scanbd "hides" other entries / a different 
> dll.conf in /etc/saned from sane and tells sane itself which scanner to use 
> but depicts to the "outer world" that there is nothing but a network scanner. 
> As readily said, this may be totally wrong. If I read your comments it sounds 
> as if the sane - configuration ought to remain "as is", but this is not what 
> the above mentioned entry in README.txt from scanbd tells me.

Please read the ReadMe.txt carefully ;-)

All local scan-applications like xsane e.g. have to use the net-backend.
This is the only way to intercept a scan-request by scanbd. scanbd in
turn has to start saned to perform the real scan. saned itself use the
normal way for configuration: it normally would use the
/etc/sane/dll.conf, but this would be wrong since it leads to an
infinity recursion via the net backend. Therefore scanbd uses the
SANE_CONFIG_DIR to point saned to another location to find an
alternative dll.conf - and this dll.conf should only contain the local
attached scanners (or remote on other machines).

Sounds a bit complicated, but this is the way it is ...

HTH,
 Wilhelm

> 
> Regards,
> thanks for all the work
> 
> 
> 
> 
> Dieter Jurzitza
> 
> 
> 
> Am Donnerstag, 27. April 2017, 15:29:09 schrieb Axel Schöner:
>> Am Samstag, 22. April 2017, 19:02:57 CEST schrieb Dr.-Ing. Dieter Jurzitza:
>>> Dear listmembers,
>>> probably these questions have readily been asked over and over again, then
>>> my apologies:
>>>
>>> 1.) /etc/scanbd/scripts
>>> which scripts does this refer to? There are some scripts in /etc/scanbd,
>>> those like "scanadf.script" and "test.script" (I am using a spec - file
>>> for
>>> opensuse some other person had had generated)? If I look into
>>> /etc/scanbd/scanbd.conf they ought to reside within /etc/scanbd/scripts,
>>> is
>>> that correct? Is there a configure - option that would print out all
>>> directories in use (or, even better, put this summarizing into config.log
>>> like several other packages do / emacs is a nice example in this regard
>>> ...)?
>>
>> The scripts which are executed while device insertion/removal and by pushing
>> buttons should be located in ${prefix}/etc/scanbd/scripts. We will fix the
>> makefiles... to correct this (in the next days).
>>
>>> 2.) /usr/lib64/scanbd/scanbuttond/backends, is this the directory I should
>>> copy /etc/saned/dll.conf to as well as all the other files from /etc/saned
>>> that are uncommented within *this* dll.conf (except net.conf) in contrast
>>> to /etc/saned/dll.conf that ought to contain no reference but "net"? Is
>>> this what is menat with "backends"?
>>
>> I think these files should be in ${prefix}/etc/saned/. Where do you have
>> this information from?
>>
>>> 3.) SCANBD_DEVICE could be /dev/scanner (if I have such a device?)
>>
>> In most cases there is no such devicenode.
>> It could be something like plustek:libusb:001:003.
>> When you plug in your device it should be detected if there is a supported
>> driver configured. Look at the end of ${prefix}/etc/saned/scanbd.conf
>>
>>> 4.) SCANBD_ACTION - I do not really understand what is about this.
>>
>> This is a variable which represents the actual event (insert, remove, scan,
>> copy, ...) the definitions are in scanbd.conf.
>> It is possible to trigger different scripts based on these events (if you
>> have more then one detected button on your scanner).
>>
>> You can launch scanbd in debug mode to see the values of SCANBD_DEVICE and
>> SCANBD_ACTION: ${prefix}/sbin/scanbd -d7 -f -c
>> ${prefix}/etc/scanbd/scanbd.conf .
>>
>>> From within the "README.txt in the source-directory I did not really
>>> understand what is meant with the variables - would it be too much to
>>> simply ask for an example that would shed some light on the do's and
>>> don'ts of the configuration if the "regular" scanner would be say "hp"
>>> and the
>>> corresponding device would be "/dev/scanner"?
>>>
>>> I am trying to set up a spec - file for a rpm - package, but as of now
>>> there is too much understanding missing on my side to get that tracked
>>> down in such a way that I can be satisfied with the results 

Re: [sane-devel] scanbd ... next steps / questions ...

2017-05-03 Thread Dr.-Ing. Dieter Jurzitza
Hi Axel,
thank you very much for your feedback - I hope to have more spare time next 
weekend to dive again into this issue.

But in general: I had had thought that there is a "generic" dll.conf having 
only the net - backend enabled that sits in /etc/saned (after configuration of 
scanbd). This I took from the README.txt:

***
6) sane config

All desktop applications should only get access to the scanners via the net
backend, so edit /etc/sane.d/dll.conf to only contain the net-backend on the 
desktop machines. 

example dll.conf:
---
net
---
***

but somewhere there is a need to tell sane which physical device to use, so I 
thought - maybe erratically - that scanbd "hides" other entries / a different 
dll.conf in /etc/saned from sane and tells sane itself which scanner to use 
but depicts to the "outer world" that there is nothing but a network scanner. 
As readily said, this may be totally wrong. If I read your comments it sounds 
as if the sane - configuration ought to remain "as is", but this is not what 
the above mentioned entry in README.txt from scanbd tells me.

Regards,
thanks for all the work




Dieter Jurzitza



Am Donnerstag, 27. April 2017, 15:29:09 schrieb Axel Schöner:
> Am Samstag, 22. April 2017, 19:02:57 CEST schrieb Dr.-Ing. Dieter Jurzitza:
> > Dear listmembers,
> > probably these questions have readily been asked over and over again, then
> > my apologies:
> > 
> > 1.) /etc/scanbd/scripts
> > which scripts does this refer to? There are some scripts in /etc/scanbd,
> > those like "scanadf.script" and "test.script" (I am using a spec - file
> > for
> > opensuse some other person had had generated)? If I look into
> > /etc/scanbd/scanbd.conf they ought to reside within /etc/scanbd/scripts,
> > is
> > that correct? Is there a configure - option that would print out all
> > directories in use (or, even better, put this summarizing into config.log
> > like several other packages do / emacs is a nice example in this regard
> > ...)?
> 
> The scripts which are executed while device insertion/removal and by pushing
> buttons should be located in ${prefix}/etc/scanbd/scripts. We will fix the
> makefiles... to correct this (in the next days).
> 
> > 2.) /usr/lib64/scanbd/scanbuttond/backends, is this the directory I should
> > copy /etc/saned/dll.conf to as well as all the other files from /etc/saned
> > that are uncommented within *this* dll.conf (except net.conf) in contrast
> > to /etc/saned/dll.conf that ought to contain no reference but "net"? Is
> > this what is menat with "backends"?
> 
> I think these files should be in ${prefix}/etc/saned/. Where do you have
> this information from?
> 
> > 3.) SCANBD_DEVICE could be /dev/scanner (if I have such a device?)
> 
> In most cases there is no such devicenode.
> It could be something like plustek:libusb:001:003.
> When you plug in your device it should be detected if there is a supported
> driver configured. Look at the end of ${prefix}/etc/saned/scanbd.conf
> 
> > 4.) SCANBD_ACTION - I do not really understand what is about this.
> 
> This is a variable which represents the actual event (insert, remove, scan,
> copy, ...) the definitions are in scanbd.conf.
> It is possible to trigger different scripts based on these events (if you
> have more then one detected button on your scanner).
> 
> You can launch scanbd in debug mode to see the values of SCANBD_DEVICE and
> SCANBD_ACTION: ${prefix}/sbin/scanbd -d7 -f -c
> ${prefix}/etc/scanbd/scanbd.conf .
> 
> > From within the "README.txt in the source-directory I did not really
> > understand what is meant with the variables - would it be too much to
> > simply ask for an example that would shed some light on the do's and
> > don'ts of the configuration if the "regular" scanner would be say "hp"
> > and the
> > corresponding device would be "/dev/scanner"?
> > 
> > I am trying to set up a spec - file for a rpm - package, but as of now
> > there is too much understanding missing on my side to get that tracked
> > down in such a way that I can be satisfied with the results 
> > 
> > Thank you very much,
> > regards
> > 
> > 
> > 
> > 
> > Dieter Jurzitza

-- 
---
Dr.-Ing. Dieter Jurzitza76131 Karlsruhe


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


[sane-devel] [PATCH] pieusb: Support ProScan 10T and Reflecta CrystalScan 3600

2017-05-03 Thread Klaus Kaempf
Neither of these scanner have an automated slide transport and fail on
respective SCSI commands.

- Add flags parameter to control if automatic slide transport is available
- Reflect flags in pieusb.conf.in
- rename SLIDE_LAMP_ON to SLIDE_INIT
  it fails on scanners without automatic slide transport, so it has
  nothing to do with the lamp.
- run SLIDE_INIT only FLAG_SLIDE_TRANSPORT is set
- pieusb.conf.in: Add Reflecta CrystalScan 3600
---
 backend/pieusb.c  | 89 ---
 backend/pieusb.conf.in| 15 ++--
 backend/pieusb.h  |  1 +
 backend/pieusb_scancmd.c  |  2 +-
 backend/pieusb_scancmd.h  |  2 +-
 backend/pieusb_specific.c | 48 ++---
 backend/pieusb_specific.h | 11 --
 7 files changed, 113 insertions(+), 55 deletions(-)

diff --git a/backend/pieusb.c b/backend/pieusb.c
index 4b0730403aeb..973088849ca8 100644
--- a/backend/pieusb.c
+++ b/backend/pieusb.c
@@ -109,6 +109,10 @@ extern void write_tiff_rgbi_header (FILE *fptr, int width, 
int height, int depth
 #define DBG_info_scan   11  /* information scanner commands */
 #define DBG_info_usb13  /* information usb level functions */
 
+/* device flags */
+
+#define FLAG_SLIDE_TRANSPORT 0x01
+
 /* --
  *
  * SUPPORTED DEVICES SPECIFICS
@@ -150,7 +154,8 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback 
__sane_unused__ authorize
 char config_line[PATH_MAX];
 SANE_Word vendor_id;
 SANE_Word product_id;
-SANE_Word model_number;
+SANE_Int model_number;
+SANE_Int flags;
 SANE_Status status;
 int i;
 
@@ -183,18 +188,22 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback 
__sane_unused__ authorize
 pieusb_supported_usb_device_list[0].vendor = 0x05e3;
 pieusb_supported_usb_device_list[0].product = 0x0145;
 pieusb_supported_usb_device_list[0].model = 0x30;
+pieusb_supported_usb_device_list[0].flags = 0;
 /* Reflecta ProScan 7200, model number 0x36 */
 pieusb_supported_usb_device_list[1].vendor = 0x05e3;
 pieusb_supported_usb_device_list[1].product = 0x0145;
 pieusb_supported_usb_device_list[1].model = 0x36;
-/* Reflecta 6000 Multiple Slide Scanner */
+pieusb_supported_usb_device_list[1].flags = 0;
+/* Reflecta 6000 Multiple Slide Scanner, model number 0x3a */
 pieusb_supported_usb_device_list[2].vendor = 0x05e3;
 pieusb_supported_usb_device_list[2].product = 0x0142;
 pieusb_supported_usb_device_list[2].model = 0x3a;
+pieusb_supported_usb_device_list[2].flags = FLAG_SLIDE_TRANSPORT;
 /* end of list */
 pieusb_supported_usb_device_list[3].vendor = 0;
 pieusb_supported_usb_device_list[3].product = 0;
 pieusb_supported_usb_device_list[3].model = 0;
+pieusb_supported_usb_device_list[3].flags = 0;
 
 /* Add entries from config file */
 fp = sanei_config_open (PIEUSB_CONFIG_FILE);
@@ -209,14 +218,14 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback 
__sane_unused__ authorize
 if (strncmp (config_line, "usb ", 4) != 0) continue;
 /* Parse vendor-id, product-id and model number and add to list */
 DBG (DBG_info_sane, "sane_init() config file parsing %s\n", 
config_line);
-status = sanei_pieusb_parse_config_line(config_line, _id, 
_id, _number);
+status = sanei_pieusb_parse_config_line(config_line, _id, 
_id, _number, );
 if (status == SANE_STATUS_GOOD) {
-DBG (DBG_info_sane, "sane_init() config file lists device %04x 
%04x %02x\n",vendor_id, product_id, model_number);
-if (!sanei_pieusb_supported_device_list_contains(vendor_id, 
product_id, model_number)) {
-DBG (DBG_info_sane, "sane_init() adding device %04x %04x 
%02x\n",vendor_id, product_id, model_number);
-sanei_pieusb_supported_device_list_add(vendor_id, 
product_id, model_number);
+DBG (DBG_info_sane, "sane_init() config file lists device %04x 
%04x %02x %02x\n",vendor_id, product_id, model_number, flags);
+if (!sanei_pieusb_supported_device_list_contains(vendor_id, 
product_id, model_number, flags)) {
+DBG (DBG_info_sane, "sane_init() adding device %04x %04x 
%02x %02x\n",vendor_id, product_id, model_number, flags);
+sanei_pieusb_supported_device_list_add(vendor_id, 
product_id, model_number, flags);
 } else {
-DBG (DBG_info_sane, "sane_init() list already contains 
%04x %04x %02x\n", vendor_id, product_id, model_number);
+DBG (DBG_info_sane, "sane_init() list already contains 
%04x %04x %02x %02x\n", vendor_id, product_id, model_number, flags);
 }
 } else {
 DBG (DBG_info_sane, "sane_init() config file parsing %s: 
error\n", config_line);
@@ -235,8 +244,13 @@ sane_init (SANE_Int * version_code, 

Re: [sane-devel] scanbd ... next steps / questions ...

2017-05-03 Thread Axel Schöner

Am Donnerstag, 27. April 2017, 15:29:09 CEST schrieben Sie:

> Am Samstag, 22. April 2017, 19:02:57 CEST schrieb Dr.-Ing. Dieter Jurzitza:

> > Dear listmembers,

> > probably these questions have readily been asked over and over again, then

> > my apologies:

> >

> > 1.) /etc/scanbd/scripts

> > which scripts does this refer to? There are some scripts in /etc/scanbd,

> > those like "scanadf.script" and "test.script" (I am using a spec - file

> > for

> > opensuse some other person had had generated)? If I look into

> > /etc/scanbd/scanbd.conf they ought to reside within /etc/scanbd/scripts,

> > is

> > that correct? Is there a configure - option that would print out all

> > directories in use (or, even better, put this summarizing into config.log

> > like several other packages do / emacs is a nice example in this regard

> > ...)?

>

> The scripts which are executed while device insertion/removal and by pushing

> buttons should be located in ${prefix}/etc/scanbd/scripts. We will fix the

> makefiles... to correct this (in the next days).

>

 

The changes are now online in version >= [r243] .

 

 

> > 2.) /usr/lib64/scanbd/scanbuttond/backends, is this the directory I should

> > copy /etc/saned/dll.conf to as well as all the other files from /etc/saned

> > that are uncommented within *this* dll.conf (except net.conf) in contrast

> > to /etc/saned/dll.conf that ought to contain no reference but "net"? Is

> > this what is menat with "backends"?

>

> I think these files should be in ${prefix}/etc/saned/. Where do you have

> this information from?

>

> > 3.) SCANBD_DEVICE could be /dev/scanner (if I have such a device?)

>

> In most cases there is no such devicenode.

> It could be something like plustek:libusb:001:003.

> When you plug in your device it should be detected if there is a supported

> driver configured. Look at the end of ${prefix}/etc/saned/scanbd.conf

>

> > 4.) SCANBD_ACTION - I do not really understand what is about this.

>

> This is a variable which represents the actual event (insert, remove, scan,

> copy, ...) the definitions are in scanbd.conf.

> It is possible to trigger different scripts based on these events (if you

> have more then one detected button on your scanner).

>

> You can launch scanbd in debug mode to see the values of SCANBD_DEVICE and

> SCANBD_ACTION: ${prefix}/sbin/scanbd -d7 -f -c

> ${prefix}/etc/scanbd/scanbd.conf .

>

> > From within the "README.txt in the source-directory I did not really

> > understand what is meant with the variables - would it be too much to

> > simply ask for an example that would shed some light on the do's and

> > don'ts of the configuration if the "regular" scanner would be say "hp"

> > and the

> > corresponding device would be "/dev/scanner"?

> >

> > I am trying to set up a spec - file for a rpm - package, but as of now

> > there is too much understanding missing on my side to get that tracked

> > down in such a way that I can be satisfied with the results 

> >

> > Thank you very much,

> > regards

> >

> >

> >

> >

> > Dieter Jurzitza

 


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org