sane-project-website/old-archive/1998-02/0181.html

158 wiersze
6.8 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="Thu Feb 26 06:08:14 1998 PST" -->
<!-- sent="Thu, 26 Feb 1998 15:07:21 +0100 (MET)" -->
<!-- name="Norbert Mueller" -->
<!-- email="mueller@uni-trier.de" -->
<!-- subject="Mustek scanner: success!" -->
<!-- id="" -->
<!-- inreplyto="" -->
<title>sane-devel: Mustek scanner: success!</title>
<h1>Mustek scanner: success!</h1>
<b>Norbert Mueller</b> (<a href="mailto:mueller@uni-trier.de"><i>mueller@uni-trier.de</i></a>)<br>
<i>Thu, 26 Feb 1998 15:07:21 +0100 (MET)</i>
<p>
<ul>
<li> <b>Messages sorted by:</b> <a href="date.html#181">[ date ]</a><a href="index.html#181">[ thread ]</a><a href="subject.html#181">[ subject ]</a><a href="author.html#181">[ author ]</a>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0182.html">Jeff Freedman: "Microtek question"</a>
<li> <b>Previous message:</b> <a href="0180.html">Christoph Doerbeck: "Re: Request for Information"</a>
<!-- nextthread="start" -->
<!-- reply="end" -->
</ul>
<!-- body="start" -->
For now almost half a year I own a Mustek scanner:<br>
<p>
model name: 600 II SP SCANMAGIC<br>
<p>
A check with "export SANE_DEBUG_MUSTEK=127; /usr/local/bin/scanimage -h"<br>
gives the following result:<br>
<p>
firmware revision 2.03<br>
Mustek scanner model MFC-06000CZ (flatbed scanner), 1-pass<br>
<p>
It is attachted to my computer via an old scsi card (Always IN 2000).<br>
<p>
I used to have the usual problems (lost lines, colored stripes) that have<br>
often been mentionend in this mailing list. In addition there were a few<br>
unusual problems that twice almost lead to a almost fatal hardware damage<br>
of the scanner. But after defining MUSTEK_FLAG_USE_EIGHTS for my model, <br>
I was able at least to scan lineart or grayscale with (fixed) resolution of <br>
600dpi.<br>
<p>
Yesterday, I tested kernel 2.1.88 instead of 2.0.32, and suddenly, many<br>
things changed!<br>
<p>
-&gt; The scanner started reacting to resolution changes (although a small patch<br>
was neccessary to get full functionality).<br>
<p>
-&gt; From then on the line distance correction was ok.<br>
<p>
-&gt; The colored stripes are gone.<br>
<p>
-&gt; With additionally setting OPT_BACKTRACK to SANE_TRUE, even the lost lines<br>
were gone.<br>
<p>
Now my scanner is fully functional (as far as I can say)!<br>
<p>
I would recommend three things to anyone having similar problems:<br>
<p>
1) Try a newer kernel of the 2.1.xx-series,<br>
the generic scsi driver (sg.c) is different<br>
<p>
2) If you suffer from lost lines, try setting OPT_BACKTRACK to SANE_TRUE.<br>
This worked for me, although the scanning now is slower. <br>
Just an idea: Does anybody know whether there is a possibility to change <br>
the fixed sized buffer in sg.c to a circular list of e.g. 20 buffers of <br>
size such that the scanner may write to the list while at the same time <br>
the application reads from the list? As usually most CPU's are capable to <br>
read the data faster than the scanner can deliver, the circular list would <br>
never be full and backtracking would no longer happen.<br>
<p>
3) If you have the same model as I do, try MUSTEK_FLAG_USE_EIGHTS:<br>
Using the standard SANE (regardless which one, up to 0.71), my scanner<br>
went wild when scanning more than a few inches. This seems to be an overflow<br>
in the computation of the number of lines, as if twelve bit(?) computation<br>
was used internally in the scanner. So, sometimes, too few lines were scanned.<br>
But sometimes, he tried to scan several 10000 lines (twice leading <br>
to almost fatal hardware problems)...<br>
<p>
Below you find the patches I made to the mustek backend.<br>
<p>
-------------------------------------------------------------------------------<br>
Norbert Mueller <br>
Tel: ..49-(0)651-201-2845 <a href="http://www.informatik.uni-trier.de/~mueller/">http://www.informatik.uni-trier.de/~mueller/</a> <br>
Fax: ..49-(0)651-201-3805 <a href="mailto:email:mueller@uni-trier.de">email:mueller@uni-trier.de</a> <br>
-------------------------------------------------------------------------------<br>
LG Stochastische Modellierung und Rechnernetze * FB IV - Abteilung Informatik<br>
Universitaet Trier * D-54286 Trier (Germany) <br>
-------------------------------------------------------------------------------<br>
<p>
<p>
<p>
--- mustek.c-orig Thu Feb 26 14:09:15 1998<br>
+++ mustek.c Thu Feb 26 14:46:42 1998<br>
@@ -215,7 +215,8 @@<br>
MUSTEK_SCSI_GET_IMAGE_STATUS, 0x00, 0x00, 0x00, 0x06, 0x00<br>
};<br>
<br>
-#define STORE16(p,v) \<br>
+/* a small typo, but due to its use fortunately without consequences: */<br>
+#define STORE16(cp,v) \<br>
do { \<br>
int value = (v); \<br>
\<br>
@@ -593,6 +594,8 @@<br>
dev-&gt;x_range.max = SANE_FIX (220.0); /* measured */<br>
dev-&gt;y_range.max = SANE_FIX (292.0); /* measured */<br>
dev-&gt;dpi_range.max = SANE_FIX (600);<br>
+/******* vital for 600 II SP SCANMAGIC: ****************************/<br>
+ dev-&gt;flags |= MUSTEK_FLAG_USE_EIGHTS;<br>
}<br>
/* No documentation for these, but they do exist. Duh... */<br>
else if (strncmp (model_name, "MFS-12000SP", 11) == 0)<br>
@@ -852,7 +855,8 @@<br>
mode_select (Mustek_Scanner *s, int color_code)<br>
{<br>
int grain_code, speed_code;<br>
- u_int8_t mode[19], *cp;<br>
+/**** three small changes to get working resolution changes: ****/<br>
+ u_int8_t mode[20], *cp;<br>
<br>
/* the scanners use a funky code for the grain size, let's compute it: */<br>
grain_code = s-&gt;val[OPT_GRAIN_SIZE].w;<br>
@@ -878,7 +882,8 @@<br>
/* set command length and resolution code: */<br>
if (s-&gt;hw-&gt;flags &amp; MUSTEK_FLAG_SINGLE_PASS)<br>
{<br>
- mode[4] = 0x0d;<br>
+ mode[4] = 0x0e;<br>
+ mode[7] = 0;<br>
cp = mode + 17;<br>
STORE16 (cp, s-&gt;resolution_code);<br>
}<br>
@@ -1561,7 +1566,8 @@<br>
s-&gt;opt[OPT_BACKTRACK].title = SANE_TITLE_BACKTRACK;<br>
s-&gt;opt[OPT_BACKTRACK].desc = SANE_DESC_BACKTRACK;<br>
s-&gt;opt[OPT_BACKTRACK].type = SANE_TYPE_BOOL;<br>
- s-&gt;val[OPT_BACKTRACK].w = SANE_FALSE;<br>
+/**** this helped me with the lost lines problem: ****/<br>
+ s-&gt;val[OPT_BACKTRACK].w = SANE_TRUE;<br>
<br>
/* preview */<br>
s-&gt;opt[OPT_PREVIEW].name = SANE_NAME_PREVIEW;<br>
<p>
<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="0182.html">Jeff Freedman: "Microtek question"</a>
<li> <b>Previous message:</b> <a href="0180.html">Christoph Doerbeck: "Re: Request for Information"</a>
<!-- nextthread="start" -->
<!-- reply="end" -->
</ul>