[sane-devel] sane-devel Digest, Vol 91, Issue 14

Michael Watson mwatson33 at comcast.net
Sat Jan 12 13:48:46 UTC 2013


Louis,

Udev start and stop of scanbd.service and scanbm.socket, service and socket
not enabled:

/usr/lib/udev/rules.d/99-local.rules
# Scan Button rules for Canon CanoScan LiDE 210
#ENV{libsane_matched}=="yes", GROUP="scanner"
ENV{ID_VENDOR_ID}=="04a9", ENV{ID_MODEL_ID}=="190a", ACTION=="add", \
    RUN+="/usr/bin/systemctl start scanbm.socket", RUN+="/usr/bin/systemctl
start scanbd.service"
ENV{SUBSYSTEM}=="usb", ENV{ID_PRODUCT_FROM_DATABASE}=="CanoScan LiDE 210",
ACTION=="remove", \
    RUN+="/usr/bin/systemctl stop scanbd.service", RUN+="/usr/bin/systemctl
stop scanbm.socket"

# systemctl status scanbd.service
scanbd.service - Scanner button polling Service
          Loaded: loaded (/usr/lib/systemd/system/scanbd.service; disabled)
          Active: active (running) since Wed, 1969-12-31 19:00:16 EST; 43
years and 0 months ago
        Main PID: 152 (scanbd)
          CGroup: name=systemd:/system/scanbd.service
                  L-152 /usr/local/sbin/scanbd -f

# systemctl status scanbm.socket
scanbm.socket - scanbd/saned incoming socket
          Loaded: loaded (/usr/lib/systemd/system/scanbm.socket; disabled)
          Active: active (listening) since Wed, 1969-12-31 19:00:15 EST; 43
years and 0 months ago
        Accepted: 0; Connected: 0
          CGroup: name=systemd:/system/scanbm.socket

Also for network scanner, scanbm and saned running as user saned,

/usr/lib/systemd/system/scanbm at .service
[Unit]
Description=Scanner Service
Requires=scanbm.socket

[Service]
User=saned
Group=scanner
ExecStart=/usr/local/sbin/scanbm
StandardInput=socket
Environment=SANE_CONFIG_DIR=/usr/local/etc/scanbd

R/
Michael

-----Original Message-----
From: sane-devel-bounces+mwatson33=comcast.net at lists.alioth.debian.org
[mailto:sane-devel-bounces+mwatson33=comcast.net at lists.alioth.debian.org] On
Behalf Of sane-devel-request at lists.alioth.debian.org
Sent: Friday, January 11, 2013 3:41 PM
To: sane-devel at lists.alioth.debian.org
Subject: sane-devel Digest, Vol 91, Issue 14


Send sane-devel mailing list submissions to
	sane-devel at lists.alioth.debian.org

To subscribe or unsubscribe via the World Wide Web, visit
	http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
or, via email, send a message with subject or body 'help' to
	sane-devel-request at lists.alioth.debian.org

You can reach the person managing the list at
	sane-devel-owner at lists.alioth.debian.org

When replying, please edit your Subject line so it is more specific than
"Re: Contents of sane-devel digest..."


Today's Topics:

   1. Re: systemd integration, sane-devel Digest, Vol 91,	Issue 13
      (Michael Watson)


----------------------------------------------------------------------

Message: 1
Date: Fri, 11 Jan 2013 15:41:00 -0500
From: "Michael Watson" <mwatson33 at comcast.net>
To: <sane-devel at lists.alioth.debian.org>
Subject: Re: [sane-devel] systemd integration, sane-devel Digest, Vol
	91,	Issue 13
Message-ID: <06E226AC8FE64B4682D693617C7AD20B at wat000>
Content-Type: text/plain;	charset="us-ascii"

Louis,

Thank you.

The summary looked at 2 cases, to see if there were any differences between
utilizing scanbm.socket or xinetd.  They both work.  Which one is
cleaner/more secure? 

FYI with version 1.2.1 both scanbd and xinetd were started by
/usr/lib/udev/rules.d/99-local.rules:
# Scan Button rules for Canon CanoScan LiDE 210
#ENV{libsane_matched}=="yes", GROUP="scanner" ENV{ID_VENDOR_ID}=="04a9",
ENV{ID_MODEL_ID}=="190a", ACTION=="add",
RUN+="/usr/bin/systemctl start xinetd", RUN+="/usr/bin/systemctl start
scanbd"
ENV{SUBSYSTEM}=="usb", ENV{ID_PRODUCT_FROM_DATABASE}=="CanoScan LiDE 210",
ACTION=="remove", RUN+="/usr/bin/systemctl stop scanbd",
RUN+="/usr/bin/systemctl stop xinetd"

Utilizing scanbm.socket, systemctl start/stop xinet is not needed.

Thank you for the opportunity to delve into systemd a little.  It's new to
me.

R/
Mike

-----Original Message-----
From: sane-devel-bounces+mwatson33=comcast.net at lists.alioth.debian.org
[mailto:sane-devel-bounces+mwatson33=comcast.net at lists.alioth.debian.org] On
Behalf Of sane-devel-request at lists.alioth.debian.org
Sent: Friday, January 11, 2013 1:48 PM
To: sane-devel at lists.alioth.debian.org
Subject: sane-devel Digest, Vol 91, Issue 13


Send sane-devel mailing list submissions to
	sane-devel at lists.alioth.debian.org

To subscribe or unsubscribe via the World Wide Web, visit
	http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
or, via email, send a message with subject or body 'help' to
	sane-devel-request at lists.alioth.debian.org

You can reach the person managing the list at
	sane-devel-owner at lists.alioth.debian.org

When replying, please edit your Subject line so it is more specific than
"Re: Contents of sane-devel digest..."


Today's Topics:

   1. Re: Response to systemd integration, sane-devel Digest,	Vol
      91, Issue 12 (Michael Watson)
   2. Re: Response to systemd integration, sane-devel Digest, Vol
      91, Issue 12 (Louis Lagendijk)
   3. Re: Support for Canon Pixma MG5100 Series (Rolf Bensch)
   4. Re: Scanbd and /etc/sane.d (Louis Lagendijk)


----------------------------------------------------------------------

Message: 1
Date: Fri, 11 Jan 2013 08:38:06 -0500
From: "Michael Watson" <mwatson33 at comcast.net>
To: <sane-devel at lists.alioth.debian.org>
Subject: Re: [sane-devel] Response to systemd integration, sane-devel
	Digest,	Vol 91, Issue 12
Message-ID: <CF611594C74E4A9CB0B1857C49651F95 at wat000>
Content-Type: text/plain;	charset="US-ASCII"

Louis,

Thank you.

When I posted the integration tweaks the service complained on startup as
simple with a dbus name.  This was solved with changing the type to dbus.  I
have since settled on type simple and no dbus name, and it's working fine
with no complaining.  

FYI startup and shutdown:

/usr/lib/udev/rules.d/99-local.rules
ENV{ID_VENDOR_ID}=="04a9", ENV{ID_MODEL_ID}=="190a", ACTION=="add",
RUN+="/usr/bin/systemctl start scanbd"
ENV{SUBSYSTEM}=="usb", ENV{ID_PRODUCT_FROM_DATABASE}=="CanoScan LiDE 210",
ACTION=="remove", RUN+="/usr/bin/systemctl stop s$

Had to snoop the messages (udevadm monitor --property) for "remove" to sense
removal properly.

At the time I though scanbm.socket had to be enabled to listen.  I was
wrong.  I've since removed the install section and it works fine.  When
working though this I found out xinetd was no longer necessary (see below
root vs saned).  Archlinuxarm supports socket activation.

In summary,

	scanbd.service startup and shutdown with udev rules (scanbd.service
not enabled)
	scanbm.socket enabled
	monitoring:		saned Ssl /usr/local/sbin/scanbd -f
	net scan:		saned Ssl /usr/local/sbin/scanbd -f
				root  Ss  /usr/local/sbin/scanbm
				root  Ss  saned
	scan by button:	saned Ssl /usr/local/sbin/scanbd -f
				root  S   /bin/bash
/usr/local/etc/scanbd/ccp2pdf.script
				root  S   scanimage --device-name
genesys:libusb:001:008 --resolution ...
	
	xinetd started (e.g. udev rule) and scanbm.socket disabled
	monitoring:		saned Ssl /usr/local/sbin/scanbd -f
				root  Ss  /usr/sbin/xinetd -dontfork
	net scan:		saned Ssl /usr/local/sbin/scanbd -f
				root  Ss  /usr/sbin/xinetd -dontfork
				saned Ss  scanbm
				saned Ss  saned
	scan by button:	saned Ssl /usr/local/sbin/scanbd -f
				root  Ss  /usr/sbin/xinetd -dontfork
				root  S   /bin/bash
/usr/local/etc/scanbd/ccp2pdf.script
				root  S   scanimage --device-name
genesys:libusb:001:008 --resolution ...

With xinetd scanbm and saned run as user saned when scanning via network.

Any thoughts?

R/
Mike





-----Original Message-----
From: sane-devel-bounces+mwatson33=comcast.net at lists.alioth.debian.org
[mailto:sane-devel-bounces+mwatson33=comcast.net at lists.alioth.debian.org] On
Behalf Of sane-devel-request at lists.alioth.debian.org
Sent: Friday, January 11, 2013 7:00 AM
To: sane-devel at lists.alioth.debian.org
Subject: sane-devel Digest, Vol 91, Issue 12


Send sane-devel mailing list submissions to
	sane-devel at lists.alioth.debian.org

To subscribe or unsubscribe via the World Wide Web, visit
	http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
or, via email, send a message with subject or body 'help' to
	sane-devel-request at lists.alioth.debian.org

You can reach the person managing the list at
	sane-devel-owner at lists.alioth.debian.org

When replying, please edit your Subject line so it is more specific than
"Re: Contents of sane-devel digest..."


Today's Topics:

   1. using scanners unable to USB_AUTOSUSPEND (Wilhelm)
   2. Re: using scanners unable to USB_AUTOSUSPEND (Johannes Meixner)
   3. Re: Perfection 610: cannot scan in color (Evil Mr Henry)
   4. Re: Perfection 610: cannot scan in color (Evil Mr Henry)
   5. Re: Scanner Button Daemon [scanbd]: release 1.3 (Louis Lagendijk)
   6. Re: using scanners unable to USB_AUTOSUSPEND (Wilhelm)


----------------------------------------------------------------------

Message: 1
Date: Thu, 10 Jan 2013 16:58:54 +0100
From: Wilhelm <wilhelm.meier at fh-kl.de>
To: <sane-devel at lists.alioth.debian.org>
Subject: [sane-devel] using scanners unable to USB_AUTOSUSPEND
Message-ID: <50EEE53E.5020002 at fh-kl.de>
Content-Type: text/plain; charset="ISO-8859-15"; format=flowed

Hi all,

recently I had problems with my old EPSON 1670 Scanner, because it 
doesn't support usb autosuspend that most distros enable by default in 
the linux kernel. That causes scanimage or other applications (e.g. like 
scanner button daemon scanbd) to freeze or even reading wrong values.

If anyone is interested: I have put some hints in README.txt of scanbd. You
can find it at

http://scanbd.svn.sourceforge.net/viewvc/scanbd/trunk/doc/?sortby=rev

HTH,
-- 
Wilhelm




------------------------------

Message: 2
Date: Thu, 10 Jan 2013 17:29:54 +0100 (CET)
From: Johannes Meixner <jsmeix at suse.de>
To: sane-devel at lists.alioth.debian.org
Subject: Re: [sane-devel] using scanners unable to USB_AUTOSUSPEND
Message-ID: <alpine.LNX.2.00.1301101715290.12362 at nelson.suse.de>
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed


Hello,

On Jan 10 16:58 Wilhelm wrote (excerpt):
> recently I had problems with my old EPSON 1670 Scanner, because it
> doesn't support usb autosuspend that most distros enable by default in 
> the linux kernel. That causes scanimage or other applications (e.g. 
> like scanner
button 
> daemon scanbd) to freeze or even reading wrong values.

If I remember correctly a longer time ago the "usb autosuspend" issue was
discussed on this list.

As a consequence the sane-backends libsane.rules file for udev (it is
/etc/udev/rules.d/55-libsane.rules at least in openSUSE) that is generated
by tools/sane-desc.c in the sane-backends sources
contains:
----------------------------------------------------------------------------
---
# Epson Perfection 1670
ATTR{idVendor}=="04b8", ATTR{idProduct}=="011f", ...
ENV{libsane_matched}="yes" ... # The following rule will disable USB
autosuspend for the device ENV{libsane_matched}=="yes", RUN+="/bin/sh -c
  'if test -e /sys/$env{DEVPATH}/power/control;
   then echo on > /sys/$env{DEVPATH}/power/control;
   elif test -e /sys/$env{DEVPATH}/power/level;
   then echo on > /sys/$env{DEVPATH}/power/level; fi'"
----------------------------------------------------------------------------
---
(the actual udev rules are single long lines - only wrapped here)

Accordingly - if your "EPSON 1670" matches the idVendor/idProduct - it
should get ENV{libsane_matched}="yes" and USB autosuspend should get
disabled for it.

Unfortunately things in udev/sysfs are unstable by design (udev/sysfs is 
primarily meant as a helper tool to do kernel related stuff and not a tool
for application programs - sane-backends ia an application from the kernel
point of view) so that it depends on the kernel and udev version whether or
not udev rules actually work.


Kind Regards
Johannes Meixner
-- 
SUSE LINUX Products GmbH -- Maxfeldstrasse 5 -- 90409 Nuernberg -- Germany
HRB 16746 (AG Nuernberg) GF: Jeff Hawn, Jennifer Guild, Felix Imendoerffer



------------------------------

Message: 3
Date: Thu, 10 Jan 2013 08:43:53 -0800
From: Evil Mr Henry <evilmrhenry at emhsoft.com>
Cc: sane-devel at lists.alioth.debian.org
Subject: Re: [sane-devel] Perfection 610: cannot scan in color
Message-ID: <50EEEFC9.8050806 at emhsoft.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

The -y 297.18 (not --br-y) command works. Thanks for your help.

On 01/08/2013 11:19 PM, Olaf Meeuwissen wrote:
> Evil Mr Henry writes:
>
>> Basically, "scanimage -v -d epson2:libusb:003:005 --format png >
>> outfile.png" works, but "scanimage -v --mode color -d 
>> epson2:libusb:003:005 --format png > outfile.png" throws the classic 
>> "invalid argument"
>
> Shouldn't that be "--mode Color", with a capital C?
>
>> (It is, in fact, an Epson Perfection 610 USB scanner.)
>>
>> This is a new computer; the scanner worked on my old computer in much
>> the same setup.
>
> What version of sane backends and which backend did you use there?
>
>> Running Mint (Ubuntu) 64bit, Sane 1.0.22-7ubuntu1
>>
>> The following is the output after setting "export
>> SANE_DEBUG_EPSON2=255":
>>
>> scanimage -v --mode color -d epson2:libusb:003:005 --format png >
>> outfile.png
>
> I've gone through the log and it's clear from that that this is a bug
> in the epson2 backend.  It fails to take into account the line 
> distance when computing the maximum scan area, leading to a maximum 
> that is too big.  You can work around the issue by using "--br-y 
> 297.18" (i.e. 11.7 inches).
>
> Hope this helps,
>



------------------------------

Message: 4
Date: Thu, 10 Jan 2013 08:48:53 -0800
From: Evil Mr Henry <evilmrhenry at emhsoft.com>
Cc: sane-devel at lists.alioth.debian.org
Subject: Re: [sane-devel] Perfection 610: cannot scan in color
Message-ID: <50EEF0F5.302 at emhsoft.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Also, for anyone else with this problem, this works in XSane when I set 
the scan size to DIN A4 port.

On 01/08/2013 11:19 PM, Olaf Meeuwissen wrote:
> Evil Mr Henry writes:
>
>> Basically, "scanimage -v -d epson2:libusb:003:005 --format png >
>> outfile.png" works, but "scanimage -v --mode color -d 
>> epson2:libusb:003:005 --format png > outfile.png" throws the classic 
>> "invalid argument"
>
> Shouldn't that be "--mode Color", with a capital C?
>
>> (It is, in fact, an Epson Perfection 610 USB scanner.)
>>
>> This is a new computer; the scanner worked on my old computer in much
>> the same setup.
>
> What version of sane backends and which backend did you use there?
>
>> Running Mint (Ubuntu) 64bit, Sane 1.0.22-7ubuntu1
>>
>> The following is the output after setting "export
>> SANE_DEBUG_EPSON2=255":
>>
>> scanimage -v --mode color -d epson2:libusb:003:005 --format png >
>> outfile.png
>
> I've gone through the log and it's clear from that that this is a bug
> in the epson2 backend.  It fails to take into account the line 
> distance when computing the maximum scan area, leading to a maximum 
> that is too big.  You can work around the issue by using "--br-y 
> 297.18" (i.e. 11.7 inches).
>
> Hope this helps,
>



------------------------------

Message: 5
Date: Thu, 10 Jan 2013 22:53:37 +0100
From: Louis Lagendijk <louis at fazant.net>
To: sane-devel at lists.alioth.debian.org
Subject: Re: [sane-devel] Scanner Button Daemon [scanbd]: release 1.3
Message-ID: <1357854817.1645.19.camel at travel.pheasant>
Content-Type: text/plain; charset="ISO-8859-15"

On Sun, 2013-01-06 at 15:25 -0500, Michael Watson wrote:
> Thank you.
> 
> I have 1.3 working on archlinuxarm (systemd).  Please find below
> "integration" tweaks:
> 
> ------------------------------------------------------
> /usr/lib/systemd/system/scanbd.service
> #Type=simple
> # dbus
> Type=dbus

I would recommend against changing the Type to dbus. That will 
result in scanbm triggering starting of scanbd. It is not required for
scanbm that scanb is running. In my own copy I have removed the 
BusName line from scanbd.service instead. It is superfluous.

> ------------------------------------------------------
> /usr/lib/systemd/system/scanbm at .service
> # required for systemctl enable scanbm@
> [Install]
> WantedBy=multi-user.target
> 
No this is wrong! scanbm.socket should be enabled and started and 
that triggers scanbm at .service when you use the scanner using the 
net backend from the client application. 
Scanbm.service should NOT have an install section.
 
> #/etc/systemd/system/multi-user.target.wants/scanbm at .service ->
> /usr/lib/systemd/system/scanbm at .service
> ------------------------------------------------------
> /etc/xinetd.d/sane
> service sane-port
> {
>         port        = 6566
>         socket_type = stream
>         wait        = no
>         user        = saned
>         group       = scanner
>         server      = /usr/local/sbin/scanbm
> 	  #not sure if this is required
>         server_args = scanbm
>         # disabled by default!
>         disable     = no
> }
Using systemd with scanbm.socket should take care of handling the socket on 
port 6566. I don't even have (x)inetd installed. scanbm.socket does the
above for you and tells systemd to start scanbm.service when you scan using
the net backend from your application.

The above of course assumes a complete systemd that does replace (x)inetd.
Does systemd on ArchLinux support socket activation? Kind regards, Louis




------------------------------

Message: 6
Date: Fri, 11 Jan 2013 08:42:51 +0100
From: Wilhelm <wilhelm.meier at fh-kl.de>
To: Johannes Meixner <jsmeix at suse.de>
Cc: sane-devel at lists.alioth.debian.org
Subject: Re: [sane-devel] using scanners unable to USB_AUTOSUSPEND
Message-ID: <50EFC27B.9020400 at fh-kl.de>
Content-Type: text/plain; charset="ISO-8859-1"; format=flowed

Am 10.01.2013 17:29, schrieb Johannes Meixner:
>
> Hello,
>
> On Jan 10 16:58 Wilhelm wrote (excerpt):
>> recently I had problems with my old EPSON 1670 Scanner, because it
>> doesn't support usb autosuspend that most distros enable by default 
>> in the linux kernel. That causes scanimage or other applications 
>> (e.g. like scanner button daemon scanbd) to freeze or even reading 
>> wrong values.
>
> If I remember correctly a longer time ago the "usb autosuspend" issue
> was discussed on this list.
>
> As a consequence the sane-backends libsane.rules file for udev (it is
> /etc/udev/rules.d/55-libsane.rules at least in openSUSE) that is 
> generated by tools/sane-desc.c in the sane-backends sources
> contains:
> ----------------------------------------------------------------------
> ---------
>
> # Epson Perfection 1670
> ATTR{idVendor}=="04b8", ATTR{idProduct}=="011f", ...
> ENV{libsane_matched}="yes" ... # The following rule will disable USB 
> autosuspend for the device ENV{libsane_matched}=="yes", RUN+="/bin/sh 
> -c
>   'if test -e /sys/$env{DEVPATH}/power/control;
>    then echo on > /sys/$env{DEVPATH}/power/control;
>    elif test -e /sys/$env{DEVPATH}/power/level;
>    then echo on > /sys/$env{DEVPATH}/power/level; fi'"
>
----------------------------------------------------------------------------
---
>
> (the actual udev rules are single long lines - only wrapped here)
>
> Accordingly - if your "EPSON 1670" matches the idVendor/idProduct - it
> should get ENV{libsane_matched}="yes" and USB autosuspend should get 
> disabled for it.

Thanks for the hint! Must have missed the entry ...

But: I'm on ubuntu 12.04 and here I have the effect that after plugging 
in the scanner it remains for about 500ms in the state "on" and then 
falls back to "auto". So I moved 40-libsane.rules to 99-libsane.rules 
and it is ok. Well, now I have to figure out the offending rule(s) ...

>
> Unfortunately things in udev/sysfs are unstable by design (udev/sysfs
> is primarily meant as a helper tool to do kernel related stuff and not 
> a tool for application programs - sane-backends ia an application from 
> the kernel point of view) so that it depends on the kernel and udev 
> version whether or not udev rules actually work.
>
>
> Kind Regards
> Johannes Meixner


-- 
Wilhelm




------------------------------

_______________________________________________
sane-devel mailing list
sane-devel at lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel

End of sane-devel Digest, Vol 91, Issue 12
******************************************




------------------------------

Message: 2
Date: Fri, 11 Jan 2013 15:28:47 +0100
From: Louis Lagendijk <louis at fazant.net>
To: sane-devel at lists.alioth.debian.org
Subject: Re: [sane-devel] Response to systemd integration, sane-devel
	Digest, Vol 91, Issue 12
Message-ID: <1357914527.3590.13.camel at travel.pheasant>
Content-Type: text/plain; charset="ISO-8859-15"

On Fri, 2013-01-11 at 08:38 -0500, Michael Watson wrote:
> Louis,
> 
> Thank you.
> 
> When I posted the integration tweaks the service complained on startup 
> as simple with a dbus name.  This was solved with changing the type to 
> dbus.  I have since settled on type simple and no dbus name, and it's 
> working fine with no complaining.
> 
> FYI startup and shutdown:
> 
> /usr/lib/udev/rules.d/99-local.rules
> ENV{ID_VENDOR_ID}=="04a9", ENV{ID_MODEL_ID}=="190a", ACTION=="add",
> RUN+="/usr/bin/systemctl start scanbd"
> ENV{SUBSYSTEM}=="usb", ENV{ID_PRODUCT_FROM_DATABASE}=="CanoScan LiDE 
> 210", ACTION=="remove", RUN+="/usr/bin/systemctl stop s$
> 
> Had to snoop the messages (udevadm monitor --property) for "remove" to 
> sense removal properly.
This is a very nice add-on. I will have a look at it to see if this would
work for me to. I will add it to the systemd integration directory

> 
> At the time I though scanbm.socket had to be enabled to listen.  I was
> wrong.  I've since removed the install section and it works fine.  
> When working though this I found out xinetd was no longer necessary 
> (see below root vs saned).  Archlinuxarm supports socket activation.
> 
ok, good to see that there is consistency over different platforms and
systemd versions. Thanks for the report
> In summary,
> 
> 	scanbd.service startup and shutdown with udev rules (scanbd.service
> not enabled)
Sounds pretty good.
> 	scanbm.socket enabled
> 	monitoring:		saned Ssl /usr/local/sbin/scanbd -f
> 	net scan:		saned Ssl /usr/local/sbin/scanbd -f
> 				root  Ss  /usr/local/sbin/scanbm
> 				root  Ss  saned
> 	scan by button:	saned Ssl /usr/local/sbin/scanbd -f
> 				root  S   /bin/bash
> /usr/local/etc/scanbd/ccp2pdf.script
> 				root  S   scanimage --device-name
Looks ok.

> genesys:libusb:001:008 --resolution ...
> 	
> 	xinetd started (e.g. udev rule) and scanbm.socket disabled
> 	monitoring:		saned Ssl /usr/local/sbin/scanbd -f
> 				root  Ss  /usr/sbin/xinetd -dontfork
> 	net scan:		saned Ssl /usr/local/sbin/scanbd -f
> 				root  Ss  /usr/sbin/xinetd -dontfork
> 				saned Ss  scanbm
> 				saned Ss  saned
> 	scan by button:	saned Ssl /usr/local/sbin/scanbd -f
> 				root  Ss  /usr/sbin/xinetd -dontfork
> 				root  S   /bin/bash
I am not sure I understand this part: what do you use xinetd for? For scanbd
it is not used at all, right? Is xinetd started by dbus on scanner
detection? 
/systemd scanbm.socket does all you need for starting scanbm/saned for
scanning.

> /usr/local/etc/scanbd/ccp2pdf.script
> 				root  S   scanimage --device-name
> genesys:libusb:001:008 --resolution ...
> 
> With xinetd scanbm and saned run as user saned when scanning via
> network.
> 
scanbd runs as the usert set in scanbd.conf, I need to check how this works
for scanbm right now. I will check later this weekend, but I guess that User
and Group are missing in scanbm at .service. My bad. I will investigate this a
bit further and update the examples in the svn repository Kind regards,
Louis




------------------------------

Message: 3
Date: Fri, 11 Jan 2013 16:56:38 +0100
From: Rolf Bensch <rolf at bensch-online.de>
To: Patrick Viola <pviola78 at googlemail.com>
Cc: Sane Development <sane-devel at lists.alioth.debian.org>
Subject: Re: [sane-devel] Support for Canon Pixma MG5100 Series
Message-ID: <50F03636.7090800 at bensch-online.de>
Content-Type: text/plain; charset=ISO-8859-1

Hi Patrick,

I have no idea about your sine-find-scanner problem. Maybe somebody else on
the ml has an idea?

A complete pnm scan @ 1200 dpi should work without any problem.

Please try to fetch a copy from git and install sane 1.0.24. The
installation is described in README.linux.

Cheers,
Rolf


Am 09.01.2013 16:46, schrieb Patrick Viola:
> Hi,
> 
> I used the command like 
>     scanimage -p --resolution=1200dpi --format=tiff -l 0mm -t 0mm -x
> 2mm -y 2mm  > ~/test_1200_small.tiff 2>/tmp/pixma.log to scan the pci 
> now.
> 
> Attached are the two debug-logs. pixma.log is the tiff one.
> 
> 
> This time it works. Last time I try to scan the whole area. May that's
> to big for pnm? Not sure about that. But sane-find-scanner still does 
> not find the scanner.
> 
> 
> 
> 2013/1/9 Rolf Bensch <rolf at bensch-online.de
> <mailto:rolf at bensch-online.de>>
> 
>     Hi Patrick,
> 
>     I cannot see any differences between the two 1200dpi scans. Please
>     create some debug output of a 1200dpi tiff scan and of a pnm scan.
> 
>     You can enable debug output on the command line with 'export
>     SANE_DEBUG_PIXMA=11'.
> 
>     To reduce debug output size, please scan a small area of 2mm x
> 2mm.
> 
>     Cheers,
>     Rolf
> 
> 
> 
>     Am 08.01.2013 14:23, schrieb Patrick Viola:
>     > ok here the results
>     >
>     > The Version string is: scanimage (sane-backends) 1.0.23; backend
>     version
>     > 1.0.23
>     >
>     >
>     > I can do a scan with 1200dpi, but only tiff format. If I try pnm,
>     I get
>     > an I/O Error
>     >     scanimage: sane_read: Error during device I/O
>     >
>     >
>     >
>     > 2013/1/8 Rolf Bensch <rolf at bensch-online.de
>     <mailto:rolf at bensch-online.de> <mailto:rolf at bensch-online.de
>     <mailto:rolf at bensch-online.de>>>
>     >
>     >     Hi Patrick,
>     >
>     >     Please send the output from 'scanimage -V' and please try a
>     1200 dpi
>     >     scan.
>     >
>     >     It could be easier for you to use xsane in ubuntu. In xsane
>     you can
>     >     check the used sane version with CTRL - i.
>     >
>     >     Before you can use SaneTwain on a Windows machine you must
>     have made
>     >     saned running on your linux server.
>     >
>     >     Cheers,
>     >     Rolf
>     >
>     >
>     >     Am 07.01.2013 20:04, schrieb Patrick Viola:
>     >     > Hi,
>     >     > I now own a Canon Pixma MG5150.
>     >     >
>     >     > It works under Ubuntu and can scan a Image with something like
>     >     > "scanimage -p --resolution auto --format=tiff > ~/test.tiff".
>     >     > But sane-find-scanner did not find the scanner and also I
>     can not find
>     >     > any device with Windows SaneTwain.
>     >     >
>     >     >
>     >     > May somebody can help me, or kick me to the right mailling
list?
>     >     > Its ok for me to be a tester ;-)
>     >     >
>     >     > Oh here the output of "scanimage -L"
>     >     >
>     >     > device `pixma:04A91748_5047F6' is a CANON Canon PIXMA MG5100
>     >     > multi-function peripheral
>     >     >
>     >     >
>     >     > Kind regards
>     >     >  ~Patrick
>     >
>     >
>     >
>     >
>     > --
>     >
>     > Patrick Viola
>     > Postfach 101326
>     > 51313 Leverkusen
>     > Mobil: 0178-6344405
> 
> 
> 
> 
> --
> 
> Patrick Viola
> Postfach 101326
> 51313 Leverkusen
> Mobil: 0178-6344405



------------------------------

Message: 4
Date: Fri, 11 Jan 2013 19:48:12 +0100
From: Louis Lagendijk <louis at fazant.net>
To: sane-devel at lists.alioth.debian.org
Subject: Re: [sane-devel] Scanbd and /etc/sane.d
Message-ID: <1357930092.9943.27.camel at travel.pheasant>
Content-Type: text/plain; charset="ISO-8859-15"

I am sorry for the long post, but I am afraid that I need to provide a lot
of background.

The issues
------------
As you may recall I am packaging scanbd for Fedora. There are a few 
issues that make this a bit challenging:

1) In order to create a good user experience, I want the package to
configure the system as much as possible without any user intervention. The
sane configuration is giving me a bit of a head ache here. In the ideal
situation I would add a few files to the system and 
everything works out of the box. 
This is where dll.conf is giving me problems: user scanning apps 
require a dll.conf that has only the net backend listed, scanbd (or 
saned for that matter) need the normal dll.conf. 
With rpm I can not do this, as the scanner apps use the 
sane.d/dll.conf file. So I would need to change this. Changing files 
owned by other rpms if not allowed -> checkmate.

2) Even when I solve this, sanner aps would still inherit all the 
backends listed in one of the files in the sane.d.dll.d directory. 
But that is not what I need, but I can't see a way to control this, 
other then removing these files. But these files are owned by other 
rpms and will get re-added when the packages are updated or 
additional ones added, I have no way of controlling this-> 
check mate again

The other thing is for the daemon I can set an own SANE_CONFIG_DIR, but then
I need to copy all backend config files as well, OR set SANE_CONFIG_DIR with
a terminating dir separator so that backend configuration files get searched
in the standard search path as well. This will work but it is not exactly
intuitive.

It would be very nice if we could keep all configuration in one place: the
normal sane.d directory.

My proposal:
------------
I have written a patch to dll.c that tries to load a <prefix>-dll.conf
before it tries to load dll.conf. 
The prefix can be set with a new environment variable SANE_DLL_PREFIX. The
prefix defaults to "default" (so we try to load 
default-dll.conf) unless SANE_DLL_PREFIX environment variable is set). 

If <prefix>-dll.conf exists anywhere in the search path it gets used. 

If it does not exist, we fallback to dll.conf. 

With this patch, the distribtion's sane package is expected to ship 
with only dll.conf. As no xxx-dll.conf files exist, the standard 
dll.conf gets used in all cases. 

If we now install a package that needs different dll.conf files, it drops
two new dll.con files in sane.d: default-dll.conf (with probably only the
net backend) and scanbd-dll.conf (or saned-dll.conf) which is as symbolic
link to dll.conf and get used for scanbd and/or saned.

This works nicely, except for the loading of the files in dll.d. This is
unfortunately hard coded in dll.c. I have added a directive @dll.d that can
be included in dll.conf to trigger the reading of files in dll.d. 
So where-ever dll.conf contains a @dlld directive the directory gets
searched and any configuration files in there get processed.


I personally prefer option a, but I am unhappy about the incompatibility
this gives. But option b gives slightly different semantics for dll.conf and
<prefix>-dll.conf. That is maybe even worse. 

This mechanism could be used for saned too. I envisage that saned gets
packaged separately and would add default-dll.conf for users with only the
net backend and  saned-dll.conf as a symbolic link to dll.conf.  

Other suggestions
------------------
I have tried to start a discussion on this before. 
Wilhem then suggested the following:
> I can imagine to more alternatives:
> 
> 1) use env-var SANE_CONFIG_FILE for getting the filename of the real 
> dll.conf in the SANE_CONFIG_DIR
> 
This could be done if you people prefer so, I used <prefix>-dll.conf as that
is more intuitive in my opinion. But this is in itself just a small
variation on the implementation as described above.

> 2) add a function to the programming interface to set the name / dir
> for
> the config-file (sane_init)
> 
This would be different from the mechanism used for SANE_CONFIG_DIR, so I
regard it less desirable. It would also require changes to saned as saned
would also want to use this mechanism.

Conclusions/ questions
-----------------------
I propose to go for 1a and update our standard dll.conf with @dll.d as the
first line, but I have 2 questions:

1) are you ok with the approach described here?
2) if so, how do you prefer we handle the dll.d directory:
   a) change the default dll.conf to include @dlld
   b) honour @dll.d where it occurs, but still hardcode it in case we are
      using dll.conf?

Comments? Does anybody have better suggestions? 
I believe that a solution to this issue is desirable so it becomes much
easier for distributions to  ship a pre-configured saned too.

Looking forward to your feedback as  I do not want to create an
incompatibility without discussion on the list here. Louis





------------------------------

_______________________________________________
sane-devel mailing list
sane-devel at lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel

End of sane-devel Digest, Vol 91, Issue 13
******************************************




------------------------------

_______________________________________________
sane-devel mailing list
sane-devel at lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel

End of sane-devel Digest, Vol 91, Issue 14
******************************************




More information about the sane-devel mailing list