Subject:
Driver loaded; can't see scanner
From:
"Paul D. Smith" ####@####.####
Date:
22 Nov 2000 06:31:08 -0000
Message-Id: <E13yTTk-0003rY-00@fencepost.gnu.org>
I have a Debian GNU/Linux box running unstable (woody). I have an
OpticPro 9630P connected to my parallel port (I don't have a printer
on this system). I've had this thing for a long time, and it's always
worked under my Windows system (dual boot) and I want to try to get it
working under Linux. I have a normal 2.2.17 kernel, with parport and
parport_pc modules.
I have VMware on this system, and I can even access the scanner from
Windows running inside VMware on Linux! VMware is using it through my
parallel port. So, I know it's there and working and accessible from
within Linux.
I installed sane & libsane 1.0.3 as a Debian package. The plustek
dynamic library is there. I made sure it's listed in dll.conf (in
fact, I removed everything else to be safe) and there's a plustek.conf
file (all in /etc/sane.d/) containing /dev/pt_drv.
I then downloaded the 0.37 tarfile and built the driver pt_drv.o,
copied it over, ran depmod, installed the module config lines, etc.
I ran the make operation to create the device files and they do exist,
and have the proper permissions as listed in the FAQ. I loaded the
module and I can see it using lsmod:
Module Size Used by
parport_pc 7568 1 (autoclean)
pt_drv 74976 0
parport 7696 1 [parport_pc pt_drv]
vmnet 16160 3
vmmon 17696 0
soundcore 2800 0 (autoclean) (unused)
rlmod 116272 1 (autoclean)
When the module loads, I see this in my /var/adm/messages file:
Nov 21 21:03:15 homebase kernel: pt_drv : driver version 0.37-21
Nov 21 21:03:15 homebase kernel: parport0: PC-style at 0x378 (0x778) [SPP,ECP,ECPEPP,ECPPS2]
Nov 21 21:03:15 homebase kernel: parport0: detected irq 7; use procfs to enable interrupt-driven operation.
Nov 21 21:03:17 homebase kernel: pt_drv0: 9630P found on port 0x0378
Nov 21 21:03:17 homebase kernel: pt_drv0: Lamp-Timer set to 180 seconds.
Nov 21 21:03:17 homebase kernel: pt_drv0: WarmUp period set to 30 seconds.
Nov 21 21:03:17 homebase kernel: pt_drv0: Lamp untouched on driver unload.
All that looks great (to me, anyway).
But, when I run scanimage -L, I get no output whatsoever. No other
command I've found will recognize the scanner either; they all think
it's not there. I've tried it both as me (I have rw permissions to
the device files) _and_ as root, just to be sure it's not a
permissions problem.
I tried using strace on the scanimage program, and I've discovered
that it does find plustek in the dll.conf file, it successfully loads
the libsane-plustek.so.1.0.3 shared lib, it successfully reads the
plustek.conf file, it finds the /dev/pt_drv device and opens it
successfully, then the next thing it does is set some kind of ioctl(),
and that _fails_ for some very strange reason. After that it just
exits. Here's the last part of the strace:
open("./plustek.conf", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/sane.d/plustek.conf", O_RDONLY) = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=13, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4001f000
read(4, "/dev/pt_drv\n", 4096) = 13
read(4, "", 4096) = 0
close(4) = 0
munmap(0x4001f000, 4096) = 0
open("/dev/pt_drv", O_RDONLY) = 4
ioctl(4, 0x40027801, 0xbfffd1ba) = -9019
munmap(0x40017000, 29632) = 0
_exit(0) = ?
(it sure would be nice if an error were printed here!)
I poked around the SANE interface docs and found out about the
debugging options, so I ran scanimage again with them enabled:
$ SANE_DEBUG_DLL=128 SANE_DEBUG_PLUSTEK=128 scanimage -L
[sanei_debug] Setting debug level of dll to 128.
[dll] adding backend plustek
[dll] loading backend plustek
[dll] dlopen()ing `/usr/lib/sane/libsane-plustek.so.1'
[dll] init: initializing backend `plustek'
[sanei_debug] Setting debug level of plustek to 128.
[plustek] sane_init: sane 1.0.3
[plustek] sane_init, >/dev/pt_drv<
[plustek] sane_init, >/dev/pt_drv<
[plustek] attach_one: >/dev/pt_drv<
[plustek] attach (/dev/pt_drv, (nil))
[plustek] drvopen()
[plustek] ioctl PT_DRV_OPEN_DEVICE failed(-9019)
[plustek] sane_get_devices (0xbffff598, 0)
[dll] exiting
[dll] calling backend `plustek's exit function
[plustek] sane_exit
Shows about the same info; no idea what -9019 means, if anything, and
no one seems to be printing errno here, which is extremely unfortunate
:(.
I should also point out that the /proc/pt_drv directory exists and all
seems to be well there:
$ ls -l /proc/pt_drv
total 0
dr-xr-xr-x 2 root root 0 Nov 22 01:23 device0/
-r--r--r-- 1 root root 0 Nov 22 01:23 info
$ ls -l /proc/pt_drv/device0
total 0
-r--r--r-- 1 root root 0 Nov 22 01:23 button0
-r--r--r-- 1 root root 0 Nov 22 01:23 info
$ cat /proc/pt_drv/info
Plustek Flatbed Scanner Driver version 0.37-21
Devices : 1
IOCTL-Version: 0x00000101
$ cat /proc/pt_drv/device0/info
Model : 9630P
Portaddress : 0x378
Portmode : EPP
Buttons : 1
Warmuptime : 30s
Lamp timeout: 180s
mov-switch : 0
I/O-delay : 0
CCD-Type : SONY Type
I'm completely at a loss; the help and FAQs all pretty much gloss over
this step (running scanimage -L) as if it always works, and while the mail
archives seem to have had others with this problem, I've already
checked the remedies I saw in the responses (I think).
I'd dearly love to get this working; anyone have any hints or thoughts
on it?
Thanks!
--
paul