Re: Mustek scanner: success!

Rogier Wolff (R.E.Wolff@BitWizard.nl)
Fri, 27 Feb 1998 00:27:26 +0100 (MET)

Norbert Mueller wrote:
> Just an idea: Does anybody know whether there is a possibility to change
> the fixed sized buffer in sg.c to a circular list of e.g. 20 buffers of
> size such that the scanner may write to the list while at the same time
> the application reads from the list? As usually most CPU's are capable to
> read the data faster than the scanner can deliver, the circular list would
> never be full and backtracking would no longer happen.

Sounds "neat", but it isn't as simple as that.

The SCSI low level drivers would then need to be able to do
"scatter-gather". I think that the API isn't that smart. Also, you
could get into trouble that way: You'd have to tell the scanner: "Ok,
I want 1Mb of data". and then you have to trust the user-level
application to actually gather and store that data before your buffer
overflows. What do you do if the application suddenly goes comatose?

Another problem is that you'd be telling the scanner to send a whole
lot of data, where you don't know how long that's going to take. The
lowlevel SCSI driver (e.g. the NCR810 one) might time out after say 10
seconds (It assumes a command like a "read" will finish within about
10 seconds: This is valid for most disks.... ;-).

Regards,

Roger.

-- 
If it's there and you can see it, it's REAL      |___R.E.Wolff@BitWizard.nl  |
If it's there and you can't see it, it's TRANSPARENT |  Tel: +31-15-2137555  |
If it's not there and you can see it, it's VIRTUAL   |__FAX:_+31-15-2138217  |
If it's not there and you can't see it, it's GONE! -- Roy Wilks, 1983  |_____|

--
Source code, list archive, and docs: http://www.mostang.com/sane/
To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com