[sane-devel] gamma table value

F J Brooks F J Brooks" <fred@redgrave.screaming.net
Wed, 14 May 2003 20:58:16 +0100


Thanks, Henning.

Gosh! I feel like a naughty schoolboy summoned to the headmaster's study!
However, if it helps you to help me for this 75-year-old to play the
recalcitrant scholar, then so be it!

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. 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.
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
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!

On Tue, 13 May 2003, Henning Meier-Geinitz <henning@meier-geinitz.de> wrote:

> It's not necessary to delete glib and gtk. In fact, if you do that,
> you'll remove all gtk applications from your system and that's
> probably not what you want. Removing sane-backends (and maybe xsane as
> a dependency) is enough.
>
> 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:

'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
(http://www.xs4all.nl/~ljm/SANE/howto.html)

I later acquired various other documentation (I now have a room-full of
paper!), including 'The SANE Avision backend' by Rene Rebe, 27 March 2003
(http://drocklinux.dyndns.org/rene/avision), and a pile of SANE FAQs,
READMEs, INSTALL guides, etc, etc.

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, 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. 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!?').

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. 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).
[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!?]
I hesitate to ask this eminence: 'Have you ever tried to get an HP Scanjet
5300C working on SuSE 8.1?']

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.' 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.

Next day, I added sane-frontend-1.0.11.

> 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!
>
> > I then opened new directory /home/<username>/scanner, went to
ftp.mostang.com and downloaded > >into it sane-backends-1.0.11, xsane-0.90,
glib-2.2.1 and gtk+-2.2.1 (all .tar.gz). I then, in turn,
> > unzipped them and gave them the './configure, make, and make install'
treatment
> >(all in he /home/<username>/scanner directory). In the process I had to
overcome some problems with > >'Error: make:*** No targets specified...'
etc, and 'Error: make install:*** No rule to make target...'

> 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. 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

On gtk+, there was a similar error message re pkg-config [sic].

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.

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'
**************************************************************************

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

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).

> > 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!

> > 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.

> 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.

> 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!

> 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(?).

> 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.

> > On Sunday, the response to my command $sane-find-scanner was:
> > 'found SCSI scanner "HP Scanjet 5300C 6.00" at /dev/scanner
> > found SCSI scanner "HP Scanjet 5300C 6.00" at /dev/sg2'
>
> Looks fine.
>
> > The response to $scanimage -L was:
> > 'device 'avision:/dev/scanner' is a Hewlett-Packard Scanjet 5300C
> >flatbed scanner
> > device 'avision:/dev/sg2' is a Hewlett-Packard Scanjet 5300C flatbed
> > scanner'
>
> Looks fine, also.
>
> 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.

> > This all looked promising (altho I'm a bit worried as to why there
>>should be two items in each case, and wonder if I should delete one!),
>
> If you do a "ls -l /dev/scanner" you'll see that /dev/scanner is just
> a link to /dev/sg2. You can remove that link but that's not necessary.
>
> > but, when I try
> > to launch scanner [as 'root'] by clicking desktop 'Scanner' icon, I get:
> > 'KDElnit could not launch "xscanimage": Could not find "xscanimage"
> > executable'.
>
> Neither sane-frontends nor sane-backends contains a "desktop Scanner
>icon".

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.

>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.

> > 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!)

> > Then, when I clicked the 'Scanner' icon on the desktop, I got a small
> >window offering two alternatives:
> > 'avision/scanner' and 'avision/sg2'. I tried them both in turn, with the
> > same result in each case:
> > On 'Acquire Preview', the scanner grunts and whirrs a bit, then I just
> >get a black bar across the top of the 'Preview' window. When I click
'Scan',
> >the scanner whirrs a bit, then I get error message:
> > '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.'

> I know that he has updated the backend to not use that SCSI-over_USB
> kernel driver bu that's not in 1.0.11 (but 1.0.12-pre1). I don't know
> however, if that has anything to do with your problem.

> > I do not understand this at all, and cannot find any trace of it in all
the
> > literature I've listed above - or any solution on Google.

> I guess it's a problem with the backend or the kernel driver. It's not
> easy to examine what's going on with so little information. So first
> make sure you are really using sane-backends 1.0.11:
>
> scanimage --version

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

> Now try to scan:
>
> scanimage >image.pnm

Response: scanner whirred for a short time. Otherwise, no response on
screen.

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

Response: None at all.

> > You'll forgive my cynicism if, after all these 'adventures', I give a
hollow
> > laugh when I note that 'SANE' is an acronym for 'Scanner Access Made
Easy' [!!!]

> It's easy. Well, most of the time :-) I just did "apt-get install
> xsane", plugged in my Mustek ScanExpress 1200 CU, started XSane.
> Voila, scanning works, took 40 seconds. So basically it works. Your
> problems are related to several issues as far as I can see:
>
> a) Not using precompiled packages. Well, I know, SuSE doesn't provide
>    updated packages between releases. But that's really not our fault.
> b) Misleading documentation (glib/gtk). I hope that's not our docu.
>    Otherwise we can fix the docu, but we need specific hints on what's
>    wrong or missing.
> c) Maybe problems with the backend (or kernel module)?

Thanks, so far, Henning. Any further helpful input would be appreciated.

Has anyone else (including the 'maintainer of the avision backend' [as
Henning put it]) any idea about the error message: 'Error: Failed to set
value at option gamma-table. Device busy.'

Thanks.

Best

Fred