kopia lustrzana https://gitlab.com/sane-project/website
330 wiersze
11 KiB
HTML
330 wiersze
11 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: FIX: color scanning problems with snapscans in</TITLE>
|
|
<META NAME="Author" CONTENT="Lawrence Glaister (lg@jfm.bc.ca)">
|
|
<META NAME="Subject" CONTENT="Re: FIX: color scanning problems with snapscans in sane 1.0.3">
|
|
</HEAD>
|
|
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
|
|
<H1>Re: FIX: color scanning problems with snapscans in sane 1.0.3</H1>
|
|
<!-- received="Thu Sep 28 17:19:27 2000" -->
|
|
<!-- isoreceived="20000929001927" -->
|
|
<!-- sent="Thu, 28 Sep 2000 17:34:52 -0700" -->
|
|
<!-- isosent="20000929003452" -->
|
|
<!-- name="Lawrence Glaister" -->
|
|
<!-- email="lg@jfm.bc.ca" -->
|
|
<!-- subject="Re: FIX: color scanning problems with snapscans in sane 1.0.3" -->
|
|
<!-- id="03ca01c029ad$179b2b20$bf0aa8c0@dufusiii" -->
|
|
<!-- inreplyto="Pine.LNX.4.21.0009281949540.497-100000@up.physik.uni-mainz.de" -->
|
|
<STRONG>From:</STRONG> Lawrence Glaister (<A HREF="mailto:lg@jfm.bc.ca?Subject=Re:%20FIX:%20color%20scanning%20problems%20with%20snapscans%20in%20sane%201.0.3&In-Reply-To=<03ca01c029ad$179b2b20$bf0aa8c0@dufusiii>"><EM>lg@jfm.bc.ca</EM></A>)<BR>
|
|
<STRONG>Date:</STRONG> Thu Sep 28 2000 - 17:34:52 PDT
|
|
<P>
|
|
<!-- next="start" -->
|
|
<LI><STRONG>Next message:</STRONG> <A HREF="0298.html">kwlee: "SANE 2.0"</A>
|
|
<UL>
|
|
<LI><STRONG>Previous message:</STRONG> <A HREF="0296.html">Oliver Rauch: "Re: io error on xsane"</A>
|
|
<!-- nextthread="start" -->
|
|
<!-- reply="end" -->
|
|
<LI><STRONG>Messages sorted by:</STRONG>
|
|
<A HREF="date.html#297">[ date ]</A>
|
|
<A HREF="index.html#297">[ thread ]</A>
|
|
<A HREF="subject.html#297">[ subject ]</A>
|
|
<A HREF="author.html#297">[ author ]</A>
|
|
</UL>
|
|
<HR NOSHADE><P>
|
|
<!-- body="start" -->
|
|
<P>
|
|
Hi Richard,
|
|
<BR>
|
|
I have my code full of debug entries, so a patch is not is not too practical
|
|
<BR>
|
|
at
|
|
<BR>
|
|
this time. I have included the 2 routines you need to change... cut and
|
|
<BR>
|
|
paste should get you there. Sorry if my mailer trashed the formatting.
|
|
<BR>
|
|
<P>/*
|
|
<BR>
|
|
* replace 2 routines in backend/snapscan-sources.c with
|
|
<BR>
|
|
* the following code. You can remove some of the debug code
|
|
<BR>
|
|
* if you like... it is still in use here.
|
|
<BR>
|
|
* Lawrence Glaister VE7IT <A HREF="mailto:lg@jfm.bc.ca?Subject=Re:%20FIX:%20color%20scanning%20problems%20with%20snapscans%20in%20sane%201.0.3&In-Reply-To=<03ca01c029ad$179b2b20$bf0aa8c0@dufusiii>">lg@jfm.bc.ca</A>
|
|
<BR>
|
|
*/
|
|
<BR>
|
|
<P><P>static SANE_Status
|
|
<BR>
|
|
FDSource_get (Source * pself, SANE_Byte * pbuf, SANE_Int * plen)
|
|
<BR>
|
|
{
|
|
<BR>
|
|
SANE_Status status = SANE_STATUS_GOOD;
|
|
<BR>
|
|
FDSource *ps = (FDSource *) pself;
|
|
<BR>
|
|
SANE_Int remaining = *plen;
|
|
<BR>
|
|
SANE_Int plen_in = *plen;
|
|
<BR>
|
|
<P> while (remaining > 0
|
|
<BR>
|
|
&& pself->remaining (pself) > 0 && status == SANE_STATUS_GOOD)
|
|
<BR>
|
|
{
|
|
<BR>
|
|
SANE_Int bytes_read = read(ps->fd, pbuf, remaining);
|
|
<BR>
|
|
if (bytes_read == -1)
|
|
<BR>
|
|
{
|
|
<BR>
|
|
if (errno == EAGAIN)
|
|
<BR>
|
|
{
|
|
<BR>
|
|
/* No data currently available */
|
|
<BR>
|
|
DBG (1, "FDSource_get EAGAIN break requested=%d
|
|
<BR>
|
|
remaining=%d\n",plen_in,remaining);
|
|
<BR>
|
|
usleep(10000); // give the usb driver a 10ms to get more data
|
|
<BR>
|
|
continue;
|
|
<BR>
|
|
/*============> break; ===replaced by 2 lines above*/
|
|
<BR>
|
|
}
|
|
<BR>
|
|
/* It's an IO error */
|
|
<BR>
|
|
DBG (1,
|
|
<BR>
|
|
"%s: read failed: %s\n", __FUNCTION__, strerror (errno));
|
|
<BR>
|
|
status = SANE_STATUS_IO_ERROR;
|
|
<BR>
|
|
}
|
|
<BR>
|
|
else if (bytes_read == 0)
|
|
<BR>
|
|
{
|
|
<BR>
|
|
break;
|
|
<BR>
|
|
}
|
|
<BR>
|
|
ps->pss->bytes_remaining -= bytes_read;
|
|
<BR>
|
|
remaining -= bytes_read;
|
|
<BR>
|
|
pbuf += bytes_read;
|
|
<BR>
|
|
}
|
|
<BR>
|
|
<P> *plen -= remaining;
|
|
<BR>
|
|
<P> DBG (1, "FDSource_get plen_in=%d plen_out=%d\n", plen_in,*plen);
|
|
<BR>
|
|
return status;
|
|
<BR>
|
|
}
|
|
<BR>
|
|
<P><P><P>static SANE_Int
|
|
<BR>
|
|
RGBRouter_remaining (Source * pself)
|
|
<BR>
|
|
{
|
|
<BR>
|
|
RGBRouter *ps = (RGBRouter *) pself;
|
|
<BR>
|
|
static char me[] = "RGBRouter_remaining";
|
|
<BR>
|
|
SANE_Int remaining1 =
|
|
<BR>
|
|
(TxSource_remaining (pself) - ps->cb_size + ps->cb_line_size);
|
|
<BR>
|
|
SANE_Int remaining2 =
|
|
<BR>
|
|
(TxSource_remaining (pself) + ps->cb_line_size - ps->pos);
|
|
<BR>
|
|
SANE_Int remaining;
|
|
<BR>
|
|
<P><P> if (ps->cb_start < 0)
|
|
<BR>
|
|
remaining = remaining1;
|
|
<BR>
|
|
else
|
|
<BR>
|
|
remaining = remaining2;
|
|
<BR>
|
|
<P> DBG (1,
|
|
<BR>
|
|
"%s TxSource_remaining()= %d, pos= %d, cb_size =%d, cb_line_size=%d,
|
|
<BR>
|
|
cb_start=%d ch_offset[]=%d %d %d\n",
|
|
<BR>
|
|
me, TxSource_remaining (pself), ps->pos, ps->cb_size,
|
|
<BR>
|
|
ps->cb_line_size,
|
|
<BR>
|
|
ps->cb_start, ps->ch_offset[0], ps->ch_offset[1], ps->ch_offset[2]);
|
|
<BR>
|
|
<P><P> DBG (1, "%s %d %d ret=%d\n", me, remaining1, remaining2, remaining);
|
|
<BR>
|
|
if ( remaining < 0 )
|
|
<BR>
|
|
{
|
|
<BR>
|
|
usleep(100000);
|
|
<BR>
|
|
remaining = 1;
|
|
<BR>
|
|
DBG(1,"%s, ERROR -- setting remaining to 1 to save our ass\n",me);
|
|
<BR>
|
|
}
|
|
<BR>
|
|
return remaining;
|
|
<BR>
|
|
}
|
|
<BR>
|
|
<P><P><P>=======================================================
|
|
<BR>
|
|
Lawrence Glaister VE7IT email: <A HREF="mailto:lg@jfm.bc.ca?Subject=Re:%20FIX:%20color%20scanning%20problems%20with%20snapscans%20in%20sane%201.0.3&In-Reply-To=<03ca01c029ad$179b2b20$bf0aa8c0@dufusiii>">lg@jfm.bc.ca</A>
|
|
<BR>
|
|
1462 Madrona Drive <A HREF="http://jfm.bc.ca">http://jfm.bc.ca</A>
|
|
<BR>
|
|
Nanoose Bay BC Canada
|
|
<BR>
|
|
V9P 9C9
|
|
<BR>
|
|
=======================================================
|
|
<BR>
|
|
----- Original Message -----
|
|
<BR>
|
|
From: Richard B. Kreckel <<A HREF="mailto:kreckel@ginac.de?Subject=Re:%20FIX:%20color%20scanning%20problems%20with%20snapscans%20in%20sane%201.0.3&In-Reply-To=<03ca01c029ad$179b2b20$bf0aa8c0@dufusiii>">kreckel@ginac.de</A>>
|
|
<BR>
|
|
To: Lawrence Glaister <<A HREF="mailto:lg@jfm.bc.ca?Subject=Re:%20FIX:%20color%20scanning%20problems%20with%20snapscans%20in%20sane%201.0.3&In-Reply-To=<03ca01c029ad$179b2b20$bf0aa8c0@dufusiii>">lg@jfm.bc.ca</A>>
|
|
<BR>
|
|
Cc: <<A HREF="mailto:sane-devel@mostang.com?Subject=Re:%20FIX:%20color%20scanning%20problems%20with%20snapscans%20in%20sane%201.0.3&In-Reply-To=<03ca01c029ad$179b2b20$bf0aa8c0@dufusiii>">sane-devel@mostang.com</A>>
|
|
<BR>
|
|
Sent: Thursday, September 28, 2000 10:53 AM
|
|
<BR>
|
|
Subject: Re: FIX: color scanning problems with snapscans in sane 1.0.3
|
|
<BR>
|
|
<P><P><EM>> On Thu, 28 Sep 2000, Lawrence Glaister wrote:
|
|
</EM><BR>
|
|
<EM>> > thankyou for the feedback on the change.... I am surprised you see the
|
|
</EM><BR>
|
|
same
|
|
<BR>
|
|
<EM>> > problems with the 1236s as I thought the problem was only related to usb
|
|
</EM><BR>
|
|
<EM>> > connected scanners. I did end up removing the change below and modifying
|
|
</EM><BR>
|
|
the
|
|
<BR>
|
|
<EM>> > code in two other places.
|
|
</EM><BR>
|
|
<EM>> > In backend/snapscan-sources.c RGBRouter_remaining(), I added a check for
|
|
</EM><BR>
|
|
<EM>> > a -ve return code and if negative, I returned 1. This is a really gross
|
|
</EM><BR>
|
|
hack
|
|
<BR>
|
|
<EM>> > but was required to get my scanner working at 600dpi. I know the reason
|
|
</EM><BR>
|
|
for
|
|
<BR>
|
|
<EM>> > the problem (scan would hang forever without moving the scanhead) and
|
|
</EM><BR>
|
|
have
|
|
<BR>
|
|
<EM>> > discussed it with Steve Underwood, but have not come up with a cleaner
|
|
</EM><BR>
|
|
fix
|
|
<BR>
|
|
<EM>> > yet. The second change was in backend/snapscan-sources.c FDSource_get().
|
|
</EM><BR>
|
|
<EM>> > At the bottom of the if (errno==EAGAIN) code, remove the break and add 2
|
|
</EM><BR>
|
|
<EM>> > lines: usleep(10000); and continue;
|
|
</EM><BR>
|
|
<EM>> > This will clear up the problem that the resulted in corrupted color
|
|
</EM><BR>
|
|
images
|
|
<BR>
|
|
<EM>> > or missing scanner data. You can return the code in RGBRouter_get() to
|
|
</EM><BR>
|
|
<EM>> > normal as the problem is fixed by the EAGAIN patch above.
|
|
</EM><BR>
|
|
<EM>> > I would like a little more feedback from snapscan users and some more
|
|
</EM><BR>
|
|
<EM>> > testing by myself before proposing the fixes as patches.
|
|
</EM><BR>
|
|
<EM>>
|
|
</EM><BR>
|
|
<EM>> Err, can you send me a patch file? Can I get this from CVS? Or from
|
|
</EM><BR>
|
|
<EM>> elsewhere? I am absolutely new to the sane code and the description above
|
|
</EM><BR>
|
|
<EM>> is beyond me but I would be glad to help testing things. (Sorry for being
|
|
</EM><BR>
|
|
<EM>> a bit dense...)
|
|
</EM><BR>
|
|
<EM>>
|
|
</EM><BR>
|
|
<EM>> Regards
|
|
</EM><BR>
|
|
<EM>> -richy.
|
|
</EM><BR>
|
|
<EM>> --
|
|
</EM><BR>
|
|
<EM>> Richard Kreckel
|
|
</EM><BR>
|
|
<EM>> <<A HREF="mailto:Richard.Kreckel@Uni-Mainz.DE?Subject=Re:%20FIX:%20color%20scanning%20problems%20with%20snapscans%20in%20sane%201.0.3&In-Reply-To=<03ca01c029ad$179b2b20$bf0aa8c0@dufusiii>">Richard.Kreckel@Uni-Mainz.DE</A>>
|
|
</EM><BR>
|
|
<EM>> <<A HREF="http://wwwthep.physik.uni-mainz.de/~kreckel/">http://wwwthep.physik.uni-mainz.de/~kreckel/</A>>
|
|
</EM><BR>
|
|
<EM>>
|
|
</EM><BR>
|
|
<EM>>
|
|
</EM><BR>
|
|
<EM>>
|
|
</EM><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?Subject=Re:%20FIX:%20color%20scanning%20problems%20with%20snapscans%20in%20sane%201.0.3&In-Reply-To=<03ca01c029ad$179b2b20$bf0aa8c0@dufusiii>">majordomo@mostang.com</A>
|
|
</PRE>
|
|
<P><!-- body="end" -->
|
|
<HR NOSHADE>
|
|
<UL>
|
|
<!-- next="start" -->
|
|
<LI><STRONG>Next message:</STRONG> <A HREF="0298.html">kwlee: "SANE 2.0"</A>
|
|
<LI><STRONG>Previous message:</STRONG> <A HREF="0296.html">Oliver Rauch: "Re: io error on xsane"</A>
|
|
<!-- nextthread="start" -->
|
|
<!-- reply="end" -->
|
|
<LI><STRONG>Messages sorted by:</STRONG>
|
|
<A HREF="date.html#297">[ date ]</A>
|
|
<A HREF="index.html#297">[ thread ]</A>
|
|
<A HREF="subject.html#297">[ subject ]</A>
|
|
<A HREF="author.html#297">[ 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>Thu Sep 28 2000 - 17:21:58 PDT</EM>
|
|
</EM>
|
|
</SMALL>
|
|
</BODY>
|
|
</HTML>
|