[sane-devel] Re: Mac OS X 10.3.3- Sane Backend 1.0.14 - Microtek ScanMaker II - New Information

David B Brown david_b_brown@mac.com
Thu, 13 May 2004 21:43:01 +0100


--Apple-Mail-1-947083008
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=US-ASCII;
	format=flowed

Hi,

	some more information on after some more debugging, Help would be 
appreciated, because I can now jsut about see what's going wrong, but I 
haven no clue on how to fix it.

	In this scenario what I observed before was that the scanner completes 
the first pass, the software moves on to start of the second pass and 
issues the first read command before the scan head has physically 
returned to the start, and then we get the out of memory error.

	I added some debug to ensure that the correct device was being used 
for the second pass, and this was definitely ok.

	I added  in a sleep in the Microtek routine where it's setting up the 
parameters for the next pass. If the sleep value was 10 second or over, 
this gives the scanner head time to physically return to the start 
before the software sends the settings for the second pass, and then 
the second pass works ok. On the third pass, the read of the first 154 
lines is executed, however the ExecuteTaskSync command used to do the 
read, doesn't appear to return an error, but it returns a transferCount 
of 0,  and then things go wrong, the SCSI bus goes into a loop of 
resetting itself, and the scanner just sits there with the scan head 
part the way down, the orange light is on, and the green light is off. 
Nothing but a reboot recovers from this. Here's  the last part of the 
trace, from where it reads the last chunk of pass 2:-


[microtek] .get_scan_status 0...
[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:6 isWrite:0
[sanei_scsi] isRead dst_size:6
[sanei_scsi] Executing command
[sanei_scsi] ExecuteTaskSync OK Trasferred 6 bytes
[microtek] get_scan_status(6): 0, 850, 13  -> #0
[microtek] >  0 52  3  d  0  0
[microtek] read_from_scanner: gss busy, linewidth, remaining:  0, 850, 
13
[microtek] sane_read:  max_scsi: 154, rem: 13, nlines: 13
[microtek] .read_scan_data...
[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:11050 isWrite:0
[sanei_scsi] isRead dst_size:11050
[sanei_scsi] Executing command
[sanei_scsi] ExecuteTaskSync OK Trasferred 11050 bytes
[microtek] sane_read:  buffsize: 11050,  unscanned: 0
[microtek] pack_into_ring...
[microtek] pack_into_dest...
[microtek] pack_into_dest:  rl: 11050  sz: 130900  hc: 0
[microtek] sane_read...
[microtek] end_scan...
[microtek] .stop_scan...
[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:0 isWrite:1
[sanei_scsi] isWrite src_size:0
[sanei_scsi] Executing command
[sanei_scsi] ExecuteTaskSync OK Trasferred 0 bytes
[microtek] sane_start...iokitscsi@<0161d1000000001a36edefe5>
[microtek] sane_get_parameters...
[microtek] sane_get_parameters:  regular 3-pass color
[microtek] sane_get_parameters:  res_code = 33 (21)
[microtek] sane_get_parameters:  dots_per_mm:  3.937008
[microtek] sane_get_parameters:  units_per_mm:  11.811024
[microtek] WIDTHPIX:  before exp: 850
[microtek] sane_get_parameters:  lines: 1400  ppl: 850  bpl: 850
[microtek] set_pass_parameters:  three-pass, on 3
[microtek] set_pass_parameters:  waiting before pass 3
[microtek] attach_scanner:  opening iokitscsi@<0161d1000000001a36edefe5>
[sanei_scsi] sanei_scsi_open: device 
iokitscsi@<0161d1000000001a36edefe5>
[sanei_debug] Setting debug level of sanei_scsi to 25.
[sanei_scsi] sanei_scsi_open: device 
iokitscsi@<0161d1000000001a36edefe5>
[microtek] .wait_ready 0...
[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:0 isWrite:1
[sanei_scsi] isWrite src_size:0
[sanei_scsi] Executing command
[sanei_scsi] ExecuteTaskSync OK Trasferred 0 bytes
[microtek] finagle_precal...
[microtek] .scanning_frame...
[microtek] .scanning_frame:  in- 0,0  2549,4199
[microtek] .scanning_frame: out- 0,0  2549,4199
[sanei_scsi] cmd2: cmd_size:6 src_size:9 dst_size:0 isWrite:1
[sanei_scsi] isWrite src_size:9
[sanei_scsi] Executing command
[sanei_scsi] ExecuteTaskSync OK Trasferred 9 bytes
[microtek] .accessory...
[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:0 isWrite:1
[sanei_scsi] isWrite src_size:0
[sanei_scsi] Executing command
[sanei_scsi] ExecuteTaskSync OK Trasferred 0 bytes
[microtek] .download_gamma...
[microtek] .download_gamma:  256 entries of 1 bytes, max 255
[microtek] .download_gamma: by default
[sanei_scsi] cmd2: cmd_size:10 src_size:256 dst_size:0 isWrite:1
[sanei_scsi] isWrite src_size:256
[sanei_scsi] Executing command
[sanei_scsi] ExecuteTaskSync OK Trasferred 256 bytes
[microtek] .mode_select 0...
[microtek] .mode_select:  pap_len: 4199
[sanei_scsi] cmd2: cmd_size:6 src_size:10 dst_size:0 isWrite:1
[sanei_scsi] isWrite src_size:10
[sanei_scsi] Executing command
[sanei_scsi] ExecuteTaskSync OK Trasferred 10 bytes
[microtek] .wait_ready 0...
[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:0 isWrite:1
[sanei_scsi] isWrite src_size:0
[sanei_scsi] Executing command
[sanei_scsi] ExecuteTaskSync OK Trasferred 0 bytes
[microtek] .start_scan...
[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:0 isWrite:1
[sanei_scsi] isWrite src_size:0
[sanei_scsi] Executing command
[sanei_scsi] ExecuteTaskSync OK Trasferred 0 bytes
[microtek] .get_scan_status 0...
[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:6 isWrite:0
[sanei_scsi] isRead dst_size:6
[sanei_scsi] Executing command
[sanei_scsi] ExecuteTaskSync OK Trasferred 6 bytes
[microtek] get_scan_status(6): 0, 850, 1399  -> #0
[microtek] >  0 52  3 77  5  0
[microtek] Scan Param:
[microtek] pix bpl: 850    hdr bpl: 0   ppl: 850
[microtek] undel bytes: 1189150   unscan lines: 1399   planes: 1
[microtek] dest bpl: 850   dest ppl: 850  aspect: 1.000000
[microtek] sane_get_parameters...
[microtek] sane_read...
[microtek] read_from_scanner...
[microtek] .get_scan_status 0...
[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:6 isWrite:0
[sanei_scsi] isRead dst_size:6
[sanei_scsi] Executing command
[sanei_scsi] ExecuteTaskSync OK Trasferred 6 bytes
[microtek] get_scan_status(6): 0, 850, 1399  -> #0
[microtek] >  0 52  3 77  5  0
[microtek] read_from_scanner: gss busy, linewidth, remaining:  0, 850, 
1399
[microtek] sane_read:  max_scsi: 154, rem: 1399, nlines: 154
[microtek] .read_scan_data...
[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:130900 isWrite:0
[sanei_scsi] isRead dst_size:130900
[sanei_scsi] Executing command
[sanei_scsi] ExecuteTaskSync OK Trasferred 0 bytes
[microtek] sane_read:  buffsize: 0,  unscanned: 1245
[microtek] pack_into_ring...
[microtek] pack_into_dest...
[microtek] pack_into_dest:  rl: 32768  sz: 130900  hc: 0
[microtek] sane_read...
[microtek] pack_into_dest...
[microtek] pack_into_dest:  rl: 32768  sz: 130900  hc: 32768
[microtek] sane_read...
[microtek] pack_into_dest...
[microtek] pack_into_dest:  rl: 32768  sz: 130900  hc: 65536
[microtek] sane_read...
[microtek] pack_into_dest...
[microtek] pack_into_dest:  rl: 32596  sz: 130900  hc: 98304
[microtek] sane_read...
[microtek] read_from_scanner...
[microtek] .get_scan_status 0...
[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:6 isWrite:0
[sanei_scsi] isRead dst_size:6
[sanei_scsi] Executing command
[sanei_scsi] ExecuteTaskSync OK Trasferred 0 bytes
[microtek] get_scan_status(0): 0, 0, 0  -> #0
[microtek] >  0  0  0  0  0  0
[microtek] read_from_scanner: gss busy, linewidth, remaining:  0, 0, 0
[microtek] sane_read:  max_scsi: 154, rem: 0, nlines: 0
[microtek] pack_into_ring...
[microtek] read_from_scanner...
[microtek] .get_scan_status 0...
[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:6 isWrite:0
[sanei_scsi] isRead dst_size:6
[sanei_scsi] Executing command
^C^C^Cscanimage: received signal 2
scanimage: trying to stop scanner




On 5 May 2004, at 15:01, David B Brown wrote:

> Hi,
>
> 	every time a new version of the Sane Backend's becomes available I 
> always have another go to see if anything has changed to make my 
> configuration work. I also find that when I come back to this afresh I 
> always get a little further forward.
>
> 	When you run scanimage, the Microtek scanner incorretly reports 
> itself 8 times, each under a different LUN, this has been consistent 
> since the new Max OSX SCSI code was implemented to support Mac OS X 
> 10.3.
>
> 	[MacCoylton:~] dave% scanimage -L
> device `microtek:iokitscsi@<016333000000001e2a70b923>' is a Microtek 
> ScanMaker II/IIXE flatbed scanner
> device `microtek:iokitscsi@<016338000000001e28c472d6>' is a Microtek 
> ScanMaker II/IIXE flatbed scanner
> device `microtek:iokitscsi@<01633a000000001e18c239cd>' is a Microtek 
> ScanMaker II/IIXE flatbed scanner
> device `microtek:iokitscsi@<0162c4000000001e05d02fe7>' is a Microtek 
> ScanMaker II/IIXE flatbed scanner
> device `microtek:iokitscsi@<01633d000000001e0530106a>' is a Microtek 
> ScanMaker II/IIXE flatbed scanner
> device `microtek:iokitscsi@<0162cc000000001e04869288>' is a Microtek 
> ScanMaker II/IIXE flatbed scanner
> device `microtek:iokitscsi@<0162cf000000001e03c78ee9>' is a Microtek 
> ScanMaker II/IIXE flatbed scanner
> device `microtek:iokitscsi@<0161e1000000001e02a59e9b>' is a Microtek 
> ScanMaker II/IIXE flatbed scanner
> [MacCoylton:~] dave%
>
> 	If you check using ioreg, each of these is on the same SCSI ID, but a 
> different LUN, the last one reported is actually on LUN 0.
>
> 	If I run scanimage without specifically specifying a device, then I 
> always get and error about the scsi buffer being smaller than one scan 
> line. The error is a bit of a red herring, and the real issue is that 
> the code is trying to communicate with the scanner using the wrong 
> LUN, in this case on LUN 7 in the above example which is the first one 
> listed.
>
> 	ISSUE: My coding is rusty and my knowledge of the SCSI API used for 
> Mac OS X is worse, but I believe that the Mac OS X scsi code doesn't 
> support specifying a LUN and SCSI ID in the microtek.conf file. From 
> my testing if the code has to search for the scanners it only uses the 
> vendor and device name, and ends up attached to the wrong LUN
>
> 	If I run scanimage  with the -d option set to the last device listed 
> ie the one thats LUN 0, the scan actually starts. I then have two 
> scenarios each with there own problems as follows
>
>
> 	Scenario 1:- If I run with an unconstrained size, then the first pass 
> happens ok, and then scanimage exists with an error before the scanner 
> physically returns to the start for the second pass. Here's some debug 
> trace:-
>
> [microtek] sane_read:  buffsize: 130900,  unscanned: 13
> [microtek] pack_into_ring...
> [microtek] pack_into_dest...
> [microtek] pack_into_dest:  rl: 32768  sz: 130900  hc: 0
> [microtek] sane_read...
> [microtek] pack_into_dest...
> [microtek] pack_into_dest:  rl: 32768  sz: 130900  hc: 32768
> [microtek] sane_read...
> [microtek] pack_into_dest...
> [microtek] pack_into_dest:  rl: 32768  sz: 130900  hc: 65536
> [microtek] sane_read...
> [microtek] pack_into_dest...
> [microtek] pack_into_dest:  rl: 32596  sz: 130900  hc: 98304
> [microtek] sane_read...
> [microtek] read_from_scanner...
> [microtek] .get_scan_status 0...
> [sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:6 isWrite:0
> [sanei_scsi] isRead dst_size:6
> [sanei_scsi] Executing command
> [sanei_scsi] ExecuteTaskSync OK Trasferred 6 bytes
> [microtek] get_scan_status(6): 0, 850, 13  -> #0
> [microtek] >  0 52  3  d  0  0
> [microtek] read_from_scanner: gss busy, linewidth, remaining:  0, 850, 
> 13
> [microtek] sane_read:  max_scsi: 154, rem: 13, nlines: 13
> [microtek] .read_scan_data...
> [sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:11050 isWrite:0
> [sanei_scsi] isRead dst_size:11050
> [sanei_scsi] Executing command
> [sanei_scsi] ExecuteTaskSync OK Trasferred 11050 bytes
> [microtek] sane_read:  buffsize: 11050,  unscanned: 0
> [microtek] pack_into_ring...
> [microtek] pack_into_dest...
> [microtek] pack_into_dest:  rl: 11050  sz: 130900  hc: 0
> [microtek] sane_read...
> [microtek] end_scan...
> [microtek] .stop_scan...
> [sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:0 isWrite:1
> [sanei_scsi] isWrite src_size:0
> [sanei_scsi] Executing command
> [sanei_scsi] ExecuteTaskSync OK Trasferred 0 bytes
> [microtek] sane_start...
> [microtek] sane_get_parameters...
> [microtek] sane_get_parameters:  regular 3-pass color
> [microtek] sane_get_parameters:  res_code = 33 (21)
> [microtek] sane_get_parameters:  dots_per_mm:  3.937008
> [microtek] sane_get_parameters:  units_per_mm:  11.811024
> [microtek] WIDTHPIX:  before exp: 850
> [microtek] sane_get_parameters:  lines: 1400  ppl: 850  bpl: 850
> [microtek] set_pass_parameters:  three-pass, on 2
> [sanei_debug] Setting debug level of sanei_scsi to 6.
> [microtek] .wait_ready 0...
> [sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:0 isWrite:1
> [sanei_scsi] isWrite src_size:0
> [sanei_scsi] Executing command
> [sanei_scsi] ExecuteTaskSync OK Trasferred 0 bytes
> [microtek] finagle_precal...
> [microtek] .scanning_frame...
> [microtek] .scanning_frame:  in- 0,0  2549,4199
> [microtek] .scanning_frame: out- 0,0  2549,4199
> [sanei_scsi] cmd2: cmd_size:6 src_size:9 dst_size:0 isWrite:1
> [sanei_scsi] isWrite src_size:9
> [sanei_scsi] Executing command
> [sanei_scsi] ExecuteTaskSync OK Trasferred 0 bytes
> [microtek] .accessory...
> [sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:0 isWrite:1
> [sanei_scsi] isWrite src_size:0
> [sanei_scsi] Executing command
> [sanei_scsi] ExecuteTaskSync OK Trasferred 0 bytes
> [microtek] .download_gamma...
> [microtek] .download_gamma:  256 entries of 1 bytes, max 255
> [microtek] .download_gamma: by default
> [sanei_scsi] cmd2: cmd_size:10 src_size:256 dst_size:0 isWrite:1
> [sanei_scsi] isWrite src_size:256
> [sanei_scsi] Executing command
> [sanei_scsi] ExecuteTaskSync OK Trasferred 0 bytes
> [microtek] .mode_select 0...
> [microtek] .mode_select:  pap_len: 4199
> [sanei_scsi] cmd2: cmd_size:6 src_size:10 dst_size:0 isWrite:1
> [sanei_scsi] isWrite src_size:10
> [sanei_scsi] Executing command
> [sanei_scsi] ExecuteTaskSync OK Trasferred 0 bytes
> [microtek] .wait_ready 0...
> [sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:0 isWrite:1
> [sanei_scsi] isWrite src_size:0
> [sanei_scsi] Executing command
> [sanei_scsi] ExecuteTaskSync OK Trasferred 0 bytes
> [microtek] .start_scan...
> [sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:0 isWrite:1
> [sanei_scsi] isWrite src_size:0
> [sanei_scsi] Executing command
> [sanei_scsi] ExecuteTaskSync OK Trasferred 0 bytes
> [microtek] .get_scan_status 0...
> [sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:6 isWrite:0
> [sanei_scsi] isRead dst_size:6
> [sanei_scsi] Executing command
> [sanei_scsi] ExecuteTaskSync OK Trasferred 0 bytes
> [microtek] get_scan_status(0): 0, 0, 0  -> #0
> [microtek] >  0  0  0  0  0  0
> [microtek] sane_start:  SCSI buffer smaller that one scan line!
> [microtek] end_scan...
> [microtek] .stop_scan...
> [sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:0 isWrite:1
> [sanei_scsi] isWrite src_size:0
> [sanei_scsi] Executing command
> [sanei_scsi] ExecuteTaskSync OK Trasferred 0 bytes
> scanimage: sane_start: Out of memory
> [microtek] sane_cancel...
> [microtek] end_scan...
> [microtek] sane_close...
> [microtek] sane_exit...
> [microtek] sane_exit:  MICROTEK says goodbye.
> [MacCoylton:~] dave%
>
>
> Scenario 2 :-  If I run with a constrained size, then the scanner 
> appears to have executed all three passes, or is at least coming to 
> the end of the third pass, but before the scanner physcially returns 
> to the start I get a kernal panic. The command I used for this test 
> was
>
> [MacCoylton:~] dave% scanimage -d 
> "microtek:iokitscsi@<0161e1000000001e02a59e9b>" -x 30 -y 30
>
> here's the debug trace immediately before the kernal panic, I copied 
> this down by hand so forgive me if I have any typo's
>
> [microtek] read_from_scanner...
> [microtek] .get_scan_status 0...
> [sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:6 isWrite:0
> [sanei_scsi] isRead dst_size:6
> [sanei_scsi] Executing command
> [sanei_scsi] ExecuteTaskSync OK Transferred 6 bytes
> [microtek] get_scan_status(6): 0, 118, 118  -> #0
> [microtek] > 0 76 0 76 0 0
> [microtek] read_from_scanner: gss busy, linewidth, remaining: 0, 118, 
> 118
> [microtek] sane_read: max_scsi: 1110, rem: 118, nline: 118
> [microtek] .read_scan_data...
> [sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:13924 isWrite:0
> [sanei_scsi] isRead dst_size:13924
> [sanei_scsi] Executing command
>
> As you can see this stops on issuing a SCSI command, and the panic.log 
> show the panic was within the adaptec driver.
>
>
> Cheers
>
> David
>
> 	

--Apple-Mail-1-947083008
Content-Transfer-Encoding: 7bit
Content-Type: text/enriched;
	charset=US-ASCII

Hi, 


	some more information on after some more debugging, Help would be
appreciated, because I can now jsut about see what's going wrong, but
I haven no clue on how to fix it. 


	In this scenario what I observed before was that the scanner
completes the first pass, the software moves on to start of the second
pass and issues the first read command before the scan head has
physically returned to the start, and then we get the out of memory
error. 


	I added some debug to ensure that the correct device was being used
for the second pass, and this was definitely ok.


	I added  in a sleep in the Microtek routine where it's setting up the
parameters for the next pass. If the sleep value was 10 second or
over, this gives the scanner head time to physically return to the
start before the software sends the settings for the second pass, and
then the second pass works ok. On the third pass, the read of the
first 154 lines is executed, however the ExecuteTaskSync command used
to do the read, doesn't appear to return an error, but it returns a
transferCount of 0,  and then things go wrong, the SCSI bus goes into
a loop of resetting itself, and the scanner just sits there with the
scan head part the way down, the orange light is on, and the green
light is off. Nothing but a reboot recovers from this. Here's  the
last part of the trace, from where it reads the last chunk of pass 2:- 



[microtek] .get_scan_status 0...

[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:6 isWrite:0

[sanei_scsi] isRead dst_size:6

[sanei_scsi] Executing command

[sanei_scsi] ExecuteTaskSync OK Trasferred 6 bytes

[microtek] get_scan_status(6): 0, 850, 13  -> #0

[microtek] >  0 52  3  d  0  0

[microtek] read_from_scanner: gss busy, linewidth, remaining:  0, 850,
13

[microtek] sane_read:  max_scsi: 154, rem: 13, nlines: 13

[microtek] .read_scan_data...

[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:11050 isWrite:0

[sanei_scsi] isRead dst_size:11050

[sanei_scsi] Executing command

[sanei_scsi] ExecuteTaskSync OK Trasferred 11050 bytes

[microtek] sane_read:  buffsize: 11050,  unscanned: 0

[microtek] pack_into_ring...

[microtek] pack_into_dest...

[microtek] pack_into_dest:  rl: 11050  sz: 130900  hc: 0

[microtek] sane_read...

[microtek] end_scan...

[microtek] .stop_scan...

[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:0 isWrite:1

[sanei_scsi] isWrite src_size:0

[sanei_scsi] Executing command

[sanei_scsi] ExecuteTaskSync OK Trasferred 0 bytes

[microtek] sane_start...iokitscsi@<<0161d1000000001a36edefe5>

[microtek] sane_get_parameters...

[microtek] sane_get_parameters:  regular 3-pass color

[microtek] sane_get_parameters:  res_code = 33 (21)

[microtek] sane_get_parameters:  dots_per_mm:  3.937008

[microtek] sane_get_parameters:  units_per_mm:  11.811024

[microtek] WIDTHPIX:  before exp: 850

[microtek] sane_get_parameters:  lines: 1400  ppl: 850  bpl: 850

[microtek] set_pass_parameters:  three-pass, on 3

[microtek] set_pass_parameters:  waiting before pass 3

[microtek] attach_scanner:  opening
iokitscsi@<<0161d1000000001a36edefe5>

[sanei_scsi] sanei_scsi_open: device
iokitscsi@<<0161d1000000001a36edefe5>

[sanei_debug] Setting debug level of sanei_scsi to 25.

[sanei_scsi] sanei_scsi_open: device
iokitscsi@<<0161d1000000001a36edefe5>

[microtek] .wait_ready 0...

[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:0 isWrite:1

[sanei_scsi] isWrite src_size:0

[sanei_scsi] Executing command

[sanei_scsi] ExecuteTaskSync OK Trasferred 0 bytes

[microtek] finagle_precal...

[microtek] .scanning_frame...

[microtek] .scanning_frame:  in- 0,0  2549,4199

[microtek] .scanning_frame: out- 0,0  2549,4199

[sanei_scsi] cmd2: cmd_size:6 src_size:9 dst_size:0 isWrite:1

[sanei_scsi] isWrite src_size:9

[sanei_scsi] Executing command

[sanei_scsi] ExecuteTaskSync OK Trasferred 9 bytes

[microtek] .accessory...

[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:0 isWrite:1

[sanei_scsi] isWrite src_size:0

[sanei_scsi] Executing command

[sanei_scsi] ExecuteTaskSync OK Trasferred 0 bytes

[microtek] .download_gamma...

[microtek] .download_gamma:  256 entries of 1 bytes, max 255

[microtek] .download_gamma: by default

[sanei_scsi] cmd2: cmd_size:10 src_size:256 dst_size:0 isWrite:1

[sanei_scsi] isWrite src_size:256

[sanei_scsi] Executing command

[sanei_scsi] ExecuteTaskSync OK Trasferred 256 bytes

[microtek] .mode_select 0...

[microtek] .mode_select:  pap_len: 4199

[sanei_scsi] cmd2: cmd_size:6 src_size:10 dst_size:0 isWrite:1

[sanei_scsi] isWrite src_size:10

[sanei_scsi] Executing command

[sanei_scsi] ExecuteTaskSync OK Trasferred 10 bytes

[microtek] .wait_ready 0...

[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:0 isWrite:1

[sanei_scsi] isWrite src_size:0

[sanei_scsi] Executing command

[sanei_scsi] ExecuteTaskSync OK Trasferred 0 bytes

[microtek] .start_scan...

[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:0 isWrite:1

[sanei_scsi] isWrite src_size:0

[sanei_scsi] Executing command

[sanei_scsi] ExecuteTaskSync OK Trasferred 0 bytes

[microtek] .get_scan_status 0...

[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:6 isWrite:0

[sanei_scsi] isRead dst_size:6

[sanei_scsi] Executing command

[sanei_scsi] ExecuteTaskSync OK Trasferred 6 bytes

[microtek] get_scan_status(6): 0, 850, 1399  -> #0

[microtek] >  0 52  3 77  5  0

[microtek] Scan Param:

[microtek] pix bpl: 850    hdr bpl: 0   ppl: 850

[microtek] undel bytes: 1189150   unscan lines: 1399   planes: 1

[microtek] dest bpl: 850   dest ppl: 850  aspect: 1.000000

[microtek] sane_get_parameters...

[microtek] sane_read...

[microtek] read_from_scanner...

[microtek] .get_scan_status 0...

[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:6 isWrite:0

[sanei_scsi] isRead dst_size:6

[sanei_scsi] Executing command

[sanei_scsi] ExecuteTaskSync OK Trasferred 6 bytes

[microtek] get_scan_status(6): 0, 850, 1399  -> #0

[microtek] >  0 52  3 77  5  0

[microtek] read_from_scanner: gss busy, linewidth, remaining:  0, 850,
1399

<color><param>FFFF,0000,0000</param>[microtek] sane_read:  max_scsi:
154, rem: 1399, nlines: 154

[microtek] .read_scan_data...

[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:130900 isWrite:0

[sanei_scsi] isRead dst_size:130900

[sanei_scsi] Executing command

[sanei_scsi] ExecuteTaskSync OK Trasferred 0 bytes</color>

[microtek] sane_read:  buffsize: 0,  unscanned: 1245

[microtek] pack_into_ring...

[microtek] pack_into_dest...

[microtek] pack_into_dest:  rl: 32768  sz: 130900  hc: 0

[microtek] sane_read...

[microtek] pack_into_dest...

[microtek] pack_into_dest:  rl: 32768  sz: 130900  hc: 32768

[microtek] sane_read...

[microtek] pack_into_dest...

[microtek] pack_into_dest:  rl: 32768  sz: 130900  hc: 65536

[microtek] sane_read...

[microtek] pack_into_dest...

[microtek] pack_into_dest:  rl: 32596  sz: 130900  hc: 98304

[microtek] sane_read...

[microtek] read_from_scanner...

[microtek] .get_scan_status 0...

[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:6 isWrite:0

[sanei_scsi] isRead dst_size:6

[sanei_scsi] Executing command

[sanei_scsi] ExecuteTaskSync OK Trasferred 0 bytes

[microtek] get_scan_status(0): 0, 0, 0  -> #0

[microtek] >  0  0  0  0  0  0

[microtek] read_from_scanner: gss busy, linewidth, remaining:  0, 0, 0

[microtek] sane_read:  max_scsi: 154, rem: 0, nlines: 0

[microtek] pack_into_ring...

[microtek] read_from_scanner...

[microtek] .get_scan_status 0...

[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:6 isWrite:0

[sanei_scsi] isRead dst_size:6

[sanei_scsi] Executing command

^C^C^Cscanimage: received signal 2

scanimage: trying to stop scanner





On 5 May 2004, at 15:01, David B Brown wrote:


<excerpt>Hi, 


	every time a new version of the Sane Backend's becomes available I
always have another go to see if anything has changed to make my
configuration work. I also find that when I come back to this afresh I
always get a little further forward. 


	When you run scanimage, the Microtek scanner incorretly reports
itself 8 times, each under a different LUN, this has been consistent
since the new Max OSX SCSI code was implemented to support Mac OS X
10.3. 


	[MacCoylton:~] dave% scanimage -L 

device `microtek:iokitscsi@<<016333000000001e2a70b923>' is a Microtek
ScanMaker II/IIXE flatbed scanner

device `microtek:iokitscsi@<<016338000000001e28c472d6>' is a Microtek
ScanMaker II/IIXE flatbed scanner

device `microtek:iokitscsi@<<01633a000000001e18c239cd>' is a Microtek
ScanMaker II/IIXE flatbed scanner

device `microtek:iokitscsi@<<0162c4000000001e05d02fe7>' is a Microtek
ScanMaker II/IIXE flatbed scanner

device `microtek:iokitscsi@<<01633d000000001e0530106a>' is a Microtek
ScanMaker II/IIXE flatbed scanner

device `microtek:iokitscsi@<<0162cc000000001e04869288>' is a Microtek
ScanMaker II/IIXE flatbed scanner

device `microtek:iokitscsi@<<0162cf000000001e03c78ee9>' is a Microtek
ScanMaker II/IIXE flatbed scanner

device `microtek:iokitscsi@<<0161e1000000001e02a59e9b>' is a Microtek
ScanMaker II/IIXE flatbed scanner

[MacCoylton:~] dave% 


	If you check using ioreg, each of these is on the same SCSI ID, but a
different LUN, the last one reported is actually on LUN 0. 


	If I run scanimage without specifically specifying a device, then I
always get and error about the scsi buffer being smaller than one scan
line. The error is a bit of a red herring, and the real issue is that
the code is trying to communicate with the scanner using the wrong
LUN, in this case on LUN 7 in the above example which is the first one
listed.  


	<color><param>FFFC,0000,0000</param>ISSUE: My coding is rusty and my
knowledge of the SCSI API used for Mac OS X is worse, but I believe
that the Mac OS X scsi code doesn't support specifying a LUN and SCSI
ID in the microtek.conf file. From my testing if the code has to
search for the scanners it only uses the vendor and device name, and
ends up attached to the wrong LUN</color>


	If I run scanimage  with the -d option set to the last device listed
ie the one thats LUN 0, the scan actually starts. I then have two
scenarios each with there own problems as follows 



	<color><param>0000,0000,FFFD</param>Scenario 1:- If I run with an
unconstrained size, then the first pass happens ok, and then scanimage
exists with an error before the scanner physically returns to the
start for the second pass. Here's some debug trace:-

</color>

[microtek] sane_read:  buffsize: 130900,  unscanned: 13

[microtek] pack_into_ring...

[microtek] pack_into_dest...

[microtek] pack_into_dest:  rl: 32768  sz: 130900  hc: 0

[microtek] sane_read...

[microtek] pack_into_dest...

[microtek] pack_into_dest:  rl: 32768  sz: 130900  hc: 32768

[microtek] sane_read...

[microtek] pack_into_dest...

[microtek] pack_into_dest:  rl: 32768  sz: 130900  hc: 65536

[microtek] sane_read...

[microtek] pack_into_dest...

[microtek] pack_into_dest:  rl: 32596  sz: 130900  hc: 98304

[microtek] sane_read...

[microtek] read_from_scanner...

[microtek] .get_scan_status 0...

[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:6 isWrite:0

[sanei_scsi] isRead dst_size:6

[sanei_scsi] Executing command

[sanei_scsi] ExecuteTaskSync OK Trasferred 6 bytes

[microtek] get_scan_status(6): 0, 850, 13  -> #0

[microtek] >  0 52  3  d  0  0

[microtek] read_from_scanner: gss busy, linewidth, remaining:  0, 850,
13

[microtek] sane_read:  max_scsi: 154, rem: 13, nlines: 13

[microtek] .read_scan_data...

[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:11050 isWrite:0

[sanei_scsi] isRead dst_size:11050

[sanei_scsi] Executing command

[sanei_scsi] ExecuteTaskSync OK Trasferred 11050 bytes

[microtek] sane_read:  buffsize: 11050,  unscanned: 0

[microtek] pack_into_ring...

[microtek] pack_into_dest...

[microtek] pack_into_dest:  rl: 11050  sz: 130900  hc: 0

[microtek] sane_read...

[microtek] end_scan...

[microtek] .stop_scan...

[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:0 isWrite:1

[sanei_scsi] isWrite src_size:0

[sanei_scsi] Executing command

[sanei_scsi] ExecuteTaskSync OK Trasferred 0 bytes

[microtek] sane_start...

[microtek] sane_get_parameters...

[microtek] sane_get_parameters:  regular 3-pass color

[microtek] sane_get_parameters:  res_code = 33 (21)

[microtek] sane_get_parameters:  dots_per_mm:  3.937008

[microtek] sane_get_parameters:  units_per_mm:  11.811024

[microtek] WIDTHPIX:  before exp: 850

[microtek] sane_get_parameters:  lines: 1400  ppl: 850  bpl: 850

[microtek] set_pass_parameters:  three-pass, on 2

[sanei_debug] Setting debug level of sanei_scsi to 6.

[microtek] .wait_ready 0...

[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:0 isWrite:1

[sanei_scsi] isWrite src_size:0

[sanei_scsi] Executing command

[sanei_scsi] ExecuteTaskSync OK Trasferred 0 bytes

[microtek] finagle_precal...

[microtek] .scanning_frame...

[microtek] .scanning_frame:  in- 0,0  2549,4199

[microtek] .scanning_frame: out- 0,0  2549,4199

[sanei_scsi] cmd2: cmd_size:6 src_size:9 dst_size:0 isWrite:1

[sanei_scsi] isWrite src_size:9

[sanei_scsi] Executing command

[sanei_scsi] ExecuteTaskSync OK Trasferred 0 bytes

[microtek] .accessory...

[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:0 isWrite:1

[sanei_scsi] isWrite src_size:0

[sanei_scsi] Executing command

[sanei_scsi] ExecuteTaskSync OK Trasferred 0 bytes

[microtek] .download_gamma...

[microtek] .download_gamma:  256 entries of 1 bytes, max 255

[microtek] .download_gamma: by default

[sanei_scsi] cmd2: cmd_size:10 src_size:256 dst_size:0 isWrite:1

[sanei_scsi] isWrite src_size:256

[sanei_scsi] Executing command

[sanei_scsi] ExecuteTaskSync OK Trasferred 0 bytes

[microtek] .mode_select 0...

[microtek] .mode_select:  pap_len: 4199

[sanei_scsi] cmd2: cmd_size:6 src_size:10 dst_size:0 isWrite:1

[sanei_scsi] isWrite src_size:10

[sanei_scsi] Executing command

[sanei_scsi] ExecuteTaskSync OK Trasferred 0 bytes

[microtek] .wait_ready 0...

[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:0 isWrite:1

[sanei_scsi] isWrite src_size:0

[sanei_scsi] Executing command

[sanei_scsi] ExecuteTaskSync OK Trasferred 0 bytes

[microtek] .start_scan...

[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:0 isWrite:1

[sanei_scsi] isWrite src_size:0

[sanei_scsi] Executing command

[sanei_scsi] ExecuteTaskSync OK Trasferred 0 bytes

[microtek] .get_scan_status 0...

[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:6 isWrite:0

[sanei_scsi] isRead dst_size:6

[sanei_scsi] Executing command

[sanei_scsi] ExecuteTaskSync OK Trasferred 0 bytes

[microtek] get_scan_status(0): 0, 0, 0  -> #0

[microtek] >  0  0  0  0  0  0

[microtek] sane_start:  SCSI buffer smaller that one scan line!

[microtek] end_scan...

[microtek] .stop_scan...

[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:0 isWrite:1

[sanei_scsi] isWrite src_size:0

[sanei_scsi] Executing command

[sanei_scsi] ExecuteTaskSync OK Trasferred 0 bytes

scanimage: sane_start: Out of memory

[microtek] sane_cancel...

[microtek] end_scan...

[microtek] sane_close...

[microtek] sane_exit...

[microtek] sane_exit:  MICROTEK says goodbye.

[MacCoylton:~] dave% 



<color><param>0000,0000,FFFC</param>Scenario 2 :-  If I run with a
constrained size, then the scanner appears to have executed all three
passes, or is at least coming to the end of the third pass, but before
the scanner physcially returns to the start I get a kernal panic. The
command I used for this test was 


</color>[MacCoylton:~] dave%
<color><param>0000,0000,0000</param>scanimage -d
"microtek:iokitscsi@<<0161e1000000001e02a59e9b>" -x 30 -y 30


here's the debug trace immediately before the kernal panic, I copied
this down by hand so forgive me if I have any typo's 


[microtek] read_from_scanner...

[microtek] .get_scan_status 0...

[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:6 isWrite:0

[sanei_scsi] isRead dst_size:6 

[sanei_scsi] Executing command

[sanei_scsi] ExecuteTaskSync OK Transferred 6 bytes

[microtek] get_scan_status(6): 0, 118, 118  -> #0

[microtek] > 0 76 0 76 0 0 

[microtek] read_from_scanner: gss busy, linewidth, remaining: 0, 118,
118 

[microtek] sane_read: max_scsi: 1110, rem: 118, nline: 118 

[microtek] .read_scan_data...

[sanei_scsi] cmd2: cmd_size:6 src_size:0 dst_size:13924 isWrite:0

[sanei_scsi] isRead dst_size:13924

[sanei_scsi] Executing command 


As you can see this stops on issuing a SCSI command, and the panic.log
show the panic was within the adaptec driver. 



Cheers


David </color>


	

</excerpt>
--Apple-Mail-1-947083008--