[sane-devel] Help with Canon 2700F

2006-08-17 Thread Lutz
Am Mittwoch, 16. August 2006 18:58 schrieb abel deuring:
 Lutz wrote:
  to me, it looks like that the (working) Epson scanner gives much more
  info than the canon does.

 right: the Epson seems to be OK, while something is broken with the
 FS2700, see below.

  I already tried to debug (eclipse, cdt) the call - but I did not manage
  to have the source included when init() is called - the closest I got to,
  is that sense_handler in canon.c seems to be called with a null argument
  - seen in the debug output too - but here the mess has happened already.

 The null argument in the sense handler is OK. 
sorry - but, no it is _not_.
if you look at the sense_handler function in canon.c, it is quite clear, that 
this sense_handler will return via the

   else
{
  sense_str = problem not analyzed (unknown SCSI class);
  // status = SANE_STATUS_IO_ERROR;
}

branch of the first if... in this function:
if (dev  
and dev gets bound to *arg:

static SANE_Status
sense_handler (int scsi_fd, u_char * result, void *arg)
{
  static char testbuffer0[256];
  CANON_Device *dev = (CANON_Device *) arg;

---
 Regarding debugging: 
 gdb is your friend ;)
it is eclipses friend too ;) 
... but I seem not to be eclipses friend (yet) 
=8o
 Besides, you can grep for strings like 
 attach: sending TEST_UNIT_READY in the sources files of the
 backend; you should be able to quickly find the correct lines; here
 you can add for example additional DBG calls.
(...) 
 The authors of the backend decided to not let the backend continue
 to access the scanner in this case -- a reasonable decision. You
 might though try to ignore this specific error and patch the backend
 accordingly.
I already did - and got a lamp-error - the scanner works just fine on w2k - no 
lamp error.

following your suggestions I found the lines where the calling of the 
sense_handler with the null argument originates - it is in sanei/sanei_scsi.c
in function at line 251ff:

SANEI_SCSI_Sense_Handler handler
  = fd_info[req-fd].sense_handler;
void *arg = fd_info[req-fd].sense_handler_arg;
-
I'm still on my way to find out where this structure gets initialized.
btw - when I disabled the return of an error in the first call, I got several 
calls to the sense_handler, where the arg is not null - the lamp error is 
signaled from a not-null dev.

 Abel
thx

Lutz


[sane-devel] Help with Canon 2700F

2006-08-17 Thread abel deuring
Lutz wrote:
 Am Mittwoch, 16. August 2006 18:58 schrieb abel deuring:
Lutz wrote:
to me, it looks like that the (working) Epson scanner gives much more
info than the canon does.
right: the Epson seems to be OK, while something is broken with the
FS2700, see below.

I already tried to debug (eclipse, cdt) the call - but I did not manage
to have the source included when init() is called - the closest I got to,
is that sense_handler in canon.c seems to be called with a null argument
- seen in the debug output too - but here the mess has happened already.
The null argument in the sense handler is OK. 
 sorry - but, no it is _not_.
 if you look at the sense_handler function in canon.c, it is quite clear, that 
 this sense_handler will return via the
 
else
 {
   sense_str = problem not analyzed (unknown SCSI class);
   // status = SANE_STATUS_IO_ERROR;
 }

ouch. yes, you are right. The problem is that this error occurs
quite early during the setup of the device structures. Perhaps you
can simply comment out this call of TEST UNIT READY.

Besides, you can grep for strings like 
attach: sending TEST_UNIT_READY in the sources files of the
backend; you should be able to quickly find the correct lines; here
you can add for example additional DBG calls.
 (...) 
The authors of the backend decided to not let the backend continue
to access the scanner in this case -- a reasonable decision. You
might though try to ignore this specific error and patch the backend
accordingly.
 I already did - and got a lamp-error - the scanner works just fine on w2k - 
 no 
 lamp error.

If you look at the sense buffer of the first error and at the
function sense_handler in the canon sources, you'll see that lamp
error is exactly the error you get in the first place. It seems
that the Windows driver simply ignores this error. You could patch
sense_handler to simply print a warning in case of a lamp error, but
to return SANE_STATUS_GOOD in this case. But you should expect a
somewhat degraded scan quality.

 
 following your suggestions I found the lines where the calling of the 
 sense_handler with the null argument originates - it is in sanei/sanei_scsi.c
 in function at line 251ff:
 
   SANEI_SCSI_Sense_Handler handler
 = fd_info[req-fd].sense_handler;
   void *arg = fd_info[req-fd].sense_handler_arg;
 -

right: If sanei_scsi_cmd discovers an error, it calls the sense
handler so that the backend can decide, what to do.

 I'm still on my way to find out where this structure gets initialized.

As already said: in the function attach.

Abel


[sane-devel] Firmware for Epson 3490 Perfection does not upload to scanner

2006-08-17 Thread Jurgen Defurne
Hello,

I am busy trying to get a brand new Epson Perfection 3490 PHOTO at work under 
SANE.

I am running on Debian unstable, scanimage (sane-backends) 1.0.18; backend 
version 1.0.18.

One of the problems with this scanner are the many contradictory messages, 
which sometimes 
say that it is possible to make it work, sometimes it seems other people have 
the same 
problem, but it never seems clear what the real solution to the problem is. One 
extra 
problem is that the proprietary parts of the system are only distributed as 
rpms.

Currently, I have my system configured for the epkowa driver.

After testing the system also under Windows XP, I have come to the conclusion 
that the 
problem sits somewhere in the uploading of the firmware file 
/usr/share/sane/epkowa/esfw52.bin. The epkowa.conf file is configured to find 
this one, and 
it is available, but when running 

SANE_DEBUG_EPKOWA=128 scanimage

I get the following messages as part of the output :

[epkowa] sane_init, # Change to the fully qualified filename of your firmware 
file, if
[epkowa] sane_init, # firmware upload is needed by the scanner
[epkowa] sane_init, firmware /usr/share/sane/epkowa/esfw52.bin
[epkowa] attach_one(firmware /usr/share/sane/epkowa/esfw52.bin)
[epkowa] EPKOWA SANE Backend 1.0.18 - 2006-05-22
[epkowa] attach(firmware /usr/share/sane/epkowa/esfw52.bin, 1)
[epkowa] attach: opening firmware /usr/share/sane/epkowa/esfw52.bin
[epkowa] attach: open failed: Invalid argument

These are its ownership and access modes.

-rw-r--r-- 1 root root 64000 2006-06-20 21:49 /usr/share/sane/epkowa/esfw52.bin

The following step would have been that I compiled the sane software myself, 
and adding more 
messages, but before I do this I would like to know if there are other people 
with the same 
scanner, and if they have succeeded in getting it to work ?

Regards,

Jurgen Defurne


[sane-devel] Help with Canon 2700F

2006-08-17 Thread Lutz
Am Donnerstag, 17. August 2006 15:29 schrieb abel deuring:
 Lutz wrote:
  Am Mittwoch, 16. August 2006 18:58 schrieb abel deuring:
(...)
 The problem is that this error occurs
 quite early during the setup of the device structures. Perhaps you
 can simply comment out this call of TEST UNIT READY.
I did, also changed sense_handler 
1. condition of first if to true (dev is only used and refernced in this if)
2. return GOOD if LAMP_Error

now the scanner is seen by scanimage -L - 
but it does not work - if I continue with Lamp error, I finally end up with a 
command sequence error.
this is the nice part of the output:

[canon]  mode_sense
[sanei_scsi] scsi_req_enter: entered 0x8053738
[sanei_scsi] sanei_scsi.issue: 0x8053738
[sanei_scsi] scsi_req_enter: queue_used: 1, queue_max: 2
[sanei_scsi] sanei_scsi_req_wait: waiting for 0x8053738
[sanei_scsi] sanei_scsi.issue: 0x8053738
[sanei_scsi] sanei_scsi_req_wait: read 64 bytes
[canon]  mode_sense
[canon] dev-sane.name = '/dev/sg1'
[canon] dev-sane.vendor = 'CANON'
[canon] dev-sane.model = 'IX-27025E   '
[canon] dev-sane.type = 'film scanner'
[canon] bmu=0
[canon] mud=2720
[canon] xres_default=2720
[canon] xres_range.max=2720
[canon] xres_range.min=120
[canon] xres_range.quant=1
[canon] yres_default=2720
[canon] yres_range.max=2720
[canon] yres_range.min=120
[canon] xres_range.quant=1
[canon] x_range.max=1585667
[canon] y_range.max=2378807
[canon] x_adf_range.max=-1
[canon] y_adf_range.max=-1
[canon]  attach
[canon]  attach_one
---
and her comes the not so nice part
---
[canon] sense category: hardware error
[canon] sense message: lamp failure
[canon]  sense_handler
[canon]  scan
[canon]  get_data_status
[sanei_scsi] scsi_req_enter: entered 0x401ae008
[sanei_scsi] sanei_scsi.issue: 0x401ae008
[sanei_scsi] scsi_req_enter: queue_used: 1, queue_max: 2
[sanei_scsi] sanei_scsi_req_wait: waiting for 0x401ae008
[sanei_scsi] sanei_scsi.issue: 0x401ae008
[sanei_scsi] sanei_scsi_req_wait: read 64 bytes
[canon]  get_data_status
[canon]  GET DATA STATUS
[canon] Scan Data Available=0
[canon] Magnified Width=1938
[canon] Magnified Length=485
[canon] Rest Data=0 bytes
[canon] Filled Data Buffer=0
[canon]  GET DATA STATUS
[canon] 323 pixels per line, 969 bytes, 485 lines high, total 469965 bytes, 
dpi=340
[canon]  sane_start
[dll] sane_get_parameters(handle=0x80534c8,params=0xbfffdd30)
[canon]  sane_get_parameters
[canon] sane_get_parameters: xres='340', yres='340', pixels_per_line='323', 
bytes_per_line='969', lines='485'
[canon]  sane_get_parameters
P6
# SANE data follows
323 485
255
[dll] sane_read(handle=0x80534c8,data=0x8060f68,maxlen=32768,lenp=0xbfffdd0c)
[canon]  sane_read
[canon]sane_read: nread=32768, bytes_to_read=469965
[canon]  read_data
[sanei_scsi] scsi_req_enter: entered 0x401ae008
[sanei_scsi] sanei_scsi.issue: 0x401ae008
[sanei_scsi] scsi_req_enter: queue_used: 1, queue_max: 2
[sanei_scsi] sanei_scsi_req_wait: waiting for 0x401ae008
[sanei_scsi] sanei_scsi.issue: 0x401ae008
[sanei_scsi] sanei_scsi_req_wait: read 64 bytes
[sanei_scsi] sanei_scsi_req_wait: SCSI command complained: Success
[sanei_scsi] sense buffer: f0 00 45 00 00 00 00 06 00 00 00 00 2c 00 00 00
[sanei_scsi] target status: 02 host status:  driver status: 0008
[canon]  sense_handler modified lutz
[canon] canon_sense_handler(3, 0x401ae060, 0x80737e8)
[canon] sense buffer: f0 00 45 00 00 00 00 06 00 00 00 00 2c 00 00 00
[canon] sense data interpretation for SCSI-2 devices
[canon] sense category: illegal request
[canon] sense message: command sequence error
[canon]  sense_handler
[sanei_scsi] sanei_scsi_req_wait: SG driver returned resid 65536
[sanei_scsi]  NOTE: This value may be bogus
[canon]  read_data
---
hmmm.
Windows asks for the film to be removed and does an initialization of the 
scanner on first use after reboot - may be, this is what it expects?

any ideas which command this would be?

(...)
  I'm still on my way to find out where this structure gets initialized.

 As already said: in the function attach.
yes, but at the end of it - and after the call to test_unit_ready - at least 
as I see it - which may be wrong. 

thx

Lutz


[sane-devel] Firmware for Epson 3490 Perfection does not upload to scanner

2006-08-17 Thread Krzysztof Halasa
Hi,

jurgen.defu...@pandora.be (Jurgen Defurne) writes:

 I am busy trying to get a brand new Epson Perfection 3490 PHOTO at work
 under SANE.

This scanner works quite well with open source snapscan backend.
Have you tried it?
-- 
Krzysztof Halasa


[sane-devel] Help with Canon 2700F

2006-08-17 Thread abel deuring
Lutz wrote:

 now the scanner is seen by scanimage -L - 
 but it does not work - if I continue with Lamp error, I finally end up with a 
 command sequence error.

 ---
 and her comes the not so nice part
 ---
 [canon] sense category: hardware error
 [canon] sense message: lamp failure
 [canon]  sense_handler
 [canon]  scan
 [canon]  get_data_status
 [sanei_scsi] scsi_req_enter: entered 0x401ae008
 [sanei_scsi] sanei_scsi.issue: 0x401ae008
 [sanei_scsi] scsi_req_enter: queue_used: 1, queue_max: 2
 [sanei_scsi] sanei_scsi_req_wait: waiting for 0x401ae008
 [sanei_scsi] sanei_scsi.issue: 0x401ae008
 [sanei_scsi] sanei_scsi_req_wait: read 64 bytes
 [canon]  get_data_status
 [canon]  GET DATA STATUS
 [canon] Scan Data Available=0
 [canon] Magnified Width=1938
 [canon] Magnified Length=485
 [canon] Rest Data=0 bytes
 [canon] Filled Data Buffer=0
 [canon]  GET DATA STATUS
 [canon] 323 pixels per line, 969 bytes, 485 lines high, total 469965 bytes, 
 dpi=340
 [canon]  sane_start
 [dll] sane_get_parameters(handle=0x80534c8,params=0xbfffdd30)
 [canon]  sane_get_parameters
 [canon] sane_get_parameters: xres='340', yres='340', pixels_per_line='323', 
 bytes_per_line='969', lines='485'
 [canon]  sane_get_parameters
 P6
 # SANE data follows
 323 485
 255
 [dll] sane_read(handle=0x80534c8,data=0x8060f68,maxlen=32768,lenp=0xbfffdd0c)
 [canon]  sane_read
 [canon]sane_read: nread=32768, bytes_to_read=469965
 [canon]  read_data
 [sanei_scsi] scsi_req_enter: entered 0x401ae008
 [sanei_scsi] sanei_scsi.issue: 0x401ae008
 [sanei_scsi] scsi_req_enter: queue_used: 1, queue_max: 2
 [sanei_scsi] sanei_scsi_req_wait: waiting for 0x401ae008
 [sanei_scsi] sanei_scsi.issue: 0x401ae008
 [sanei_scsi] sanei_scsi_req_wait: read 64 bytes
 [sanei_scsi] sanei_scsi_req_wait: SCSI command complained: Success
 [sanei_scsi] sense buffer: f0 00 45 00 00 00 00 06 00 00 00 00 2c 00 00 00
 [sanei_scsi] target status: 02 host status:  driver status: 0008
 [canon]  sense_handler modified lutz
 [canon] canon_sense_handler(3, 0x401ae060, 0x80737e8)
 [canon] sense buffer: f0 00 45 00 00 00 00 06 00 00 00 00 2c 00 00 00
 [canon] sense data interpretation for SCSI-2 devices
 [canon] sense category: illegal request
 [canon] sense message: command sequence error
 [canon]  sense_handler
 [sanei_scsi] sanei_scsi_req_wait: SG driver returned resid 65536
 [sanei_scsi]  NOTE: This value may be bogus
 [canon]  read_data
 ---
 hmmm.
 Windows asks for the film to be removed and does an initialization of the 
 scanner on first use after reboot - may be, this is what it expects?
 
 any ideas which command this would be?

unfortunately, no idea... I even don't have an FS2700.

 
 (...)
I'm still on my way to find out where this structure gets initialized.
As already said: in the function attach.
 yes, but at the end of it - and after the call to test_unit_ready - at least 
 as I see it - which may be wrong. 

well, patch it ;) But keep in mind that the sense handler needs to
know the scanner model, so you can't use the sense handler before
that is defined in attach.

Abel


[sane-devel] Fujistu ADF scanner support?

2006-08-17 Thread Nick Papadonis
Wow, your model is an expensive scanner!  Are
letter/A4 pages aligned when scanner 50 sheet duplex?

The driver appears to support the models below. 
Unfortunately, it's not open source and has a 75 EURO
licensing fee.

Thanks

--- Daniel Spannbauer d...@marco.de wrote:

 Hello,
 
 take a look @ www.scandox.de. It's a Driver for
 sane. We use this Driver
 with the Fujitsu FI-5120C-Scanner. Works very well.
 
 Regards
 
 Daniel
 
 
 Nick Papadonis schrieb:
  Hi Folks,
 
  Does anyone know which Fujistu ADF duplex scanners
  work well with Sane?  I'm considering the FI-4120
 or
  Fi-5110EOX (Scansnap) models.  Basically, for
  greyscale document archiving.
 
  I recently purchased a used HP 7400c and am not
  impressed.  The ADF unit jams and does not orient
  paper correctly.  Additionally, streaks appear in
 the
  scanned image.  It works excellent in flatbed
 mode.