[sane-devel] Scanner Button Daemon [scanbd]: high CPU utilization

2011-11-25 Thread Wilhelm
Hi David,

Am 24.11.2011 21:49, schrieb Rastislav David:
 Hello all,

 I've succesfully compiled scanbd for my Canon CanoScan LiDE 110 on my
 ARM powered NAS Linksys DNS-323 running Debian Wheezy.

 It works :) however there are few issues.
 1) scanbd is using 100% of CPU load and thus misses some button presses

looks like a config problem: please post your scanbd.conf

 2) does not react on Pdf button (nothing logged into console when
 pressed) There are 4 buttons. [Pdf Auto-Scan Copy Email]

we must check the log-file to find out the name of the pdf-button


 If I start daemon with: ./scanbd -df -c scanbd.conf

 I see:

 ./scanbd: debug on: level: 7
 ./scanbd: dropping privs to uid saned
 ./scanbd: dropping privs to uid scanner
 ./scanbd: group scanner has member:
 ./scanbd: saned
 ./scanbd: drop privileges to gid: 104
 ./scanbd: Running as effective gid 104
 ./scanbd: drop privileges to uid: 110
 ./scanbd: Running as effective uid 110
 ./scanbd: dbus_init
 ./scanbd: dbus match type='signal',interface='org.freedesktop.Hal.Manager'
 ./scanbd: sane version 1.0
 ./scanbd: Scanning for local-only devices
 ./scanbd: found device: genesys:libusb:001:011 Canon LiDE 110 flatbed
 scanner
 ./scanbd: start_sane_threads
 ./scanbd: Starting poll thread for genesys:libusb:001:011
 ./scanbd: Thread started for device genesys:libusb:001:011
 ./scanbd: sane_poll
 ./scanbd: start udev thread
 ./scanbd: timeout: 400 ms
 ./scanbd: udev thread started
 ./scanbd: Iteration on dbus call
 ./scanbd: no device from udev
 ./scanbd: no device from udev
 
 300x / second
 ./scanbd: no device from udev
 ./scanbd: no device from udev
 ./scanbd: no device from udev
 ./scanbd: no device from udev
 ./scanbd: no device from udev
 ./scanbd: found 41 options for device genesys:libusb:001:011
 ./scanbd: sane_find_matching_options
 ./scanbd: found 5 actions in section (null)
 ./scanbd: checking action scan with filter: ^scan.*
 ./scanbd: found active option[2] mode (type: 3) for device
 genesys:libusb:001:01
 1
 ./scanbd: found active option[4] preview (type: 0) for device
 genesys:libusb:001
 :011
 ./scanbd: found active option[5] depth (type: 1) for device
 genesys:libusb:001:0
 11
 ./scanbd: found active option[6] resolution (type: 1) for device
 genesys:libusb:
 001:011
 ./scanbd: found active option[8] tl-x (type: 2) for device
 genesys:libusb:001:01
 1
 ./scanbd: found active option[9] tl-y (type: 2) for device
 genesys:libusb:001:01
 1
 ./scanbd: found active option[10] br-x (type: 2) for device
 genesys:libusb:001:011
 ./scanbd: found active option[11] br-y (type: 2) for device
 genesys:libusb:001:011


 these no device from udev messages are generated about 300/s which I
 think is causing high CPU utilization.

That's strange: did not see this before :-(


 in scandb.conf I left all devices as they were and for actions scan
 email and copy I've changed script to /etc/scanbd/action.script.
 This script works fine for said 3 buttons.

 Can You help where could be the issue with High CPU utilization?
 Is there some problem with configuration?

I think this has to to with the libudev. You can disable libudev at 
compile-time (and using hald if you want) loosing the capability to 
dynamically add scanners. Can you give this a try, please?


 Rastislav

 P.S: for scanbd to compile I had to change
 -I/usr/local/include/dbus-1.0/include to
 -I/usr/lib/arm-linux-gnueabi/dbus-1.0/include





-- 
Wilhelm




[sane-devel] Scanner Button Daemon [scanbd]: high CPU utilization

2011-11-25 Thread Rastislav David
Hello Wilhelm,

thank You for responding so quickly.

I've closed point 2) where I've found that button called Pdf is found with 
filter file.

I've attached scanbd.conf in my last email but I guess it didn't go through.

Here is scanbd.conf I'm using now:

global {
debug   = true
debug-level = 1
user= saned
group   = scanner
saned   = /usr/sbin/saned
saned_opt  = {}
saned_env  = { SANE_CONFIG_DIR=/etc/scanbd }
scanbuttond_backends_dir = /usr/local/etc/scanbd/scanbuttond/backends
timeout = 400
pidfile = /var/run/scanbd.pid
environment {
device = SCANBD_DEVICE
action = SCANBD_ACTION
}
function function_knob {
filter = ^message.*
desc   = The value of the function knob / wheel / selector
env= SCANBD_FUNCTION
}
function function_mode {
filter = ^mode.*
desc   = Color mode
env= SCANBD_FUNCTION_MODE
}
multiple_actions = true
action scan {
filter = ^scan.*
numerical-trigger {
from-value = 1
to-value   = 0
}
desc   = Scan to file
script = /etc/scanbd/action.script
}
action email {
filter = ^email$
string-trigger {
from-value  = 
to-value= ^email.*
}
desc   = Scan to email
script = /etc/scanbd/action.script
}
action copy {
filter = ^copy$
string-trigger {
from-value  = 
to-value= ^copy.*
}
desc   = Copy to printer
script = /etc/scanbd/test.script
}
action pdf {
filter = ^file$
numerical-trigger {
from-value = 1
to-value   = 0
}
desc   = Pdf
script = /etc/scanbd/action.script
}
action preview {
filter = ^preview$
numerical-trigger {
from-value = 1
to-value   = 0
}
desc   = Preview
script = /etc/scanbd/action.script
}
action globaltest {
 filter = ^message.*
 desc   = Test (print all env vars)
 script = /etc/scanbd/test.script
}
}
device fujitsu {
   filter = ^fujitsu.*
   desc = Fujitsu: Test
   function function_knob {
filter = ^function.*
desc   = The value of the function knob / wheel / selector
env= SCANBD_FUNCTION
   }
   action paperload {
filter = ^page-loaded.*
desc   = page loaded
numerical-trigger {
from-value = 0
to-value   = 1
}
script = 
   }
   action paperunload {
filter = ^page-loaded.*
desc   = page unloaded
numerical-trigger {
from-value = 1
to-value   = 0
}
script = 
  }
   action coveropen {
filter = ^cover-open.*
desc   = cover open
numerical-trigger {
from-value = 0
to-value   = 1
}
script = 
   }
   action powersave {
filter = ^power-save.*
desc   = power save
numerical-trigger {
from-value = 0
to-value   = 1
}
script = 
   }
}
device snapscan {
   filter = (.*snapscan.*|.*Perfection.*)
   desc = Epson
   action test {
  filter = ^message.*
  desc   = Test
  script = /usr/local/etc/scanbd/example.script
   }
   action web {
  filter = ^web.*
  desc   = Web
  script = /usr/local/etc/scanbd/example.script
   }
   action send {
  filter = ^send.*
  desc   = Send
  script = /usr/local/etc/scanbd/example.script
   }
}
device hp {
   filter = ^hpaio.*
   desc = HP
   action test {
  filter = .*scan.*
  desc   = Test
  script = /usr/local/etc/scanbd/example.script
   }
}
device avision {
   filter = ^avision.*
   desc = Avision 

[sane-devel] Scanner Button Daemon [scanbd]: high CPU utilization

2011-11-25 Thread Simon Matter
 Hi David,

 Am 24.11.2011 21:49, schrieb Rastislav David:
 Hello all,

 I've succesfully compiled scanbd for my Canon CanoScan LiDE 110 on my
 ARM powered NAS Linksys DNS-323 running Debian Wheezy.

 It works :) however there are few issues.
 1) scanbd is using 100% of CPU load and thus misses some button presses

Hi,

I remember that running my own scanmonitor (which also does button
handling) I observed strange behavior when running against my cheap
plustek backed Epson scanner. The issue was also high CPU load and I never
found out why, what I know is that other scanners like the Fujitsu fi-6x
series never had such problems.

Maybe this is related here with scanbd and the genesys backend?

Regards,
Simon


 looks like a config problem: please post your scanbd.conf

 2) does not react on Pdf button (nothing logged into console when
 pressed) There are 4 buttons. [Pdf Auto-Scan Copy Email]

 we must check the log-file to find out the name of the pdf-button


 If I start daemon with: ./scanbd -df -c scanbd.conf

 I see:

 ./scanbd: debug on: level: 7
 ./scanbd: dropping privs to uid saned
 ./scanbd: dropping privs to uid scanner
 ./scanbd: group scanner has member:
 ./scanbd: saned
 ./scanbd: drop privileges to gid: 104
 ./scanbd: Running as effective gid 104
 ./scanbd: drop privileges to uid: 110
 ./scanbd: Running as effective uid 110
 ./scanbd: dbus_init
 ./scanbd: dbus match
 type='signal',interface='org.freedesktop.Hal.Manager'
 ./scanbd: sane version 1.0
 ./scanbd: Scanning for local-only devices
 ./scanbd: found device: genesys:libusb:001:011 Canon LiDE 110 flatbed
 scanner
 ./scanbd: start_sane_threads
 ./scanbd: Starting poll thread for genesys:libusb:001:011
 ./scanbd: Thread started for device genesys:libusb:001:011
 ./scanbd: sane_poll
 ./scanbd: start udev thread
 ./scanbd: timeout: 400 ms
 ./scanbd: udev thread started
 ./scanbd: Iteration on dbus call
 ./scanbd: no device from udev
 ./scanbd: no device from udev
 
 300x / second
 ./scanbd: no device from udev
 ./scanbd: no device from udev
 ./scanbd: no device from udev
 ./scanbd: no device from udev
 ./scanbd: no device from udev
 ./scanbd: found 41 options for device genesys:libusb:001:011
 ./scanbd: sane_find_matching_options
 ./scanbd: found 5 actions in section (null)
 ./scanbd: checking action scan with filter: ^scan.*
 ./scanbd: found active option[2] mode (type: 3) for device
 genesys:libusb:001:01
 1
 ./scanbd: found active option[4] preview (type: 0) for device
 genesys:libusb:001
 :011
 ./scanbd: found active option[5] depth (type: 1) for device
 genesys:libusb:001:0
 11
 ./scanbd: found active option[6] resolution (type: 1) for device
 genesys:libusb:
 001:011
 ./scanbd: found active option[8] tl-x (type: 2) for device
 genesys:libusb:001:01
 1
 ./scanbd: found active option[9] tl-y (type: 2) for device
 genesys:libusb:001:01
 1
 ./scanbd: found active option[10] br-x (type: 2) for device
 genesys:libusb:001:011
 ./scanbd: found active option[11] br-y (type: 2) for device
 genesys:libusb:001:011


 these no device from udev messages are generated about 300/s which I
 think is causing high CPU utilization.

 That's strange: did not see this before :-(


 in scandb.conf I left all devices as they were and for actions scan
 email and copy I've changed script to /etc/scanbd/action.script.
 This script works fine for said 3 buttons.

 Can You help where could be the issue with High CPU utilization?
 Is there some problem with configuration?

 I think this has to to with the libudev. You can disable libudev at
 compile-time (and using hald if you want) loosing the capability to
 dynamically add scanners. Can you give this a try, please?


 Rastislav

 P.S: for scanbd to compile I had to change
 -I/usr/local/include/dbus-1.0/include to
 -I/usr/lib/arm-linux-gnueabi/dbus-1.0/include





 --
 Wilhelm


 --
 sane-devel mailing list: sane-devel at 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-request at lists.alioth.debian.org






[sane-devel] Scanner Button Daemon [scanbd]: high CPU utilization

2011-11-25 Thread Wilhelm
Hi Rastislav,

(sorry for calling you wrong last time)

Am 25.11.2011 10:35, schrieb Rastislav David:
 Hello Wilhelm,

 thank You for responding so quickly.

you're welcome


 I've closed point 2) where I've found that button called Pdf is found with 
 filter file.

good to here!

 I've attached scanbd.conf in my last email but I guess it didn't go through.

looks good.

I think there problem is, that with debian-testing we get a new libudev 
with a non-blocking behaviour for the udev_monitor_receive_device() 
function.

I'll fix that upstream, when I discover how to switch back to the 
blocking behaviour.

In the mean time you can compile sanbd without libudev as said in the 
last email.

So, stay tuned.


 Here is scanbd.conf I'm using now:

 global {
  debug   = true
  debug-level = 1
  user= saned
  group   = scanner
  saned   = /usr/sbin/saned
  saned_opt  = {}
  saned_env  = { SANE_CONFIG_DIR=/etc/scanbd }
  scanbuttond_backends_dir = 
 /usr/local/etc/scanbd/scanbuttond/backends
  timeout = 400
  pidfile = /var/run/scanbd.pid
  environment {
  device = SCANBD_DEVICE
  action = SCANBD_ACTION
  }
  function function_knob {
  filter = ^message.*
  desc   = The value of the function knob / wheel / selector
  env= SCANBD_FUNCTION
  }
  function function_mode {
  filter = ^mode.*
  desc   = Color mode
  env= SCANBD_FUNCTION_MODE
  }
  multiple_actions = true
  action scan {
  filter = ^scan.*
  numerical-trigger {
  from-value = 1
  to-value   = 0
  }
  desc   = Scan to file
  script = /etc/scanbd/action.script
  }
  action email {
  filter = ^email$
  string-trigger {
  from-value  = 
  to-value= ^email.*
  }
  desc   = Scan to email
  script = /etc/scanbd/action.script
  }
  action copy {
  filter = ^copy$
  string-trigger {
  from-value  = 
  to-value= ^copy.*
  }
  desc   = Copy to printer
  script = /etc/scanbd/test.script
  }
  action pdf {
  filter = ^file$
  numerical-trigger {
  from-value = 1
  to-value   = 0
  }
  desc   = Pdf
  script = /etc/scanbd/action.script
  }
  action preview {
  filter = ^preview$
  numerical-trigger {
  from-value = 1
  to-value   = 0
  }
  desc   = Preview
  script = /etc/scanbd/action.script
  }
  action globaltest {
   filter = ^message.*
   desc   = Test (print all env vars)
   script = /etc/scanbd/test.script
  }
 }
 device fujitsu {
 filter = ^fujitsu.*
 desc = Fujitsu: Test
 function function_knob {
  filter = ^function.*
  desc   = The value of the function knob / wheel / selector
  env= SCANBD_FUNCTION
 }
 action paperload {
  filter = ^page-loaded.*
  desc   = page loaded
  numerical-trigger {
  from-value = 0
  to-value   = 1
  }
  script = 
 }
 action paperunload {
  filter = ^page-loaded.*
  desc   = page unloaded
  numerical-trigger {
  from-value = 1
  to-value   = 0
  }
  script = 
}
 action coveropen {
  filter = ^cover-open.*
  desc   = cover open
  numerical-trigger {
  from-value = 0
  to-value   = 1
  }
  script = 
 }
 action powersave {
  filter = ^power-save.*
  desc   = power save
  numerical-trigger {
  from-value = 0
  to-value   = 1
  }
  script = 
 }
 }
 device snapscan {
 filter = (.*snapscan.*|.*Perfection.*)
  

[sane-devel] Scanner Button Daemon [scanbd]: high CPU utilization

2011-11-25 Thread Rastislav David

- Wilhelm wilhelm.meier at fh-kl.de wrote:
 Hi Rastislav,
 
 (sorry for calling you wrong last time)
 
 Am 25.11.2011 10:35, schrieb Rastislav David:
  Hello Wilhelm,
 
  thank You for responding so quickly.
 
 you're welcome
 
 
  I've closed point 2) where I've found that button called Pdf is found with 
  filter file.
 
 good to here!
 
  I've attached scanbd.conf in my last email but I guess it didn't go through.
 
 looks good.
 
 I think there problem is, that with debian-testing we get a new libudev 
 with a non-blocking behaviour for the udev_monitor_receive_device() 
 function.
 
 I'll fix that upstream, when I discover how to switch back to the 
 blocking behaviour.
 
 In the mean time you can compile sanbd without libudev as said in the 
 last email.

Yes.
Compiled without UDEV and HAL now scanbd works as expected. 
scanbd is now behaving nicely with prety low CPU utilization :)

Your guess at libdev was most likely correct.

 
 So, stay tuned.

Fingers crossed.

 
 
  Here is scanbd.conf I'm using now:
 
  global {
   debug   = true
   debug-level = 1
   user= saned
   group   = scanner
   saned   = /usr/sbin/saned
   saned_opt  = {}
   saned_env  = { SANE_CONFIG_DIR=/etc/scanbd }
   scanbuttond_backends_dir = 
  /usr/local/etc/scanbd/scanbuttond/backends
   timeout = 400
   pidfile = /var/run/scanbd.pid
   environment {
   device = SCANBD_DEVICE
   action = SCANBD_ACTION
   }
   function function_knob {
   filter = ^message.*
   desc   = The value of the function knob / wheel / 
  selector
   env= SCANBD_FUNCTION
   }
   function function_mode {
   filter = ^mode.*
   desc   = Color mode
   env= SCANBD_FUNCTION_MODE
   }
   multiple_actions = true
   action scan {
   filter = ^scan.*
   numerical-trigger {
   from-value = 1
   to-value   = 0
   }
   desc   = Scan to file
   script = /etc/scanbd/action.script
   }
   action email {
   filter = ^email$
   string-trigger {
   from-value  = 
   to-value= ^email.*
   }
   desc   = Scan to email
   script = /etc/scanbd/action.script
   }
   action copy {
   filter = ^copy$
   string-trigger {
   from-value  = 
   to-value= ^copy.*
   }
   desc   = Copy to printer
   script = /etc/scanbd/test.script
   }
   action pdf {
   filter = ^file$
   numerical-trigger {
   from-value = 1
   to-value   = 0
   }
   desc   = Pdf
   script = /etc/scanbd/action.script
   }
   action preview {
   filter = ^preview$
   numerical-trigger {
   from-value = 1
   to-value   = 0
   }
   desc   = Preview
   script = /etc/scanbd/action.script
   }
   action globaltest {
filter = ^message.*
desc   = Test (print all env vars)
script = /etc/scanbd/test.script
   }
  }
  device fujitsu {
  filter = ^fujitsu.*
  desc = Fujitsu: Test
  function function_knob {
   filter = ^function.*
   desc   = The value of the function knob / wheel / 
  selector
   env= SCANBD_FUNCTION
  }
  action paperload {
   filter = ^page-loaded.*
   desc   = page loaded
   numerical-trigger {
   from-value = 0
   to-value   = 1
   }
   script = 
  }
  action paperunload {
   filter = ^page-loaded.*
   desc   = page unloaded
   numerical-trigger {
   from-value = 1
   to-value   = 0
   }
   script = 
 }
  action coveropen {
   filter = ^cover-open.*
   desc   = cover open
   numerical-trigger {
   from-value = 0
   to-value   = 1
   }
   script = 
 

[sane-devel] Canon DR-7550 I/O Error

2011-11-25 Thread Furio Settimi
Hi,
I have some problem with Canon DR-7550 on Slackware 13.37 with Sane 
V:10.0.22
When I try this command or other options, the report is every time this.
Example:

SANE_DEBUG_CANON_DR=25 scanimage   file.tiff


[canon_dr] ssm_buffer: start
[canon_dr] do_usb_cmd: start
[canon_dr] cmd: writing 24 bytes, timeout 3
[canon_dr] cmd: wrote 24 bytes, retVal 0
[canon_dr] out: writing 32 bytes, timeout 3
[canon_dr] out: wrote 0 bytes, retVal 9
[canon_dr] out: wrong size 32/0
[canon_dr] ssm_buffer: finish
[canon_dr] sane_start: ERROR: cannot ssm buffer
[canon_dr] sane_start: error 9
scanimage: sane_start: Error during device I/O
[canon_dr] sane_cancel: finish
[canon_dr] sane_close: start
.

thank You



[sane-devel] Canon DR-7550 I/O Error

2011-11-25 Thread m. allan noah
This machine is untested. Apparently it does not like the buffering
command. This command might be unsupported, or it might have a
different format for this machine. Can you get a log of the scanner in
action under windows, using this software:
http://www.pcausa.com/Utilities/UsbSnoop/

If not, we can just disable this command, and rebuild sane-backends from source.

allan

On Fri, Nov 25, 2011 at 10:39 AM, Furio Settimi ris at bresciaservice.com 
wrote:
 Hi,
 I have some problem with Canon DR-7550 on Slackware 13.37 with Sane
 V:10.0.22
 When I try this command or other options, the report is every time this.
 Example:

 SANE_DEBUG_CANON_DR=25 scanimage ? file.tiff

 
 [canon_dr] ssm_buffer: start
 [canon_dr] do_usb_cmd: start
 [canon_dr] cmd: writing 24 bytes, timeout 3
 [canon_dr] cmd: wrote 24 bytes, retVal 0
 [canon_dr] out: writing 32 bytes, timeout 3
 [canon_dr] out: wrote 0 bytes, retVal 9
 [canon_dr] out: wrong size 32/0
 [canon_dr] ssm_buffer: finish
 [canon_dr] sane_start: ERROR: cannot ssm buffer
 [canon_dr] sane_start: error 9
 scanimage: sane_start: Error during device I/O
 [canon_dr] sane_cancel: finish
 [canon_dr] sane_close: start
 .

 thank You

 --
 sane-devel mailing list: sane-devel at 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-request at lists.alioth.debian.org




-- 
The truth is an offense, but not a sin



[sane-devel] Scanner Button Daemon [scanbd]: high CPU utilization

2011-11-25 Thread Wilhelm
Hi Rastislav,

Am 25.11.2011 13:49, schrieb Rastislav David:

 - Wilhelmwilhelm.meier at fh-kl.de  wrote:
 Hi Rastislav,

 (sorry for calling you wrong last time)

 Am 25.11.2011 10:35, schrieb Rastislav David:
 Hello Wilhelm,

 thank You for responding so quickly.

 you're welcome


 I've closed point 2) where I've found that button called Pdf is found with 
 filter file.

 good to here!

 I've attached scanbd.conf in my last email but I guess it didn't go through.

 looks good.

 I think there problem is, that with debian-testing we get a new libudev
 with a non-blocking behaviour for the udev_monitor_receive_device()
 function.

 I'll fix that upstream, when I discover how to switch back to the
 blocking behaviour.

 In the mean time you can compile sanbd without libudev as said in the
 last email.

 Yes.
 Compiled without UDEV and HAL now scanbd works as expected.
 scanbd is now behaving nicely with prety low CPU utilization :)

 Your guess at libdev was most likely correct.

ok, sounds good.

I just committed a fix regarding this problem. I can confirm that this 
problem exists on debian-testing using libudev-dev-173 (but not on 
ubuntu-oneiric using libudev-dev-172).

Please test this new version on your system too with your scanner and 
please send me a feedback.

Is there anyone to test this on ubuntu precise?



 So, stay tuned.

 Fingers crossed.



 Here is scanbd.conf I'm using now:

 global {
   debug   = true
   debug-level = 1
   user= saned
   group   = scanner
   saned   = /usr/sbin/saned
   saned_opt  = {}
   saned_env  = { SANE_CONFIG_DIR=/etc/scanbd }
   scanbuttond_backends_dir = 
 /usr/local/etc/scanbd/scanbuttond/backends
   timeout = 400
   pidfile = /var/run/scanbd.pid
   environment {
   device = SCANBD_DEVICE
   action = SCANBD_ACTION
   }
   function function_knob {
   filter = ^message.*
   desc   = The value of the function knob / wheel / 
 selector
   env= SCANBD_FUNCTION
   }
   function function_mode {
   filter = ^mode.*
   desc   = Color mode
   env= SCANBD_FUNCTION_MODE
   }
   multiple_actions = true
   action scan {
   filter = ^scan.*
   numerical-trigger {
   from-value = 1
   to-value   = 0
   }
   desc   = Scan to file
   script = /etc/scanbd/action.script
   }
   action email {
   filter = ^email$
   string-trigger {
   from-value  = 
   to-value= ^email.*
   }
   desc   = Scan to email
   script = /etc/scanbd/action.script
   }
   action copy {
   filter = ^copy$
   string-trigger {
   from-value  = 
   to-value= ^copy.*
   }
   desc   = Copy to printer
   script = /etc/scanbd/test.script
   }
   action pdf {
   filter = ^file$
   numerical-trigger {
   from-value = 1
   to-value   = 0
   }
   desc   = Pdf
   script = /etc/scanbd/action.script
   }
   action preview {
   filter = ^preview$
   numerical-trigger {
   from-value = 1
   to-value   = 0
   }
   desc   = Preview
   script = /etc/scanbd/action.script
   }
   action globaltest {
filter = ^message.*
desc   = Test (print all env vars)
script = /etc/scanbd/test.script
   }
 }
 device fujitsu {
  filter = ^fujitsu.*
  desc = Fujitsu: Test
  function function_knob {
   filter = ^function.*
   desc   = The value of the function knob / wheel / 
 selector
   env= SCANBD_FUNCTION
  }
  action paperload {
   filter = ^page-loaded.*
   desc   = page loaded
   numerical-trigger {
   from-value = 0
   to-value   = 1
   }
   script = 
  }
  action paperunload {
   filter = ^page-loaded.*
   desc   = page unloaded
   numerical-trigger {
   from-value = 1
   to-value   = 0

[sane-devel] Left paper side lost on genesys and MD6228

2011-11-25 Thread Werner Holtfreter
2011-07-15 13:41 wrote Werner Holtfreter:

 2011-07-15 12:35 wrote Stef:
 
  I have re-tuned MD5345/6228 scan area.
  With latest source code version the bug is now fixed.
 
 Thank you very much! That is really high speed debugging!
 
 (I will enjoy it after distribution in Robert Ancell's ppa.)

Now I work with Ubuntu 11.10 (Oneiric Ocelot) on AMD 64.

The bug is still alive in Oneiric, but Robert Ancell did not make a ppa
for that.

Robert, do you have the aim to make a new ppa?
-- 
Viele Gr??e
Werner Holtfreter




[sane-devel] Scanner Button Daemon [scanbd]: high CPU utilization

2011-11-25 Thread Rastislav David
Hello Wilhelm,

scanbd starts fine and looks to be ok now on ARM and Debian Wheezy.

I've unplugged and plugged back scanner and it now reacts to button presses.

Thank You

Rastislav

I'm including my action.script which performs different tasks based on
button for somebody to reuse.

scan_dir=/var/spool/scan
datetime=`date +%F_%H%M%S`
filename=scan-$datetime
send_to=machanska at seznam.cz
#send_to=rasto at ynet.sk

#logger -t scanbd: $0 Begin of $SCANBD_ACTION

case $SCANBD_ACTION in
 pdf)
  logger -t scanbd: $0 $SCANBD_ACTION - scanning and converting to ps
  scanimage -d $SCANBD_DEVICE --mode Color --resolution 150 --depth 16 |
convert -density 150 - $scan_dir/$filename.ps
  logger -t scanbd: $0 $SCANBD_ACTION - converting ps to pdf
  ps2pdf  -sPAPERSIZE=a4 $scan_dir/$filename.ps $scan_dir/$filename.pdf
  rm $scan_dir/$filename.ps
  ;;
 scan)
  scanimage -d $SCANBD_DEVICE --resolution 150 --mode Color --depth 16
--format=tiff  $scan_dir/$filename.tiff
  ;;
 copy)
  logger -t scanbd: $0 $SCANBD_ACTION - scanning
  scanimage -d $SCANBD_DEVICE --resolution 300 --depth 16--format=tiff 
$scan_d
ir/$filename.tiff
# | convert -density 300 - $scan_dir/$filename.ps
  logger -t scanbd: $0 $SCANBD_ACTION - printing
  lp $scan_dir/$filename.tiff
  rm $scan_dir/$filename.ps
  ;;
email)
  logger -t scanbd: $0 $SCANBD_ACTION - scanning and converting to ps
  scanimage -d $SCANBD_DEVICE --mode Color --resolution 150 --depth 16|
convert -density 150 - $scan_dir/$filename.ps
  logger -t scanbd: $0 $SCANBD_ACTION - converting ps to pdf
  ps2pdf  -sPAPERSIZE=a4 $scan_dir/$filename.ps $scan_dir/$filename.pdf
  logger -t scanbd: $0 $SCANBD_ACTION - sending pdf
  (cat EOCAT
Document scanned on Canon LiDE 110
EOCAT
uuencode $scan_dir/$filename.pdf $scan_dir/$filename.pdf ) | mail -a
From: Canon scanner some at email.sk -s Document $filename $send_to
  rm $scan_dir/$filename.ps
  ;;
*)
  logger -t scanbd: $0 Unhandled action request.
  ;;
esac

On 25/Nov/11 5:27 PM, Wilhelm wrote:
 Hi Rastislav,
 
 Am 25.11.2011 13:49, schrieb Rastislav David:

 - Wilhelmwilhelm.meier at fh-kl.de  wrote:
 Hi Rastislav,

 (sorry for calling you wrong last time)

 Am 25.11.2011 10:35, schrieb Rastislav David:
 Hello Wilhelm,

 thank You for responding so quickly.

 you're welcome


 I've closed point 2) where I've found that button called Pdf is
 found with filter file.

 good to here!

 I've attached scanbd.conf in my last email but I guess it didn't go
 through.

 looks good.

 I think there problem is, that with debian-testing we get a new libudev
 with a non-blocking behaviour for the udev_monitor_receive_device()
 function.

 I'll fix that upstream, when I discover how to switch back to the
 blocking behaviour.

 In the mean time you can compile sanbd without libudev as said in the
 last email.

 Yes.
 Compiled without UDEV and HAL now scanbd works as expected.
 scanbd is now behaving nicely with prety low CPU utilization :)

 Your guess at libdev was most likely correct.
 
 ok, sounds good.
 
 I just committed a fix regarding this problem. I can confirm that this
 problem exists on debian-testing using libudev-dev-173 (but not on
 ubuntu-oneiric using libudev-dev-172).
 
 Please test this new version on your system too with your scanner and
 please send me a feedback.
 
 Is there anyone to test this on ubuntu precise?
 


 So, stay tuned.

 Fingers crossed.



 Here is scanbd.conf I'm using now:

 global {
   debug   = true
   debug-level = 1
   user= saned
   group   = scanner
   saned   = /usr/sbin/saned
   saned_opt  = {}
   saned_env  = { SANE_CONFIG_DIR=/etc/scanbd }
   scanbuttond_backends_dir =
 /usr/local/etc/scanbd/scanbuttond/backends
   timeout = 400
   pidfile = /var/run/scanbd.pid
   environment {
   device = SCANBD_DEVICE
   action = SCANBD_ACTION
   }
   function function_knob {
   filter = ^message.*
   desc   = The value of the function knob / wheel /
 selector
   env= SCANBD_FUNCTION
   }
   function function_mode {
   filter = ^mode.*
   desc   = Color mode
   env= SCANBD_FUNCTION_MODE
   }
   multiple_actions = true
   action scan {
   filter = ^scan.*
   numerical-trigger {
   from-value = 1
   to-value   = 0
   }
   desc   = Scan to file
   script = /etc/scanbd/action.script
   }
   action email {
   filter = ^email$
   string-trigger {
   from-value  = 
   to-value= ^email.*
   }
   desc   = Scan to email
   script = /etc/scanbd/action.script
   }