SANE FAQ

From: Laurent-jan (ljm@xs4all.nl)
Date: Thu Jul 27 2000 - 10:13:43 PDT

  • Next message: Joachim Schiele: "Highscreen - realscan"

    -------- Original Message --------
     Subject: SANE FAQ
        Date: Sun, 16 Jul 2000 16:07:10 +0200
        From: Laurent-jan <ljm@xs4all.nl>
    Reply-To: ljm@xs4all.nl
          To: sane Mailinglist <sane-devel@mostang.com>

    Hi,

    Last month I offered to maintain a FAQ for SANE, if I got enough
    encouragement. The
    replies I got were sufficient to continue this effort.

    I have some problems posting a newer version of the FAQ (still haven't
    found out
    what; might be something stupid..). The latest version can also be
    found at:
    http://www.xs4all.nl/~ljm/SANE-faq.html

    Current version includes the questions in the mailinglist from june
    2000.

    ljm

    --
    (c) ljm @ acm.org. No part of this copyright message may be
    reproduced, read or seen, dead or alive or by any means, including
    but not limited to telepathy  without the benevolence of the author.
    

    Sane Frequently Asked Questions

    Contents

    1. Intro

    1.1. Thanks

    1.2. Legal stuff

    1.3. Meta info: What Where How

    1.4. Completeness: How complete is this faq?

    2. What is Sane

    2.1. What is SANE ?

    2.2. What is a SANE frontend ?

    2.3. What is a SANE backend ?

    2.4. Is my-favorite-scanner supported by SANE ?

    2.5. Is my-favorite-SCSI-scanner supported by SANE ?

    2.6. Is my-favorite-PARALLEL-scanner supported by SANE ?

    2.7. Is my-favorite-USB-scanner supported by SANE ?

    2.8. Why is my-favorite-scanner NOT supported by SANE ?

    2.9. My scanner is "TWAIN Compatible". Why isn't SANE "TWAIN compatible" ?

    2.10. The backend for my-favorite-scanner is available, but for a different type.Can I use a USBPARALLEL / SCSIPARALLEL convertor ?

    2.11. Is there any plan to add SANE support for my-favorite-unsupported-scanner ?

    2.12. How can I help ?

    2.13. How can I access a SANE backend from Windows throught the network ?

    2.14. How can I access a scanner connected to a Windows box from a SANE frontend throught the network ?

    2.15. Mailing-list

    3. Buying a scanner

    4. How do I install

    4.1. Where can I download SANE ?

    4.2. OK, I downloaded all that. What's next?

    4.3. I can't compile SANE on my-favorite-OS. What can I do ?

    4.4. Upgrading problems with GIMP 1.1.23 and xsane

    4.5. compiling sane aborts with error "virtual memory exhausted" on slackware linux with gcc. What goes wrong?

    5. It doesn't work

    5.1. It does not work.

    5.2. I compiled SANE, but my scanner doesn't show in the device list. Do I need extra setup ?

    5.3. Permissions

    5.4. Sane hangs or crashes when I start a frontend for sane, what can I do?

    5.5. Does SANE and the umax backend work on LinuxPPC / big endian machine ?

    5.6. I am using an AM53C974 based scsi card with a umax scanner, the system freezes when I start a scan, what can I do?

    6. Scanner specifics

    6.1. HOW TO do my scanner

    6.2. Microtek problems

    6.3. It gives a line: "model 0x53 not supported" (or other number)

    6.4. UMAX problems

    6.5. I can't get the scanner to work with the SCSI-interface that

    6.6. Will there be a support for the UMAX-parallel-port/UMAX-USB-scanners?

    7. SCSI problems

    7.1. What SCSI-card should I buy?

    7.2. Tekram DC390 card and the scanner hangs after the first scan

    7.3. SCSI kernel/modules blues

    7.4. SCSI bus blues: it works sometimes/almost never/partially

    7.5. I get a black area at the top of the image. What's wrong?

    7.6. My scanner was off during reboot. Do I have to boot again to get my scanner to work?

    8. Paralel port scanners

    8.1. Where can I find more information on paralel port scanners?

    9. A scan, what now?

    1. Intro (up)

    Last month I proposed to provide a more technical FAQ if some encouragement was given. I got sufficient to continue. Therefore: this is the newer version. It is updated with information I got from the mailing list and corrections I got by mail.

    Please keep sending corrections and addittions to ljm@xs4all.nl. If you're responsible of a part of the code and people ask you the same questions over and over again: drop me a line. If you answer a question on the mailing list with the remark that it is a faqish-question, I take the hint

    There are some subjects I am particullary interrested in.

    An analphabetical list, unsorted by priority:

    - Info on transparancy-units, auto-document feeders and slide-units for filmscanners

    - Non-pc hardware hints

    - Logs of getting your scanner to work (especially what went wrong; if you made stupid mistakes mail them directly to me. I won't tell anyone)

    - Saned and scanning over a network

    - Scanningtips (for the last chapter)

    And on a more personal note: anything related to film/dia-scanners.

    1.1. Thanks

    I am not the author of this faq. I see myself more as a collector. As an examaple: I shamelessly copied the original FAQ by Nicolas. Therefore, many thanks go to the people that actually answer the questions, among others:Douglas Gilbert, Nicolas de Peslouan, Oliver Rauch, Bernd Schroeder, Karl Heinz, Henning Meier A complete list of contributers will apear in later versions. If you feel left out, send me a mail.

    1.2. Legal stuff

    Copyright ljm and others. You may copy this, as long as no fee is charged and the names of the contributors and the maintainer are mentioned.

    This FAQ is provided "as-is" without any warranties, expressed or implied. While some effort has been taken to ensure the information in this faq is correct, neither the contributors, authors or collector/maintainer can assume any responsibility for errors, ommisions or damages resulting from the use of any information from this faq.

    1.3. Meta info: What Where How

    The SANE-faq is a digest of problems and questions related to the installation and usage of SANE. It does not provide programming information. Many of the questions appeared in the SANE-mailing list (and where answered), others come from different FAQs.

    The latest (most recent) version can be found at: www.xs4all.nl/~ljm/SANE-faq.html

    This FAQ is created using the vi-editor, bash and awk. A mail-version was produced using html2asc.

    1.4. Completeness: How complete is this faq?

    Not. These are a Few Answered Questions, not all Frequently Answered Questions.

    2. What is Sane (up)

    2.1. What is SANE ?

    SANE stand for Scanner Access Now Easy. SANE is an API (Application Programming Interface) designed to provide access to scanners and other image retrieval hardware. See http://www.mostang.com/sane/intro.html for more details.

    2.2. What is a SANE frontend ?

    A SANE frontend is an application program that uses one or more SANE backends to access a scanner or camera. See http://www.mostang.com/sane/sane-frontends.html for a list of currently available frontends.

    2.3. What is a SANE backend ?

    A SANE backend is a driver that handles requests coming from a frontend and translates them to low level requests before sending them to a scanner. The backend is also responsible for retrieving the scanned image from the scanner, and converting it to the correct format so that the frontend can handle it. Some backends support more than one scanner. To have your favorite scanner supported, you need to have a backend for this scanner. See http://www.mostang.com/sane/sane-backends.html for a list of backends (and supported scanners).

    2.4. Is my-favorite-scanner supported by SANE ?

    First of all, see http://www.mostang.com/sane/sane-backends.html for a list of supported scanners. Note that some scanners are supported by a different backend than the one expected. (Manufacturer is not always the same as seller). If your scanner is not in this list but comes from a manufacturer that build already supported scanners of the same type (SCSI, PARALLEL, USB, ...), try it anyway. If you have some success with this, please report it to sane-devel@mostang.com ! (Read the man for the specific backend for help on how to enable extra debug output). Your scanner may be partially supported. (Only black/white, only 300 dpi, only 24 bits, ...).

    Warning : Testing a backend with an unsupported scanner *may* cause physical damages to the scanner. Read the documentation for more info, and if you want to try, keep one hand on the on/off switch :).

    2.5. Is my-favorite-SCSI-scanner supported by SANE ?

    Supporting SCSI scanners seems to be easier than other scanner types. This is due to the fact that SCSI scanners share a common set of commands (part of the SCSI II standard). Unfortunately, the way scanners support this common set of commands is far from universal. Also, each manufacturer has its own extension to this command set, even when there is already some commands in the standard to do the work... This is why your scanner may be partially supported. In order to support a given SCSI scanner, one needs to get SOME specs (extension to the SCSI II standard) from the manufacturer.

    2.6. Is my-favorite-PARALLEL-scanner supported by SANE ?

    Supporting PARALLEL scanners is (really) harder than supporting SCSI scanners. First of all, you need to understand that each manufacturer (and sometime even each scanner) have their own command set. There is no such thing as a common set of commands as in SCSI. In order to support a given PARALLEL scanner, one need to obtain the FULL specification from the manufacturer. This is, in fact, the real obstacle to a more complete parallel scanner support, because many manufacturers won't give specs for their scanners.

    A good few parallel scanners work under Sane. These include a raft of HP and Epson models. Some other parallel scanners are also supported. For further details please see http://www.buzzard.org.uk/jonathan/scanners.html

    2.7. Is my-favorite-USB-scanner supported by SANE ?

    Supporting USB scanners is currently the hardest part of the job. The first thing to understand is that USB in general (not limited to scanners) is not supported on all operating system. Support for USB scanners in the future will depend on the general USB support by the operating system. Also, it will depend - as for SCSI or PARALLEL scanners - on the manufacturers willing to give the specs on request.

    USB support for HP scanners under linux is reported as going rather well using the HP backend without any programming modifications. Granted the kernel development is still ongoing but is useable. Although not all HP scanners are supported, the higer end models are (4100, 5200, 6200, 6300). (David Nelson). You can find more info. at http://www.jump.net/~dnelson/linux/usb.

    All EPSON USB scanners are supported. The problems people are reporting turn usually out to be related to the USB stack. There was e.g. a bug in the USB code that only showed up with EPSON scanners. You need at least the USB code from kernel version 2.99-pre8 - or the associated backport.

    For other scanners: see http://www.buzzard.org.uk/jonathan/scanners-usb.html

    2.8. Why is my-favorite-scanner NOT supported by SANE ?

    Probably because the manufacturer is NOT willing to give the programming specifications for this scanner. Some manufacturers are really thinking that their dirty and CPU greedy protocols have to stay secret... may be to avoid other starting laughing at their work! (not my words, just quoting..)

    Other reasons may include: Nobody else has this scanner. Nobody wants to write a driver until now.

    2.9. My scanner is "TWAIN Compatible". Why isn't SANE "TWAIN compatible" ?

    This doesn't mean anything ! A scanner is NOT TWAIN compatible. The Windows driver provided with the scanner is probably TWAIN compatible, so that TWAIN compatible Windows applications can use them. The only way to have a scanner become TWAIN compatible under other OS would be to have a driver for this scanner that speaks TWAIN with the applications. But, there is no TWAIN compatible application outside the Windows and Mac world. SANE developers have chosen to use the SANE API instead of TWAIN for scanner access. See http://www.mostang.com/sane/intro.html for a word about this. You can read a TWAIN FAQ, if you want, at http://www.MentorComputer.com/TWAIN/faq.html.

    There is a discussion between the TWAIN Woring Group and some SANE-people. For more information, see: http://www.twain.org/docs/twain_20_unix.htm

    2.10. The backend for my-favorite-scanner is available, but for a different type.Can I use a USBPARALLEL / SCSIPARALLEL convertor ?

    Nobody has reported any success with this. Even if the hardware look the same, the protocol used to exchange data between your computer and the scanner DOES look different.

    2.11. Is there any plan to add SANE support for my-favorite-unsupported-scanner ?

    Depending on the available documentation, there might be someone already working on a given scanner. Watch the sane-devel mailing list. There is some sort of "black list" of manufacturers who don't want to give away the specs. Supporting these manufacturers' scanners is far from easy, because one has to reverse engineering the Windows driver or listen on the PARALLEL/SCSI/USB cable... [There is some plan to add this black list to this FAQ.]

    2.12. How can I help ?

    In several ways :

    - You can start bothering the manufacturers for the specs. One more letter is NEVER a loose of time ! [Someone is currently writing a template letter to request the specs. It will be included here when available.]

    - You can start writing a backend. To avoid duplicate job, ask on the sane-devel mailing list before.

    - You can test and report any success / troubles with the backends / frontends.

    2.13. How can I access a SANE backend from Windows throught the network ?

    This is a work in progress. A Windows TWAIN to SANE translator exists. From the sane developing mailing list, here is an announce from Arun Tanksali:

    A simple but functional interface (WinSANE) is available for download.

    I have tested with a Mustek 1200 scanner. Tested with Win 95/98 PCs.

    Seems to work OK.

    Download site: http://www.integramicro.com/winsane

    Also, you can use sanecgi which wraps the text based frontend (scanimage) into a cgi perl script. For a running demo, try http://sps.spa.umn.edu/~hansf/sanecgi/scanner.html.

    2.14. How can I access a scanner connected to a Windows box from a SANE frontend throught the network ?

    TWAIN is not designed to allow such intelligent behavior

    2.15. Mailing-list

    There is a sanedeveloppers mailinglist. The sane-people are very nice and will help with almost anything. Keep in mind though, that they're not paid to do this. Subscribe to sane-devel by writing to majordomo@mostang.com.

    3. Buying a scanner (up)

    Many advices have been given on which scanner to buy. There seem to be some general criteria:

    - Do you just want to scan or do you want to work on the backends as well. If you just want to scan: take a SCSI-scanner that is supported. I recomend Epson, UMAX or HP, because they have made programmingspecs available. If you want to use USB-scanners, Epson is probably your best choice. If you want to work on the backend, take a scanner with sufficient documentation

    - What do you want to scan: just images or transparancies, film etc?

    - What are your requirements for the images: just 'nice pictures' or photoquality? For photoquality you'll need at least 1200 dpi if you want to do more than just copy.Ofcourse you'll also need a printer to match that quality.

    4. How do I install (up)

    4.1. Where can I download SANE ?

    Depending on you computer knowledge, you'd better download the sources for SANE or a prebuilt binary. Up-to-date SANE sources and (more or less) up-to-date binaries for several platform are available at http://www.mostang.com/sane/source.html. Please, try to use a mirror site near you instead of ftp.mostang.com

    Do not forget to download the backend for your favorite scanner. Backend-programmers often have a newer release than the backend included in the sane-distribution.

    4.2. OK, I downloaded all that. What's next?

    Untar the stuff:

    tar -xvzf sane-1.0.2.tgz

    If you have a separate backend: untar it also (often the same way)

    Go to the sane directory (cd sane-1.0.2) and type ``./configure''. When it finnishes, cd to the backend directory and read the README-files. They should tell you what todo.

    Go back to the sane-dir. and type ``make''. Enjoy the compile (especially all the warnings ;-).

    Su to root (you weren't compiling all the stuff as root I hope? If you were: read some books about security). Type ``make install''.

    Go to the tools-directory and run ./find-scanner -v

    4.3. I can't compile SANE on my-favorite-OS. What can I do ?

    First of all, have you checked that SANE is available for your platform in the supported platforms list ? (SANE is NOT currently available for Windows platforms). You'd better try the latest available version.

    You may need to download and/or build some external programs or libraries to compile some parts of SANE. Have a look at the README and README.os files in the SANE distribution for more. You'd better use the latest versions of those external programs/libraries, unless the README file request a particular version.

    On some platforms, you may need to use a particular version of make or of the C compiler.

    When you succeed in compiling sane on a currently unmentioned OS, please send a note to the mailinglist.

    4.4. Upgrading problems with GIMP 1.1.23 and xsane

    The way to upgrade GIMP is as follows:

    - remove all glib libs

    - remove all gtk libs and subdirs

    - remove all gimp libs and subdirs

    - remove ~/.gimp* subdirs

    - unpack glib-1.2.8, configure, compile and install it, then call ldconfig

    - unpack gtk+-1.2.8, configure, compile and install it, then call ldconfig

    - unpack gimp-1.1.23, configure, compile and install it, then call ldconfig

    - enter xsane-0.59 directory:

    - make distclean

    - configure, compile and install it.

    - ln -s /path/to/xsane ~/.gimp-1.1/plug-ins

    4.5. compiling sane aborts with error "virtual memory exhausted" on slackware linux with gcc. What goes wrong?

    The optimization set by "-O2" makes problems, try which one of the following calls work:

    make CFLAGS="-g -Wall -O1"

    make CFLAGS="-g -Wall -O"

    make CFLAGS="-g -Wall"

    This is a compiler-problem.

    5. It doesn't work (up)

    5.1. It does not work.

    OK. Don't panick.

    - First thing to do is get the latest version of sane and the backend. Sane develops relatively fast, and it might be that your problem is already fixed.

    - Check the boot-messages (/var/adm/messages); there should be some lines indicating your scanner (something like: Vendor: AGFA Model: SnapScan Rev: 1.40, Type: Scanner ANSI SCSI revision: 02). If not: go to the SCSI-section in this FAQ

    - cat /proc/scsi/scsi. Your scanner must be there. If not: goto the SCSI-section.

    - Run a ``find-scanner''

    - ls -l /dev/sga /dev/sg0 /dev/scanner

    - sgcheck

    - scanimage -Lcd

    5.2. I compiled SANE, but my scanner doesn't show in the device list. Do I need extra setup ?

    Depending on your platform/scanner, you will need time for a coffee, a pizza or an extra month of holiday :

    - We already told that, but ensure your scanner is in the supported scanner list. If your scanner is SCSI:

    - Check that the SCSI card is supported by your OS. You may need to rebuild your kernel to add generic SCSI support.

    - Your SCSI card often display SCSI device on startup. If not, check cables and terminators.

    - Some operating system display available SCSI device on startup. Again, if not, check cables and terminators.

    - Check if your SCSI-module is correctly loaded (lsmod).

    - Read more documentations (SANE, backend for your scanner, frontend, SCSI card, scanner, ...).

    - Ask in the sane-devel mailing list.

    5.3. Permissions

    Anyone scanning must have read and write permissions on the scanner-device. For the EPSON ( and probably all parralel port) scanners you not only need read/write access to the device, you also have to be root (or your appliation needs to be setuid root). The reason for this is that the backend must control the actual parallel port via I/O ports.

    5.4. Sane hangs or crashes when I start a frontend for sane, what can I do?

    Sometimes the backends that are not used make problems. Edit /usr/(local)/etc/sane.d/dll.conf and comment out everything but the backend(s) you need.

    5.5. Does SANE and the umax backend work on LinuxPPC / big endian machine ?

    There are people using the sane-umax on a LinuxPPC (big endian) machine. Other people write that they can not scan on a LinuxPPC. It looks like this is a problem with the driver of the scsi card. The "MESH" SCSI card is reported to work. The NCR53C94 SCSI card seems not to work.

    5.6. I am using an AM53C974 based scsi card with a umax scanner, the system freezes when I start a scan, what can I do?

    Try the recent driver for the scsi card, take a look at:

    http://www.garloff.de/kurt/linux/dc390/index.html

    6. Scanner specifics (up)

    6.1. HOW TO do my scanner

    Many scanners have small howto's Always try them:

    Agfa snap-scan: http://www4.tpg.com.au/users/rita_tim/snapscan-ava1505-howto.txt

    6.2. Microtek problems

    6.3. It gives a line: "model 0x53 not supported" (or other number)

    Try the latest version. If that doesn't work: set 'option dump 2' in the microtek2.conf file and post the contents of the inquiry block to the mailing-list (indicated by [inquiryresult] ). This will help to determine which backend should handle this model.

    6.4. UMAX problems

    6.5. I can't get the scanner to work with the SCSI-interface that comes by default with this scanner

    Don't use that card. Get a good SCSI-card for scanning.If you want to buy a new one, Oliver suggested a symbios logic 53c8xx.

    If you really want to try: the UDS-IS11 is a DTC3181E-card based on the NCR5380-chip. On linux you may have the chance to get it work with the recent g_NCR5380-driver. The card does not have IRQ/DMA.

    Try the following option for kernel:

    dtc_3181e=0x280,255

    or use the following command:

    insmod g_NCR5380 ncr_irq=255 ncr_addr=0x280 dtc_3181e=1

    6.6. Will there be a support for the UMAX-parallel-port/UMAX-USB-scanners?

    UMAX published their SCSI-protocol for scanners. However they have not so far published parallel port and USB protocols. Without the protocol documentation development will not be done.

    Martin Mevald has worked on a parallel-port-driver but stopped the development.

    The Astra 2200W does work when connected via SCSI. It could work with SCSI-via-USB-driver and connected via USB, but that is not tested.

    7. SCSI problems (up)

    First read man sane_scsi!!! This gives the answer to many questions you might have

    7.1. What SCSI-card should I buy?

    Almost any normal SCSI-card will do. Check the Linux Hardware HOWTO if you're running Linux. Stick to your vendor if you're running a commercial OS.

    7.2. Tekram DC390 card and the scanner hangs after the first scan

    Version 1.11 of the Tekram driver seems to work fine mostly, except that the scan does not terminate properly (it causes a SCSI timeout after 10 minutes). The generic AM53C974 also seems to work fine and does not suffer from the timeout problems.

    Therefore, do not use 'insmod tmscsim.o' but instead 'insmod AM53C974.o'.

    7.3. SCSI kernel/modules blues

    Your kernel needs to recognise SCSI, ether in the kernel or as modules. My (ljm) personal preference is to compile SCSI in the kernel, but I have a full SCSI-system. If you're using modules, you'll need to add the following lines in one of the boot-files:

    insmod the_driver_for_my_card

    insmod sg

    7.4. SCSI bus blues: it works sometimes/almost never/partially

    Check the following:

    - is the scsi bus terminated correct on both ends of the bus,

    - how long is the scsi bus (all scsi cables on both sides of the card together)? (max 1.5 meter)

    - is the driver for your scsi controller up to date?

    - Is disconnect/reconnect disabled (this is a setup for your SCSI-card).

    7.5. I get a black area at the top of the image. What's wrong?

    This is a problem with some scsi-drivers. For advansys-scsi-cards update to a new kernel which includes at least the driver version 3.1E of the advansys-driver. Take a look at http://www.advansys.com/linux.htm.

    7.6. My scanner was off during reboot. Do I have to boot again to get my scanner to work?

    Fortunately, Linux provides a simple mechanism to probe a SCSI device on demand. Suppose you have a scanner connected to SCSI bus 2 and the scanner has a SCSI id of 5. When the system is up and running and the scanner is turned on, you can issue the command:

    echo "scsi add-single-device 2 0 5 0" > /proc/scsi/scsi

    and the kernel will probe and recognize your scanner (this needs to be done as root).

    8. Paralel port scanners (up)

    8.1. Where can I find more information on paralel port scanners?

    Try the backend for your specific scanner.

    Some scanners do SCSI over the parallel port. See http://www.torque.net/parport/ppscsi.html and http://www.buzzard.org.uk/jonathan/scanners.html

    9. A scan, what now? (up)

    Congratulations. Print it, put it on you web-site, amaze your friends.

    On the other hand, it would be nice to remove those pimples and blackheads. You should get GIMP.

    --
    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 Jul 27 2000 - 10:06:44 PDT