sane-project-website/old-archive/2000-06/0225.html

184 wiersze
7.0 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<TITLE>sane-devel: Re: scsi command queuing</TITLE>
<META NAME="Author" CONTENT="abel deuring (a.deuring@satzbau-gmbh.de)">
<META NAME="Subject" CONTENT="Re: scsi command queuing">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Re: scsi command queuing</H1>
<!-- received="Fri Jun 30 05:29:39 2000" -->
<!-- isoreceived="20000630122939" -->
<!-- sent="Fri, 30 Jun 2000 14:38:35 +0200" -->
<!-- isosent="20000630123835" -->
<!-- name="abel deuring" -->
<!-- email="a.deuring@satzbau-gmbh.de" -->
<!-- subject="Re: scsi command queuing" -->
<!-- id="395C94CB.2E156E92@satzbau-gmbh.de" -->
<!-- inreplyto="395B8756.BA86E297@wolfsburg.de" -->
<STRONG>From:</STRONG> abel deuring (<A HREF="mailto:a.deuring@satzbau-gmbh.de?Subject=Re:%20scsi%20command%20queuing&In-Reply-To=&lt;395C94CB.2E156E92@satzbau-gmbh.de&gt;"><EM>a.deuring@satzbau-gmbh.de</EM></A>)<BR>
<STRONG>Date:</STRONG> Fri Jun 30 2000 - 05:38:35 PDT
<P>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0226.html">Nathan Stenzel: "Can I plug my printer into my scanner and have it work?"</A>
<UL>
<LI><STRONG>Previous message:</STRONG> <A HREF="0224.html">Petter Reinholdtsen: "Re: bug in saned"</A>
<LI><STRONG>In reply to:</STRONG> <A HREF="0216.html">Oliver Rauch: "Re: scsi command queuing"</A>
<!-- nextthread="start" -->
<LI><STRONG>Next in thread:</STRONG> <A HREF="0228.html">Oliver Rauch: "Re: scsi command queuing"</A>
<LI><STRONG>Reply:</STRONG> <A HREF="0228.html">Oliver Rauch: "Re: scsi command queuing"</A>
<LI><STRONG>Reply:</STRONG> <A HREF="0240.html">Douglas Gilbert: "Re: scsi command queuing"</A>
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#225">[ date ]</A>
<A HREF="index.html#225">[ thread ]</A>
<A HREF="subject.html#225">[ subject ]</A>
<A HREF="author.html#225">[ author ]</A>
</UL>
<HR NOSHADE><P>
<!-- body="start" -->
<P>
Oliver Rauch wrote:
<BR>
<P><EM>&gt; Yes, but I compared it with th windows driver. That does scan some MB
</EM><BR>
<EM>&gt; and then the scanhead stops for a longer time. If I scan with sane the
</EM><BR>
<EM>&gt; scanhead stops after 256KB (size of the scanner internal image buffer)
</EM><BR>
<EM>&gt; whe I scan large images (on images up to 30 MB there is no problem).
</EM><BR>
<P>Perhaps the Windows driver simply allocates 10 MB or so as buffer
<BR>
memory, and issues just one read read command for it... Or Perhaps the
<BR>
following happens: The Twain driver allocates a larger chunk of buffer
<BR>
memory, and then calls the ASPI layer several times. Perhaps the broken
<BR>
multitasking concept of Win95/98 is an advantage in this case: The SCSI
<BR>
commands probably don't need to be queued in a complex way as with
<BR>
Linux, so that it is easier to achieve a very short delay between the
<BR>
end of a SCSI command and the start of the next command. (An example for
<BR>
the downside of the Win95 concept: Copying larger files over a network
<BR>
for example causes 100% CPU load...)
<BR>
<P><EM>&gt; So the scanner is able to send lots of buffers without stopping the scanhead
</EM><BR>
<EM>&gt; but not with SANE.
</EM><BR>
<EM>&gt;
</EM><BR>
<EM>&gt; In both cases I use an NCR53c810 scsi adapter.
</EM><BR>
<P>That's probably not the worst choice.
<BR>
<P><EM>&gt; &gt; Well, I think that the sanei_scsi_req_enter / sanei_scsi_req_wait
</EM><BR>
<EM>&gt; &gt; mechanism should give similar results as command repeating, but the
</EM><BR>
<EM>&gt; &gt; former is more flexible, because you can also sent some status inquiries
</EM><BR>
<EM>&gt; &gt; or whatever between to &quot;read data&quot; commands.
</EM><BR>
<EM>&gt; &gt;
</EM><BR>
<EM>&gt;
</EM><BR>
<EM>&gt; Any ideas how we can test if sanei_scsI-req_enter is as fast as multiple reads in
</EM><BR>
<EM>&gt; the kernel?
</EM><BR>
<P>Difficult question; I don't know, if or how it is possible to issue
<BR>
multiple reads for the Linux kernel. But my guess is, that those
<BR>
multiple reads would have to be queued just like several SCSI commands
<BR>
being sent via sanei_scsi_req_enter and a write to the SG device file.
<BR>
(Douglas, any comments?)
<BR>
[larger block sizes]
<BR>
<P><EM>&gt; Unbelievable, you are right: I just did a test with a scsi buffer that is greater
</EM><BR>
<EM>&gt; than the scanner internal image buffer and in fact the number of backtracks
</EM><BR>
<EM>&gt; is reduced (and the scanner does not stop after each buffer, it scans 4-5 buffers
</EM><BR>
<EM>&gt; before it stops).
</EM><BR>
<EM>&gt;
</EM><BR>
<EM>&gt; I will play around a bit with that.
</EM><BR>
<EM>&gt;
</EM><BR>
<EM>&gt; At least we can give the user the selection how much mem sane may use to scan.
</EM><BR>
<EM>&gt; And a 2MB Buffer should not too bad if it solves the backtracking problem.
</EM><BR>
<P>With buffer sizes that large, the SG driver sometimes complained for me
<BR>
that it could not allocate the buffer. And the SG driver reserves only
<BR>
one buffer permanently (means, while the device file is open). If you
<BR>
queue more than one command, the SG driver dynamically allocates another
<BR>
buffer for each command. That can lead to swapping, or the queueing cail
<BR>
fail with ENOMEM. sanei_scsi.c handles this case, but then the low level
<BR>
queueing is not used, and you end up again with longer delays between
<BR>
two commands. Therefore I think that buffers of that size are fine for
<BR>
testing and probably also on an only lightly loaded machine with enough
<BR>
memory installed, but in most cases I would recommend smaller buffers.
<BR>
<P>Abel
<BR>
<P><PRE>
--
Source code, list archive, and docs: <A HREF="http://www.mostang.com/sane/">http://www.mostang.com/sane/</A>
To unsubscribe: echo unsubscribe sane-devel | mail <A HREF="mailto:majordomo@mostang.com?Subject=Re:%20scsi%20command%20queuing&In-Reply-To=&lt;395C94CB.2E156E92@satzbau-gmbh.de&gt;">majordomo@mostang.com</A>
</PRE>
<P><!-- body="end" -->
<HR NOSHADE>
<UL>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0226.html">Nathan Stenzel: "Can I plug my printer into my scanner and have it work?"</A>
<LI><STRONG>Previous message:</STRONG> <A HREF="0224.html">Petter Reinholdtsen: "Re: bug in saned"</A>
<LI><STRONG>In reply to:</STRONG> <A HREF="0216.html">Oliver Rauch: "Re: scsi command queuing"</A>
<!-- nextthread="start" -->
<LI><STRONG>Next in thread:</STRONG> <A HREF="0228.html">Oliver Rauch: "Re: scsi command queuing"</A>
<LI><STRONG>Reply:</STRONG> <A HREF="0228.html">Oliver Rauch: "Re: scsi command queuing"</A>
<LI><STRONG>Reply:</STRONG> <A HREF="0240.html">Douglas Gilbert: "Re: scsi command queuing"</A>
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#225">[ date ]</A>
<A HREF="index.html#225">[ thread ]</A>
<A HREF="subject.html#225">[ subject ]</A>
<A HREF="author.html#225">[ author ]</A>
</UL>
<!-- trailer="footer" -->
<HR NOSHADE>
<P>
<SMALL>
<EM>
This archive was generated by <A HREF="http://www.hypermail.org/">hypermail 2b29</A>
: <EM>Fri Jun 30 2000 - 05:30:22 PDT</EM>
</EM>
</SMALL>
</BODY>
</HTML>