sane-project-website/old-archive/1999-06/0243.html

145 wiersze
7.1 KiB
HTML

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

<!-- received="Tue Jun 29 23:46:12 1999 PDT" -->
<!-- sent="Wed, 30 Jun 1999 08:46:58 +0200" -->
<!-- name="Rainer Krienke" -->
<!-- email="krienke@uni-koblenz.de" -->
<!-- subject="Re: problems increasing SG_BIG_BUFF" -->
<!-- id="" -->
<!-- inreplyto="problems increasing SG_BIG_BUFF" -->
<title>sane-devel: Re: problems increasing SG_BIG_BUFF</title>
<h1>Re: problems increasing SG_BIG_BUFF</h1>
<b>Rainer Krienke</b> (<a href="mailto:krienke@uni-koblenz.de"><i>krienke@uni-koblenz.de</i></a>)<br>
<i>Wed, 30 Jun 1999 08:46:58 +0200</i>
<p>
<ul>
<li> <b>Messages sorted by:</b> <a href="date.html#243">[ date ]</a><a href="index.html#243">[ thread ]</a><a href="subject.html#243">[ subject ]</a><a href="author.html#243">[ author ]</a>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0244.html">Kick Glorie: "Re: Problem with snapscan, aha1505, linux kernel 2.2.9"</a>
<li> <b>Previous message:</b> <a href="0242.html">Douglas Gilbert: "Re: Problem with snapscan, aha1505, linux kernel 2.2.9"</a>
<li> <b>Maybe in reply to:</b> <a href="0047.html">Andreas Buesching: "problems increasing SG_BIG_BUFF"</a>
<!-- nextthread="start" -->
<li> <b>Next in thread:</b> <a href="0246.html">abel deuring: "Re: problems increasing SG_BIG_BUFF"</a>
<!-- reply="end" -->
</ul>
<!-- body="start" -->
Douglas Gilbert wrote:<br>
<i>&gt; </i><br>
<i>&gt; wrote:</i><br>
<i>&gt; &gt;</i><br>
<i>&gt; &gt; Hello Developers,</i><br>
<i>&gt; &gt;</i><br>
<i>&gt; &gt; my situation:</i><br>
<i>&gt; &gt; SuSE 6.1</i><br>
<i>&gt; &gt; new kernel 2.2.9</i><br>
<i>&gt; &gt; /usr/include/scsi is linked to /usr/src/linux/include/scsi</i><br>
<i>&gt; </i><br>
<i>&gt; Monty (cdparanoia author) has a nice way around the</i><br>
<i>&gt; above directory problem:</i><br>
<i>&gt; </i><br>
<i>&gt; #include &lt;linux/../scsi/sg.h&gt;</i><br>
<i>&gt; #include &lt;linux/../scsi/scsi.h&gt;</i><br>
<i>&gt; </i><br>
<i>&gt; [An elegant hack!]</i><br>
<i>&gt; </i><br>
<i>&gt; &gt;</i><br>
<i>&gt; &gt; problem:</i><br>
<i>&gt; &gt; I tried to increase the generic-scsi buffer. The man-pages told me to change</i><br>
<i>&gt; &gt; SG_BIG_BUFF. the new kernel uses another define (SG_SCATTER_SZ), but there are</i><br>
<i>&gt; &gt; also these two lines:</i><br>
<i>&gt; &gt;</i><br>
<i>&gt; &gt; #define SG_BIG_BUFF SG_SCATTER_SZ /* for backward compatibility */</i><br>
<i>&gt; &gt; /* #define SG_BIG_BUFF (SG_SCATTER_SZ * 8) */ /* =256KB, if you want */</i><br>
<i>&gt; &gt;</i><br>
<i>&gt; &gt; So I increased SG_BIG_BUFF and compiled the kernel and sane again.</i><br>
<i>&gt; &gt; The result was: nothing. Some months ago when I used an older kernel (2.0.x),</i><br>
<i>&gt; &gt; there was an result: My scanner did not stop every 5mm to transfer the data (it</i><br>
<i>&gt; &gt; sounds horrible if it stops every 5mm).</i><br>
<i>&gt; &gt;</i><br>
<i>&gt; &gt; My question:</i><br>
<i>&gt; &gt; Can anybody help me? How to increase the buffer?</i><br>
<i>&gt; &gt;</i><br>
<i>&gt; Andreas,</i><br>
<i>&gt; You may like to try this ... go to</i><br>
<i>&gt; <a href="http://www.torque.net/sg">http://www.torque.net/sg</a></i><br>
<i>&gt; and download sg version 2.1.34 (you have version</i><br>
<i>&gt; 2.1.32 in 2.2.9). In the new sg.h change the</i><br>
<i>&gt; SG_DEF_RESERVED_SIZE to 262144 and try that.</i><br>
<i>&gt; [This assumes that your SCSI adapter does scatter</i><br>
<i>&gt; gather which even most ISA ones do.]</i><br>
<i>&gt; </i><br>
<i>&gt; While your at that web site you may be interested</i><br>
<i>&gt; in the documentation's section on "SG_BIG_BUFF and</i><br>
<i>&gt; friends".</i><br>
<i>&gt; </i><br>
<i>&gt; BTW 2.2.9-ac3 also contains the most recent sg</i><br>
<i>&gt; driver.</i><br>
<i>&gt; </i><br>
<i>&gt; In the new sg driver SG_BIG_BUFF exists for backward</i><br>
<i>&gt; compatibility (which doesn't extend to people</i><br>
<i>&gt; changing it :-) ). Internally the sg driver takes</i><br>
<i>&gt; no account of it. Some apps are fooled by it but not,</i><br>
<i>&gt; it would seem, sane.</i><br>
<i>&gt; </i><br>
<i>&gt; Hopefully in the future the sane linux transport layer</i><br>
<i>&gt; will use the SG_SET_RESERVED_BUFFER ioctl() and sane's</i><br>
<i>&gt; documentation will stop recommending people hacking</i><br>
<i>&gt; the sg.h header file. Under 2.2 with the original</i><br>
<i>&gt; sg driver this is a very dangerous thing to do (ie</i><br>
<i>&gt; greatly increases the probably of an ENOMEM induced</i><br>
<i>&gt; oops, especially on modules).</i><br>
<i>&gt; </i><br>
<i>&gt; Doug Gilbert</i><br>
<i>&gt; </i><br>
<i>&gt; --</i><br>
<p>
I have nearly the same situation (kernel 2.2.10) and the same problems<br>
like Andreas Buesching. <br>
<p>
I changed the definition of SG_DEF_RESERVED_SIZE to the value mentioned<br>
above and basically it works but practically it is still unusable. I<br>
tried to scan a DINA4 page with 300DPI in color mode. This is, at least<br>
for me, a usual configuration for scanning pictures. The scan took about<br>
3 minutes and the scanner sounded really ill doing the backtracking all<br>
the time. <br>
<p>
Before I used the old sg driver with a patch that uses a static buffer<br>
of 1MBytes in size. This prevents the sg driver of beeing used as a<br>
module but has a really great effect in scanning time. To scan a DINA4<br>
page in 300 DPI color mode then takes only 45 seconds. Compared to the<br>
new sg driver this is about 4 times faster and after all it probably<br>
will be good for the scanner hardware itself as well (it needs do to<br>
backtracking only about 5 times compared to &gt;20 times using the new<br>
driver).<br>
<p>
Wouldn<EFBFBD>t it be possible to include such a static buffer (optional) in<br>
the new sg driver as well? The best new driver doesn't help, if you<br>
actually cannot use it in real live and as you can see from the examples<br>
avove this is true for the current situation.<br>
<p>
Thanks<br>
Rainer<br>
<pre>
--
---------------------------------------------------------------------
Rainer Krienke <a href="mailto:krienke@uni-koblenz.de">krienke@uni-koblenz.de</a>
Universitaet Koblenz, <a href="http://www.uni-koblenz.de/~krienke">http://www.uni-koblenz.de/~krienke</a>
Rechenzentrum, Voice: +49 261 287 - 1312
Rheinau 1, 56075 Koblenz, Germany Fax: +49 261 287 - 1355
---------------------------------------------------------------------
<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">majordomo@mostang.com</a>
</pre>
<!-- body="end" -->
<p>
<ul>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0244.html">Kick Glorie: "Re: Problem with snapscan, aha1505, linux kernel 2.2.9"</a>
<li> <b>Previous message:</b> <a href="0242.html">Douglas Gilbert: "Re: Problem with snapscan, aha1505, linux kernel 2.2.9"</a>
<li> <b>Maybe in reply to:</b> <a href="0047.html">Andreas Buesching: "problems increasing SG_BIG_BUFF"</a>
<!-- nextthread="start" -->
<li> <b>Next in thread:</b> <a href="0246.html">abel deuring: "Re: problems increasing SG_BIG_BUFF"</a>
<!-- reply="end" -->
</ul>