sane-project-website/old-archive/2000-09/0251.html

141 wiersze
5.6 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: 1.0.3 snapscan interface</TITLE>
<META NAME="Author" CONTENT="Lawrence Glaister (lg@jfm.bc.ca)">
<META NAME="Subject" CONTENT="1.0.3 snapscan interface">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>1.0.3 snapscan interface</H1>
<!-- received="Sun Sep 24 17:55:42 2000" -->
<!-- isoreceived="20000925005542" -->
<!-- sent="Sun, 24 Sep 2000 18:02:08 -0700" -->
<!-- isosent="20000925010208" -->
<!-- name="Lawrence Glaister" -->
<!-- email="lg@jfm.bc.ca" -->
<!-- subject="1.0.3 snapscan interface" -->
<!-- id="02b001c0268c$3aed96e0$bf0aa8c0@dufusiii" -->
<STRONG>From:</STRONG> Lawrence Glaister (<A HREF="mailto:lg@jfm.bc.ca?Subject=Re:%201.0.3%20snapscan%20interface&In-Reply-To=&lt;02b001c0268c$3aed96e0$bf0aa8c0@dufusiii&gt;"><EM>lg@jfm.bc.ca</EM></A>)<BR>
<STRONG>Date:</STRONG> Sun Sep 24 2000 - 18:02:08 PDT
<P>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0252.html">Dave Hill: "find-scanner (Was: Re: scanmagic 4800p doesnt work)"</A>
<UL>
<LI><STRONG>Previous message:</STRONG> <A HREF="0250.html">Nick Lamb: "Re: sane-devel mailing list blocking non-subscribers"</A>
<!-- nextthread="start" -->
<LI><STRONG>Next in thread:</STRONG> <A HREF="0255.html">abel deuring: "Re: 1.0.3 snapscan interface"</A>
<LI><STRONG>Reply:</STRONG> <A HREF="0255.html">abel deuring: "Re: 1.0.3 snapscan interface"</A>
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#251">[ date ]</A>
<A HREF="index.html#251">[ thread ]</A>
<A HREF="subject.html#251">[ subject ]</A>
<A HREF="author.html#251">[ author ]</A>
</UL>
<HR NOSHADE><P>
<!-- body="start" -->
<P>
Thanks for the pointer Steve,
<BR>
I have been digging further and you are right, TxSource is returning 0 bytes
<BR>
on a regular basis. It turns out that the read in FDSource_get() is hitting
<BR>
the EAGAIN break which leaves the status at SANE_STATUS_GOOD. I wonder why
<BR>
the usb interface is returning a read status of &quot;Resource temporarily
<BR>
unavailable&quot;. Would it make more sense to put a small sleep and a continue
<BR>
in place of the break? This would make the code wait for the data or a
<BR>
timeout at a lower level.
<BR>
-sometime later that evening...
<BR>
I just tried a usleep(2000) and a continue added into the EAGAIN condition
<BR>
in FDSource_get() instead of the break, and restored the code in
<BR>
RGBRouter_get(). This does seem to work. I noticed that the scanner does
<BR>
&quot;backtrack&quot; occasionally on large scans and this coincides perfectly with
<BR>
hitting the EAGAIN condition. It looks like the scanner is responding to usb
<BR>
read requests with a &quot;try again later&quot; and these are getting passed back up
<BR>
the chain... it is possible that other versions of usb kernel code will
<BR>
block on a read() until data is ready instead of returning with EAGAIN. I
<BR>
don't know what the scsi driver does, but if the reads dont return until
<BR>
data is available or an error occurs, this would explain the problems I have
<BR>
been seeing. I looked at the umax scsi code (I also have a umax 12120s scsi
<BR>
scanner) and it looks like it has all been written such that an EAGAIN
<BR>
condition with 0 bytes would cause problems. Where would you suggest a fix?
<BR>
hanging in the low level USB read? Hanging in FDSource_get? Hanging in
<BR>
TXsource_get? Handling the 0 bytes being returned without an error status in
<BR>
RGBRouter_get()? The EAGAIN condition occurs with my system even when
<BR>
scanning b/w images, but I was not seeing errors because there always was
<BR>
some data returned and not 0 bytes. The FSSource_get() seems to be the
<BR>
lowest level point in common code for scsi and usb scanners and the usb code
<BR>
patches are the lowest level user code for usb specific snapscan scanners.
<BR>
=======================================================
<BR>
Lawrence Glaister VE7IT email: <A HREF="mailto:lg@jfm.bc.ca?Subject=Re:%201.0.3%20snapscan%20interface&In-Reply-To=&lt;02b001c0268c$3aed96e0$bf0aa8c0@dufusiii&gt;">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>
<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:%201.0.3%20snapscan%20interface&In-Reply-To=&lt;02b001c0268c$3aed96e0$bf0aa8c0@dufusiii&gt;">majordomo@mostang.com</A>
</PRE>
<P><!-- body="end" -->
<HR NOSHADE>
<UL>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0252.html">Dave Hill: "find-scanner (Was: Re: scanmagic 4800p doesnt work)"</A>
<LI><STRONG>Previous message:</STRONG> <A HREF="0250.html">Nick Lamb: "Re: sane-devel mailing list blocking non-subscribers"</A>
<!-- nextthread="start" -->
<LI><STRONG>Next in thread:</STRONG> <A HREF="0255.html">abel deuring: "Re: 1.0.3 snapscan interface"</A>
<LI><STRONG>Reply:</STRONG> <A HREF="0255.html">abel deuring: "Re: 1.0.3 snapscan interface"</A>
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#251">[ date ]</A>
<A HREF="index.html#251">[ thread ]</A>
<A HREF="subject.html#251">[ subject ]</A>
<A HREF="author.html#251">[ 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>Sun Sep 24 2000 - 17:56:25 PDT</EM>
</EM>
</SMALL>
</BODY>
</HTML>