Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Jun 2004 00:38:41 +0200
From:      Christian Hiris <4711@chello.at>
To:        freebsd-questions@freebsd.org
Cc:        Olaf Hoyer <ohoyer@ohoyer.de>
Subject:   Re: Using scanner with FreeBSD. A nightmare!
Message-ID:  <200406110038.53014.4711@chello.at>
In-Reply-To: <40C842D3.8090807@users.sourceforge.net>
References:  <40C7C47D.7060902@users.sourceforge.net> <20040610115602.Q99152@gaff.hhhr.ision.net> <40C842D3.8090807@users.sourceforge.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--Boundary-02=_8LOyAqzkagZg83i
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

On Thursday 10 June 2004 13:15, Rob wrote:
> Olaf Hoyer wrote:

>
> > I think the warm-up of the device is a bit slow, before it actually will
> > do something.
>
> I find it so terribly slow in comparison to its operation on Windows,
> that I think it's not the HP scanner, but the software, or the way
> I use the software.
>
> Also the quality is miserable. Although that is probably my mistake,
> I use the software with its default settings. It should be strange
> that the defaults result in miserably low quality pictures....
>
> I have changed the scan from "Lineart" to "Color"; this allows me to
> have a long, long coffee break until the scan is finished!
>
> ------------
>
> One more thing I do not understand: I always have to give
> "hp:/dev/uscanner0" as the device parameter to the scanner command.
>
> When I do "xscanimage", I get
>   [xscanimage] No scanners were identified. If you were expecting somethi=
ng
>            different, check that the scanner is plugged in, turned on and
>            detected by sane-find-scanner (if appropriate). Please read
>            the documentation which came with this software (README, FAQ,
>            manpages).
>
> But "xscanimage hp:/dev/uscanner0" works fine.
>
> However, "sane-find-scanner", returns the scanner, vendor, product etc:
>      found USB scanner (vendor=3D0x03f0, product=3D0x0401) at /dev/uscann=
er0
>
> And "scanimage -L" returns:
>    No scanners were identified. If you were expecting something different,
>    check that the scanner is plugged in, turned on and detected by the
>    sane-find-scanner tool (if appropriate). Please read the documentation
>    which came with this software (README, FAQ, manpages).

I did some debugging on that on 5.2-current with sane-backends 1.0.14.
I only have a HP-6270C, but it shows symptoms similar to your HP-5200C.  =20
The USB Controller is a VIA 83C572 chipset. I used xsane when debugging the=
 hp=20
driver.=20


Scenario I.

1. Scanner attached to /dev/usb1.
2. Run xsane, xscanimage and friends under an unprivileged user.
3. Don't want to pass the [driver:/device] parameter to your scanner app.=20

What happens?

The initialization code steps thru the usb devices until it finds a device=
=20
that matches a driver:device in /usr/local/etc/sane.d/.
If a permission for a /dev/usbx device is missing and no matching device co=
uld=20
be found, the initialization code calls sane_exit and the program terminate=
s. =20
[simply spoken]
=20
So, if our scanner is attached to /dev/usb1 one need to set "proper"=20
permissions on /dev/usb0, /dev/usb1 and /dev/uscanner0.

	crw-rw----  1 root  operator  243, 255 Jun  6 14:10 usb
	crw-rw-rw-  1 root  operator  243,   0 Jun  6 14:10 usb0
	crw-rw-rw-  1 root  operator  243,   1 Jun  6 14:10 usb1
	crw-rw----  1 root  operator  243,   2 Jun  6 14:10 usb2
	crw-rw----  1 root  operator  243,   3 Jun  6 14:10 usb3
	crw-rw-rw-  1 root  operator  242,   0 Jun 10 19:31 uscanner0


Scenario II.

1. Scanner is attached to /dev/usb1.
2. Run xsane, xscanimage and friends under an unprivileged user.
3. Pass the [driver:/device] opt to your scanner app. (ie. hp:/dev/uscanner=
)=20
4. Modes of /dev/usb* /dev/uscanner0:

	crw-rw----  1 root  operator  243, 255 Jun  6 14:10 usb
	crw-rw----  1 root  operator  243,   0 Jun  6 14:10 usb0
	crw-rw-rw-  1 root  operator  243,   1 Jun  6 14:10 usb1
	crw-rw----  1 root  operator  243,   2 Jun  6 14:10 usb2
	crw-rw----  1 root  operator  243,   3 Jun  6 14:10 usb3
	crw-rw-rw-  1 root  operator  242,   0 Jun 10 19:31 uscanner0


What happens here?

The great difference here is that /dev/usb0 is left at default mode 660.
In general, modes 666 for /dev/usb1 and /dev/uscanner0 are sufficient, but=
=20
device handling by the driver is different. It looks like the driver doesn'=
t=20
keep the device open (which it does in scenario I.):  =20

[hp] hp_GetOpenDevice: device /dev/uscanner0 not open
[hp] hp_nonscsi_open: device /dev/uscanner0 opened, fd=3D24
[hp] hp_AddOpenDevice: /dev/uscanner0 should not be kept open


Sometimes when the driver issues a scsi_flush to the scanner the scanner/ap=
p=20
hangs for several minutes. Normally such large delay only occurs as a resul=
t=20
of i/o errors, but not during normal operation (as under scenario I.).     =
  =20

[hp] scsi_flush: writing 2 bytes:
[hp]  0x0000  1B 45                                            .E
[waits several minutes here]


=46urthermore setting environment SANE_DEFAULT_DEVICE to "hp:/dev/uscanner0=
" =20
does not work for xsane and xscanimage. According to the manpages it should=
=20
work.


What can you do?

A simple way to make your scanner work without the devicename, is to plug t=
he=20
scanners usb cable into usb port 0 and do a 'chmod 666 /dev/usb0'. This=20
should make your gimp-plugin happy.

In my mind scanner initialization runs faster and more stable, if the devic=
e=20
stays open (as in scenario I.). You can make startup initialization a littl=
e=20
faster by removing unneeded drivers from /usr/local/etc/sane.d/dll.conf. Th=
e=20
line 'hp' should suffice.

Hint: Dust on the optical device also can slow down or break the calibratio=
n=20
process of your scanner.

>
> Is there a configuration file where I should define the default scanner,
> i.e. "hp:/dev/uscanner0" ?

See SANE_DEFAULT_DEVICE above.=20

>
> A side effect of this is (I believe), that sane doesn't work as a plugin
> with Gimp. I think Gimp first tries to probe the scanner devices, it
> doesn't get any, so the plugin doesn't work. Or something like this.
> (Yes, I have compiled sane with "WITH_GIMP=3Dyes").
>
> Thanks for the help.
> Rob.
>

=2D-=20
Christian Hiris <4711@chello.at> | OpenPGP KeyID 0x941B6B0B=20
OpenPGP-Key at hkp://wwwkeys.eu.pgp.net and http://pgp.mit.edu


--Boundary-02=_8LOyAqzkagZg83i
Content-Type: application/pgp-signature
Content-Description: signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQBAyOL8cyi/EZQbawsRAhXYAKCzGMsRL6JkF6QYFHlYk373Eo/sqwCgk88b
9otHQZbz3rs7CCLCCDSn0yY=
=VjiZ
-----END PGP SIGNATURE-----

--Boundary-02=_8LOyAqzkagZg83i--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200406110038.53014.4711>