1.0.3 snapscan interface

From: Lawrence Glaister (lg@jfm.bc.ca)
Date: Sun Sep 24 2000 - 18:02:08 PDT

  • Next message: Dave Hill: "find-scanner (Was: Re: scanmagic 4800p doesnt work)"

    Thanks for the pointer Steve,
    I have been digging further and you are right, TxSource is returning 0 bytes
    on a regular basis. It turns out that the read in FDSource_get() is hitting
    the EAGAIN break which leaves the status at SANE_STATUS_GOOD. I wonder why
    the usb interface is returning a read status of "Resource temporarily
    unavailable". Would it make more sense to put a small sleep and a continue
    in place of the break? This would make the code wait for the data or a
    timeout at a lower level.
    -sometime later that evening...
    I just tried a usleep(2000) and a continue added into the EAGAIN condition
    in FDSource_get() instead of the break, and restored the code in
    RGBRouter_get(). This does seem to work. I noticed that the scanner does
    "backtrack" occasionally on large scans and this coincides perfectly with
    hitting the EAGAIN condition. It looks like the scanner is responding to usb
    read requests with a "try again later" and these are getting passed back up
    the chain... it is possible that other versions of usb kernel code will
    block on a read() until data is ready instead of returning with EAGAIN. I
    don't know what the scsi driver does, but if the reads dont return until
    data is available or an error occurs, this would explain the problems I have
    been seeing. I looked at the umax scsi code (I also have a umax 12120s scsi
    scanner) and it looks like it has all been written such that an EAGAIN
    condition with 0 bytes would cause problems. Where would you suggest a fix?
    hanging in the low level USB read? Hanging in FDSource_get? Hanging in
    TXsource_get? Handling the 0 bytes being returned without an error status in
    RGBRouter_get()? The EAGAIN condition occurs with my system even when
    scanning b/w images, but I was not seeing errors because there always was
    some data returned and not 0 bytes. The FSSource_get() seems to be the
    lowest level point in common code for scsi and usb scanners and the usb code
    patches are the lowest level user code for usb specific snapscan scanners.
    =======================================================
    Lawrence Glaister VE7IT email: lg@jfm.bc.ca
    1462 Madrona Drive http://jfm.bc.ca
    Nanoose Bay BC Canada
    V9P 9C9
    =======================================================

    --
    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 : Sun Sep 24 2000 - 17:56:25 PDT