I'm trying to do something a bit fancier here now which I think *should* 
work, but which isn't playing nice with the backend.

Pseudocode follows:

   sane_init()
   sane_open()
   while(1) {
     /* OMITTED: wait for a button to be pressed */
     sane_close()
     if fork() {
       exec scanadf
     } else {
       wait() /* let scanadf finish and exit */
       sane_open() /* reopen the device */
     }
   }

After the patch I posted earlier (necessary for exec'd scanadf process 
to be able to access the device), everything works up and until the 
point we come back to the second sane_open() and try looking for button 
presses again.

Attached is logs from a sample run (with no paper in the feed, so 
scanadf's output is comparatively brief); note the errors which occur on 
attempts to get_hardware_status after the device has been reloaded.

Is this an error in my usage, or an issue with the driver?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sanebuttonsd-fork_and_exec.log.bz2
Type: application/x-bzip2
Size: 2740 bytes
Desc: not available
Url : 
http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20060222/467dd1b5/sanebuttonsd-fork_and_exec.log.bin
From [email protected]  Wed Feb 22 14:43:58 2006
From: [email protected] (=?ISO-8859-1?Q?Beno=EEt?= Dejean)
Date: Wed Feb 22 15:17:30 2006
Subject: [sane-devel] add support fujitsu 5120
In-Reply-To: <[email protected]>
References: <[email protected]>
        <[email protected]>
Message-ID: <1140619439.24633.8.camel@Devil>

Le mardi 21 f?vrier 2006 ? 10:01 -0500, m. allan noah a ?crit : 
> benoit, thanks for the hack :) i am currently re-writing the fujitsu 
> backend to better support the newer model usb scanners. i would not use it 
> for your customers, but i have been placing the updated backend here:
> 
> http://www2.pfeiffer.edu/~anoah/fujitsu/
> 
> can i ask you to test this code in the future, as i make new versions?

I would certainly but "CURRENTLY FOR USB ONLY! SCSI IS BROKEN!"
prevents me from doing it. We never managed to make 4120 work reliably
with USB, that's why we use only the SCSI interface. Btw, i've tried
your fujitsu backend (+ one line patch to detect the 5120). It's no
usable by USB, scanimage just hangs. Here is what i've tried :


$ sane-find-scanner 
found USB scanner (vendor=0x04c5, product=0x10e0) at libusb:001:004

$ sudo vim /etc/sane.d/fujitsu.conf 

$ cat /etc/sane.d/fujitsu.conf
scsi FUJITSU
usb 0x04c5 0x10e0
option force-model fi-4x20

$ scanimage -L

No scanners were identified. If you were expecting something different,
check that the scanner is plugged in, turned on and detected by the
sane-find-scanner tool (if appropriate). Please read the documentation
which came with this software (README, FAQ, manpages).


/proc/bus/usb/devices :
T: Bus=01 Lev=01 Prnt=01 Port=06 Cnt=01 Dev#= 4 Spd=480 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=04c5 ProdID=10e0 Rev= 1.00
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 98mA
I: If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=31875us

syslog :
ehci_hcd 0000:00:03.3: port 7 high speed
ehci_hcd 0000:00:03.3: GetStatus port 7 status 001005 POWER sig=se0 PE CONNECT
usb 1-7: new device strings: Mfr=0, Product=0, SerialNumber=0
usb 1-7: hotplug
usb 1-7: adding 1-7:1.0 (config #1, interface 0)
usb 1-7:1.0: hotplug

Thanks.

Reply via email to