[sane-devel] Avision backend problems (was: gamma table value)

Henning Meier-Geinitz henning@meier-geinitz.de
Wed, 14 May 2003 23:29:49 +0200


Hi,

Hey, I just want to help and know what should be fixed in SANE. No
oofense intended :-) Keep in mind that I (and quite a lot of others on
this list) are not native English speakers so the meaning of my words
may be a bit different from what I write.

On Wed, May 14, 2003 at 08:58:16PM +0100, F J Brooks wrote:
> I must ask you to forgive me if I point out that taking me to task for
> getting where I am, and grilling me as to WHY I'm here, is all very well,
> but the plain fact is that I am where I am - and I'm asking for help in
> arriving at a solution. Before I start, it might be useful if I explain my
> position: I am a simple, humble computer USER. I am not a geek or a techie,
> and I have no wish to become a programmer.

Ok, no problem with that. So you buy a computer together with the
operating system and all the software. If you really want to change
something you can ask someone who get payed for installing software.
You wouldn't "upgrade" your car's brakes or even the motor without
exactly knowing what you do?

You are expecting too much. You can't compile your own software
without basic knowledge. That's just not possible.

> I use my PC as a TOOL - not as an occupation, a way of life, or a
> source of entertainment. I have been a W*****s user for something
> over five years and am fed-up with its unreliability, vagaries and
> unpredictability - hence my interest in Linux.

Linux is not a simple replacement of Windows. I've seen quite some
people changing operating systems and they cam back to Windows becasu
they expected Linux to be like Windows.

> I must say that my experiences over the past two months or so have not
> filled me with confidence, as I've found that  SuSE Linux (I don't know
> about other distributions) is about as USER-unfriendly as one
> could get. After installing, I spent three weeks trying (in the end
> successfully) to get onto the net and send email. After that debilitating
> experience, I remarked to someone that I felt like I'd bought a new BMW and

Hey! The car comparison was mine :-)

> then had to strip down the engine and remove and replace a piston before I
> could drive it for the first time. Now, after about two weeks of struggling
> to get my scanner to work, to carry this analogy further, I feel
> like I've also had to replace the back-axle (because it was the wrong type),
> dismantle the gearbox and re-grind two of the gear-wheels to get them to
> mesh properly, and replace the chip in the engine management system!

The question is: Why are you doing this? Probable answer: The driver
that comes with your SuSE version is too old. Well, get a new one.
Don't try to change the whole system, just get a new driver
(sane-backends in this case).

> On Tue, 13 May 2003, Henning Meier-Geinitz <henning@meier-geinitz.de> wrote:
> > Where did you get the impression that glib/gtk must be removed? That
> > documentation should be fixed.
> 
> When I started this scanner venture - which was something I had never
> tackled before and had no knowledge of whatsoever - I gathered together as
> much information as I could find on the subject. That included:

That's not a wrong approach in general. What I do if I want to install
something I don't know is to read the documentation that comes with
that something first. If that doesn't work, I try to find more (or ask
someone who should know). At least the basic steps should be explained
in every package.

> 'Scanning with Linux' by Richard Drummond (Linux Format, December 2002).
> 'Scanning with SANE and Other Tools' by Michael J Hammel (Linux Journal,
> April 2003).
> 'YoLinux Tutorial: Scanners and Linux' by Greg Ippolito
> (http://yolinux.com).
> 'SANE: Linux scanner how-to. For beginners' by Steve Sheriff, 21 April 2001

I don't know those.

> (http://www.xs4all.nl/~ljm/SANE/howto.html)

Oh well, I know that one. I don't say it's wrong but I think I've
criticised it before because of the gtk/glib stuff. It's written for
people with either very old systems or someone who really likes to
remove these libraries from the system I don't recommend that
instructions for beginners.

None of these texts are from the SANE project. They may help in
specific situations but generally the instructions in our package
should be enough.

> The problem with most of this material (like, in my experience, MOST
> computer articles, guides, HOWTOs and so-called 'Help' files), is that they
> are written by geeks for geeks,

Geeks don't need guides. Well, most of the time :-)

> and assume that you know how to do things before you start. This
> leaves a humble, novice, never-been-there-before USER, not only cold,
> but out in the cold.

The never-been-there-before user should not compile software if he
doesn't want to learn how to do that. It's like cars and brakes or the
motor...

I don't say you shouldn't mess with the motor but in this case you'll
need to read quite a lot before beeing able to mount it. And the motor
won't come with a manual explaining how to use a screw driver.

> Quite often, I'm not able to get beyond the first paragraph before my
> eyes glaze over and I throw the offending paper down in disgust with
> an expletive or two, exclaiming (as our American friends say: 'Excuse
> me!? Come again!?').

When that happens to me in University, I usually know that I've to
look up some basic stuff in a good book. E.g. my pressure sensor can
be used up to 150 °C. At higher tempeartures it has to be cooled (says
the manual). It doesn't explain how to coll, that's in one of these
nice big books. Did I mention that I'm a chemical engineer? :-)

Last time I have seen a SuSE package it came with three or four books.
Really massive books. Ther was even a chapter on the backgound of SANE
and I remeber that I couldn't find any error in that writing. I'm
pretty sure that there is also a chapter on how to compile your own
software.

> In going through the documents I started with, I reluctantly came to the
> conclusion that the only one which was suitable for my level of
> understanding was the Sheriff (even tho it was somewhat dated), because he
> obviously understood my predicament precisely, and wrote accordingly - with
> every command clearly set out.

That's the problem. You must understand what you are doing. At least
basically. It's not nice to have a howto that is just a list of
commands to enter. If a little detail is different on your system you
can't procede. You may not even know that something is wrong.

> The rest were, to a varying degree, uneven and inconsistent -
> sometimes spelling out commands, sometimes not, sometimes leaving me
> completely in the air with statements like, '...unpacking the tarball
> and performing the usual configure/make incantation.' (Drummond).

Unpackung and building a source package should be explained in your
Operating system's manuals.

> [Excuse me!? Come again!?], and: 'For most scanners you can make educated
> guesses from the SANE web site supported-hardware list.' (Hammel). [Excuse
> me!? Come again!? - I'm not educated!]; or telling me what I need to do but
> not HOW TO DO IT, with vague, super-assumptive statements like: 'Once
> configured (should be quite easy - or happen automatically on modern Linux
> distributions' (Rebe) [Excuse me!? Come again!?]

He is right. If it doesn't work, read the docu. 

> I hesitate to ask this eminence: 'Have you ever tried to get an HP Scanjet
> 5300C working on SuSE 8.1?']

Not me, using Debian here :-)

> So I went with Sheriff. He starts by telling me to remove glib, gtk+, sane
> and xsane - 'in order to install new and up-to-the-minute libraries to make
> SURE that all compiles.' This I do, using YaST2. Then he gets me to copy
> ($cp -a /usr/src/linux/include/scsi /usr/include).
> This is not a good start
> for me as I get the response: 'No such file or directory.'

That was good luck. His advice is dangerous at least. If you don't
know what that means, don't do it. You are just manipulating the
brakes of your car.

> However, I press
> on and, as instructed, create a new directory (/home/<username>/scanner),
> into which I download and install glib-2.2.1.tar.gz, gtk+-2.2.1.tar.gz,
> sane-backends-1.0.11, and xsane-0.90, as described in my original message.

I don't even know if gtk-2.2 works with xscanimage. 2.0 should work, I
haven't tested 2.2 yet.

> Next day, I added sane-frontend-1.0.11.

Before you download all that you should try to find out what that
software is (e.g. on the SANE homeapge). You may not even need
sane-frontends (if you want to use xsane instead).

> > I guess it would have been even easier to just use a SuSE binary RPM,
> > e.g. this inofficial one from
> > http://packman.links2linux.de/index.php4?action=211 (not tested by me).
> 
> Excuse me, Henning!? Come again!? I'm sorry, but you've lost me already:
> I've no idea what a 'SuSE binary RPM' is!

RPM is the format that SuSE (and other distributions) use to provide
their packages. A binary RPM contains the software ready to install, a
source RPM has the source code that must be compiled first.

I hope that's also explained somewhere in the SuSE maunals.

> > That usually means that you are not in the directory of the package,
> > forgot to run configure or configure hasn't finished because of errors.
> > If this happened in sane-backends, sane-frontends, or xsane, please
> > tell us the exact error message and what you did before.
> 
> No, I didn't 'forget to run configure'! Unfortunately, I didn't keep my log
> of my sane-backends 'transactions' (unlike me!). However, I can say, with
> some certainty, that there could not have been
> anything wrong, otherwise I would have remembered and done something about
> it. I do recall that it told me that if I had any problems to read
> 'PROBLEMS' - which I did - and there was nothing alarming there.

If make comapils about "no targets selected" that means there is no
Makefile. The Makefile is generated by configure. So either configure
didn't finish or you have been in a wrong directory. I don't think
there are any other possibilities.

> The situation with glib-2.2.1 and gtk+-2.2.1 was different, and I had
> error messages on both at the end of the 'configure' routine. On
> glib, it said: 'checking for pkg-config...no onfigure: error:***
> pkg-config not found. See
> http://www.freedesktop.org/software/pkgconfig

Ok, so it was glib that complained, not sane. Well, you don't need it
anyway.

> So I went to that site, downloaded and installed pkgconfig-0.15.0. Then
> configured gtk+ again and got:
> 'Perhaps you should add the directory containing glib-2.0.pc'. So I
> configured, 'make' and 'make install' both glib and gtk+ again, and both
> looked OK.

No idea about those details. I have never build glib myself. Well, at
least not on Linux :-)

> Then I downloaded and configured xsane-0.90. At the end of configure, it
> said:
> **************************************************************************
> 'ERROR: GTK-1.2.0 or newer is needed for compiling xsane
> if you installed gtk as rpm make sure you also included gtk-devel'
> **************************************************************************

I'm not sure why xsane complains. Either it hasn't found your library
for some reason or the library is too new. If you just had used that
one that came with your distribution, that would have worked (I guess).

> It added: 'you may need to remove /dev/null before you can run configure
> again.'

That's a real bug in the configure script.

> As (a) I didn't understand this, and (b) it said 'may', I ignored this (my
> subsequent configure of xsane showed this to be the correct decision).

The wording is not perfect, you are right. You can run configure as
many times as you like without removing "config.cache" (that's what
should be printed instead of /dev/null). I just may not work.

> > > etc, and to download and install 'pkgconfig-0.15.0', and install
> >>'gtk-devel' (latter using YaST2)
> 
> > pkgconfig isn't needed by any SANE package as far as I know. If you
> > compile gtk from source code, you don't need to install "gtk-devel",
> > because the headers are included in the source package. In fact, when
> > you installed gtk-devel you also installed gtk (if you had removed it
> > at all). So compiling gtk didn't make much sense ...
> 
> That's why I installed pkgconfigure and glib-devel - because I was TOLD to!

There is a phrase in German that goes like this "And if someone tells
you to jump from the top of the bridge into the water you do it?".

You can't trust every description on the web. It may be wrong. Or
misleading at least.

> > > I've downloaded/read reams and reams of paper with titles like
> 'INSTALL',
> >
> > For installing sane-backends, INSTALL should be enough.
> 
> You say that, but you weren't there to tell me that the information on the
> sane-backends, which told me to read README, INSTALL and PROBLEMS, was
> WRONG!. I also read the 'Beginners Information' and all the other
> documentation I listed in my original message.

I'm on this list and on the #sane IRC channel for answering questions
most of the time :-)

> > The documentation is in the man pages. If something is missing, it
> > should be added. Please tell us what didn't work and what's missing.
> 
> I do not know how to answer this. You must understand that, as a very naive,
> non-expert, I can only rely on the information I am given, and do what I am
> told to do. I do not recall being told to read 'man pages' - but I WAS told
> to read README,  INSTALL and PROBLEMS.

That's enough for installation. You can't read the man pages until the
installation succeeds. The README tells you after installing
sane-backends:
"For information on configuring and trouble-shooting the various SANE
components, please refer to the manual page sane(7)."
 
> > The problem is: You just can't make a "good, simple, clear
> > documentation that supposes no previous knowledge". That would be a
> > big book if it should tell details for every supported scanner.
> 
> Then that's a major shortcoming of Linux!

That has nothing to do with Linux at all. It has to do with complex
problems and a huge variety of different scanners. 

> > A short, simple instruction is: Install sane-backends, run scanimage
> > -L. If it doesn't work, read man sane, man sane-backendname.
> 
>  But I did install sane-backends and ran scanimage -L and
> sane-find-scanner - with the results detailed below - which, you say: 'Looks
> fine',  So I had no reason to think that there is anything wrong with
> sane-backends - if there is(?).

Well ok, the docu should go on with: try scanning with "scanimage
>image.pnm". If it doesn't work, do this and that...

> > But that means that you must know what a shell is, how to start
> > programs from the shell, how to read man pages. So it doesn't work
> > without previous knowledge.
> 
> I do not understand this point at all.

What I mean is that every single documentation in the world need
previous knowledge. 

> > Did you try to actually scan with scanimage? What happened?
> 
> No, not being 'command-line-literate', being naturally lazy, and having been
> brought up (if that's the right expression) on W*****s, I prefer to click an
> icon.

If it works, it's ok that way. But you don't have much ways to debug
problems that way.

> On my SuSE desktop - both 'root' and 'user' versions, which are slightly
> different - there are a number of icons, such as Trash, /Windows/C,
> /Windows/D,
> OpenOffice, CD-R, CD-ROM, etc, etc, including one marked: 'Scanner'.
> This is the icon I clicked.

Yeah, I know. That is some icon that was placed there by KDE or SuSE.
What I mean is that it may not work if you install an application
manually.

> >When you removed sane-backends from your distribution, you most  probably
> >also removed xscanimage (or it was never installed).
> 
> The reason I downloaded/installed sane-frontend was that I understood that
> it included xscanimage which, presumably, was removed when I removed
> sane-frontend.

That's correct.

> > > So, yesterday, I downloaded and installed 'sane-frontend-1.0.11'
> > > (./configure, make, and make install).
> 
> > Ok. I like xsane more, but your mileage may vary.
> 
> As I stated in my original message, I have also downloaded/installed xsane
> as it seems to be generally recommended., but haven't yet tried to use it
> (none of the articles I have cited tells me how!)

Well, you enter the name of the program into a shell like any other
program. jsut enter "xsane". But I don't think that will help in your
case. If xscanimage doesn't work, xsane probably won't work either.

> > > 'Error: Failed to set value at option gamma-table'.
> 
> > Maybe the maintainer of the avision backend can answer this part.
> >
> > The error message looks a bit strange, was this really the exact
> > wording? Anyway, it probably means that the frontend (xscanimage)
> > tried to set an option of the backend (avision) and failed. Maybe a
> > backend problem but I don't remember anyone mentioning it until now.
> 
> Sorry, Henning, the error message I quoted was not quite complete. It
> actually included two more words (no doubt, absolutely vital!) and said:
> 'Error: Failed to set value at option gamma-table. Device busy.'

That is rather strange. But that's really stuff for the backend
maintainer. I'll change the subject so maybe he notices.

> > scanimage --version
> 
> Response: 'scanimage (sane-backends) 1.0.11; backend version 1.0.11'

Ok.

> > Now try to scan:
> >
> > scanimage >image.pnm
> 
> Response: scanner whirred for a short time. Otherwise, no response on
> screen.

Ok, so you jsut found out that it's not a problem of the frontend
(xscanimage and scanimage) but of the backend (avision).

> > If that doesn't work, show us the output of:
> >
> > SANE_DEBUG_AVISION=255 scanimage >image.pnm
> 
> Response: None at all.

Maybe the scanner is still confused from your first test? Enabling
debugging doesn't cahange behaviour, it should only print more messages.

Bye,
  Henning