Re: FIX: color scanning problems with snapscans in sane 1.0.3

From: Lawrence Glaister (lg@jfm.bc.ca)
Date: Thu Sep 28 2000 - 09:56:56 PDT

  • Next message: Oliver Rauch: "Re: io error on xsane"

    Hi Richard,
    thankyou for the feedback on the change.... I am surprised you see the same
    problems with the 1236s as I thought the problem was only related to usb
    connected scanners. I did end up removing the change below and modifying the
    code in two other places.
    In backend/snapscan-sources.c RGBRouter_remaining(), I added a check for
    a -ve return code and if negative, I returned 1. This is a really gross hack
    but was required to get my scanner working at 600dpi. I know the reason for
    the problem (scan would hang forever without moving the scanhead) and have
    discussed it with Steve Underwood, but have not come up with a cleaner fix
    yet. The second change was in backend/snapscan-sources.c FDSource_get().
    At the bottom of the if (errno==EAGAIN) code, remove the break and add 2
    lines: usleep(10000); and continue;
    This will clear up the problem that the resulted in corrupted color images
    or missing scanner data. You can return the code in RGBRouter_get() to
    normal as the problem is fixed by the EAGAIN patch above.
    I would like a little more feedback from snapscan users and some more
    testing by myself before proposing the fixes as patches.

    =======================================================
    Lawrence Glaister VE7IT email: lg@jfm.bc.ca
    1462 Madrona Drive http://jfm.bc.ca
    Nanoose Bay BC Canada
    V9P 9C9
    =======================================================
    ----- Original Message -----
    From: Richard B. Kreckel <kreckel@ginac.de>
    To: <lg@jfm.bc.ca>
    Sent: Thursday, September 28, 2000 4:03 AM
    Subject: Re: FIX: color scanning problems with snapscans in sane 1.0.3

    > Hello,
    >
    > I just wanted to thank you. I have an Agfa SnapScan 1236 S and sane 1.0.3
    > from Debian/woody and was getting images all messed with stripes when
    > scanning color images. I applied the 1/2 liner you proposed:
    >
    > ndata2 = ndata;
    > ndata3 = 0;
    > do
    >

    > /* read data from the TxSource and fill our buffer */
    > status = TxSource_get (pself, ps->cbuf + start + ndata3,
    &ndata2);
    > // bogus if (status != SANE_STATUS_GOOD || ndata2 == 0)
    > <==========line to change
    > if (status != SANE_STATUS_GOOD)
    >

    > /* I believe we should only return here on bad status */
    > DBG (1, "RGBRouter_get OOPS early return %d %d\n",status,ndata2);
    > *plen -= remaining;
    > return status;
    > }
    >
    > Now it seems to work fine. Hope this piece of information could be useful
    > for you. Will this patch be applied to future versions?
    >
    > Regards
    > -richy.
    > --
    > Richard Kreckel
    > <Richard.Kreckel@Uni-Mainz.DE>
    > <http://wwwthep.physik.uni-mainz.de/~kreckel/>
    >
    >
    >

    --
    Source code, list archive, and docs: http://www.mostang.com/sane/
    To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com
    



    This archive was generated by hypermail 2b29 : Thu Sep 28 2000 - 09:45:52 PDT