[sane-devel] Problems with plustek_pp in FreeBSD

Micah micahjon@ywave.com
Tue, 31 Aug 2004 17:18:01 -0700

I'm not sure if it's a system config, porting, backend or libieee1284 
problem.  I'm trying to get a parport plustek opticpro 4800p working in 
FreeBSD 5.2.1-Release.  I have sane-backends 1.0.14 with libieee1284 
0.2.8 installed.

When I do a scanimage -L, I get the "no scanners were identified...." 
msg.  I've attached the debugging output from it.  By the looks of the 
messages it seems to open the parport just fine using libieee, but dies 
during negotiation (after "[plustek_pp] We're using libIEEE1284 I/O"). 
Digging into the libieee code, the only way to get the "Failed at event 
2" message is if it times out during a wait_status call in default.c.

I've looked at this off and on for several days and just don't have any 
more ideas left.


Config files included below:

all entries except plustek_pp commented out.

#(Most comments removed)
#device ppi0
device 0x378
# device lpt0
# device parport0

option warmup    -1
option lOffOnEnd -1
option lampOff   -1

Debugging output:
[sanei_debug] Setting debug level of dll to 128.
[dll] sane_init: SANE dll backend version 1.0.10 from sane-backends 1.0.14
[dll] sane_init: reading dll.conf
[dll] add_backend: adding backend `plustek_pp'
[dll] sane_get_devices
[dll] load: searching backend `plustek_pp' in `/usr/local/lib/sane'
[dll] load: trying to load `/usr/local/lib/sane/libsane-plustek_pp.so.1'
[dll] load: dlopen()ing `/usr/local/lib/sane/libsane-plustek_pp.so.1'
[dll] init: initializing backend `plustek_pp'
[sanei_debug] Setting debug level of plustek_pp to 128.
[sanei_debug] Setting debug level of sanei_pp to 128.
[sanei_pp] pp_init: called for the first time
[sanei_pp] pp_init: initializing libieee1284
We can use /dev/io
[sanei_pp] pp_init: 3 ports reported by IEEE 1284 library
[sanei_pp] pp_init: port 0 is `0x278`
[sanei_pp] pp_init: port 1 is `0x378`
[sanei_pp] pp_init: port 2 is `0x3bc`
[sanei_pp] pp_init: initialized successfully
[sanei_pp] pp_calibrate_delay: Delay expected: 1000, real 5274, pp_thresh=5
[plustek_pp] PlustekPP backend V0.01-8, part of sane-backends 1.0.14
[plustek_pp] ># Plustek-PP SANE Backend configuration file<
[plustek_pp] ># For use with Plustek parallel-port scanners<
[plustek_pp] >#<
[plustek_pp] ><
[plustek_pp] >#<
[plustek_pp] ># user either [direct] or [kernel] to access the scanner<
[plustek_pp] ># when using [kernel], device specifies the device-node, 
which is created<
[plustek_pp] ># by the kernel-module loader (applies only to Linux)<
[plustek_pp] ># when using [direct], device is used to set the 
parallel-port base address<
[plustek_pp] ># or a device-name suitable for libieee1284, i.e. parport0<
[plustek_pp] >#<
[plustek_pp] >[direct]<
[plustek_pp] >#device ppi0<
[plustek_pp] >device 0x378<
[plustek_pp] Decoding device name >0x378<
[plustek_pp] ># device lpt0<
[plustek_pp] ># device parport0<
[plustek_pp] ><
[plustek_pp] >#<
[plustek_pp] ># leave the default values as specified in /etc/modules.conf<
[plustek_pp] >#<
[plustek_pp] >option warmup    -1<
[plustek_pp] Decoding option >warmup<
[plustek_pp] >option lOffOnEnd -1<
[plustek_pp] Decoding option >lOffOnEnd<
[plustek_pp] >option lampOff   -1<
[plustek_pp] Decoding option >lampOff<
[plustek_pp] ><
[plustek_pp] ># model override switch, mostly for cosmetic changes, if 
the autodetection<
[plustek_pp] ># does not work or could not work correctly<
[plustek_pp] ># option mov 6<
[plustek_pp] ><
[plustek_pp] >#<
[plustek_pp] ># example for accessing the scanner via libieee1284<
[plustek_pp] >#<
[plustek_pp] ># [direct]<
[plustek_pp] ># device lpt0<
[plustek_pp] ># device parport0<
[plustek_pp] ><
[plustek_pp] >#<
[plustek_pp] ># example for accessing the scanner via the kernel module<
[plustek_pp] >#<
[plustek_pp] >#[kernel]<
[plustek_pp] >#device /dev/pt_drv<
[plustek_pp] >#<
[plustek_pp] >#option warmup    -1<
[plustek_pp] >#option lOffOnEnd -1<
[plustek_pp] >#option lampOff   -1<
[plustek_pp] attach (0x378, 0xbfbfdeb0, 0x0)
[plustek_pp] Device configuration:
[plustek_pp] device name   : >0x378<
[plustek_pp] direct I/O    : yes
[plustek_pp] warmup        : -1s
[plustek_pp] lampOff       : -1
[plustek_pp] lampOffOnEnd  : yes
[plustek_pp] model override: 0
[plustek_pp] ---------------------
[plustek_pp] drvopen()
[sanei_pp] sanei_pp_open: called for device '0x378'
[sanei_pp] pp_open: trying to attach dev `0x378`
[sanei_pp] pp_open: looking up port in list
[sanei_pp] pp_open: checking >0x278<
[sanei_pp] pp_open: checking >0x378<
[sanei_pp] pp_open: port is in list at port[1]
[sanei_pp] pp_open: opening device
==> ieee1284_open
==> init_port
Got 0 from IO init
<== 0
[sanei_pp] Supported Modes: SPP PS/2
[sanei_pp] pp_open: device `0x378` opened...
[sanei_pp] sanei_pp_open: connected to device using fd 1
[plustek_pp] ptdrvInit(0)
[plustek_pp] Init settings done
[plustek_pp] ScanData = 0x0805a000
[plustek_pp] Assigning port handle 1
[plustek_pp] ptdrvOpen(port=0x1)
[plustek_pp] Try to claim the parport
[sanei_pp] sanei_pp_claim: fd = 1
[plustek_pp] Setting SPP-mode
[plustek_pp] Setting PS/2-mode
[plustek_pp] We're using libIEEE1284 I/O
==> default_negotiate (to 0x1)
IEEE 1284 mode 0x1
14:27:30.150213 CONTROL: !nStrobe  nAutoFd  nInit !nSelectIn
14:27:30.150482 STATUS:  nFault  Select  PError  nAck !Busy
Failed at event 2
14:27:30.263537 CONTROL: !nStrobe !nAutoFd  nInit  nSelectIn
<== -5
[plustek_pp] Starting Scanner-Autodetection
[plustek_pp] ************ DETECTP48xx ************
[plustek_pp] ModelSet4800()
[plustek_pp] modelInitPageSettings()
[plustek_pp] A4 set
[plustek_pp] ModelSet4800() done.
[plustek_pp] P48xxInitAsic()
[plustek_pp] DacInitialize()
[plustek_pp] ImageInitialize()
[plustek_pp] IOFuncInitialize()
[plustek_pp] IOInitialize()
[plustek_pp] * using readfunction >fnBiDirRead<
[plustek_pp] MotorInitialize()
[plustek_pp] ResetPort()
14:27:30.384033 CONTROL: !nStrobe !nAutoFd !nInit !nSelectIn
14:27:30.384091 CONTROL:  nStrobe  nAutoFd  nInit !nSelectIn
14:27:30.384122 CONTROL: !nStrobe !nAutoFd  nInit !nSelectIn
[plustek_pp] INB_DATA returns 248.
14:27:30.384234 CONTROL: !nStrobe !nAutoFd  nInit  nSelectIn
[plustek_pp] detectScannerConnection() returns -9021.
[plustek_pp] ************* ASIC9800x *************
[plustek_pp] ResetPort()
14:27:30.384350 CONTROL: !nStrobe !nAutoFd !nInit !nSelectIn
14:27:30.384381 CONTROL:  nStrobe  nAutoFd  nInit !nSelectIn
[plustek_pp] IOInitialize()
[plustek_pp] * using readfunction >fnBiDirRead<
14:27:30.384461 CONTROL: !nStrobe !nAutoFd  nInit !nSelectIn
[plustek_pp] ioP98OpenScanPath() failed!
[plustek_pp] IORegisterToScanner - no connection!
14:27:30.385118 CONTROL: !nStrobe !nAutoFd  nInit  nSelectIn
14:27:30.385149 CONTROL: !nStrobe !nAutoFd  nInit !nSelectIn
14:27:30.385181 CONTROL:  nStrobe  nAutoFd  nInit !nSelectIn
14:27:30.385213 CONTROL: !nStrobe  nAutoFd  nInit !nSelectIn
14:27:30.385245 CONTROL: !nStrobe !nAutoFd  nInit !nSelectIn
[plustek_pp] ASIC = 0xFF
[plustek_pp] Unknown ASIC-ID
[plustek_pp] *** DETECTION DONE, result: -9020 ***
[plustek_pp] ptdrvClose()
[plustek_pp] MiscRestorePort()
[plustek_pp] Releasing parport
[sanei_pp] sanei_pp_release: fd = 1
[plustek_pp] ptdrvShutdown()
[plustek_pp] cleanup device 0
[sanei_pp] sanei_pp_close: fd = 1
[sanei_pp] sanei_pp_close: freeing resources
[sanei_pp] pp_close: fd=1
[sanei_pp] pp_close: this is port '0x378'
[sanei_pp] pp_close: trying to free io port
[sanei_pp] pp_close: marking port as unused
[sanei_pp] sanei_pp_close: finished
[plustek_pp] open: PtDrvInit failed: -9020
[plustek_pp] open failed: -1
[dll] init: backend `plustek_pp' is version 1.0.0
[plustek_pp] sane_get_devices (0xbfbfe778, 0)
[dll] sane_get_devices: found 0 devices
[dll] sane_exit: exiting
[dll] sane_exit: calling backend `plustek_pp's exit function
[plustek_pp] sane_exit
[dll] sane_exit: finished

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

ppc0: <Parallel port> at port 0x378-0x37f irq 7 on isa0
ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode
ppc0: FIFO with 16/16/8 bytes threshold
ppbus0: <Parallel port bus> on ppc0

BIOS:  Parport is currently set to EPP/ECP (originally just EPP)
I have a parport zip attached too, and it properly sees the parport as 
EPP, and yes I have tried with the zip physically detached running a 
kernel w/o zip support.