[sane-devel] Primax 400 (plustek_pp) only detected by kernel module

john john@pond-weed.com
Thu, 17 Feb 2005 19:12:43 +0000


On Tue, 15 Feb 2005 08:57:19 +0100
Gerhard Jaeger <gerhard@gjaeger.de> wrote:

> On Monday 14 February 2005 20:03, john wrote:
> > On Thu, 10 Feb 2005 16:02:22 +0100
> > Gerhard Jaeger <gerhard@gjaeger.de> wrote:
> > 
> > > On Monday 07 February 2005 20:31, john wrote:
> > > > On Mon, 7 Feb 2005 08:31:47 +0100
> > > > Gerhard Jaeger <gerhard@gjaeger.de> wrote:
> > > > 
> > > > > On Friday 04 February 2005 22:57, john wrote:
> > > > > > Hello,
> > > > > > 
> > > > > > I've got an antique "Primax 4800 Driect 30 bit" which is
> > > > > > supported by the plustek_pp module.
> > > > > > 
> > > > > > If I load the kernel module, everything works fine. But
> > > > > > using the[direct] user-mode driver, I get this from
> > > > > > scanimage -L:
> > > > > > 
> > > > > > <snip>
> > > > > > [plustek_pp] Compare data=0x7f and status=0xf, port=0x0
> > > > > > [plustek_pp] p48xxReadWriteTest()
> > > > > > [plustek_pp] Can't find your model, asic = 0x77
> > > > > > [plustek_pp] detectScannerConnection() returns -9031.
> > > > > > [plustek_pp] ************* ASIC9800x *************
> > > > > > [plustek_pp] ResetPort()
> > > > > > [plustek_pp] IOInitialize()
> > > > > > [plustek_pp] * using readfunction >fnBiDirRead<
> > > > > > [plustek_pp] ASIC = 0x00
> > > > > > [plustek_pp] Unknown ASIC-ID
> > > > > > [plustek_pp] *** DETECTION DONE, result: -9020 ***
> > > > > > <snip>
> > > > > > No scanners were identified.
> > > > > > 
> > > > > > I've tested on Debian unstable (2.4 kernel) and Slackware
> > > > > > current(2.6 kernel) with the same results. Cn anyone point
> > > > > > me to where I should start looking for the problem?
> > > > > > 
> > > > > Hi,
> > > > > 
> > > > > this could be because of different timing behaviour, when
> > > > > accessing a device via kernel directly or via user-mode
> > > > > application. As you didn't send the complete debug stuff, I
> > > > > simply guess, that the parport didn't run in EPP mode (or is
> > > > > not detected correctly), please make sure to have it in EPP
> > > > > mode (check BIOS settings), also check the options for the
> > > > > parport_pc modules (no IRQ should be assigned)...
> > > > 
> > > > Gerhard,
> > > > 
> > > > Thanks for the suggestions. Sadly, it's still not working.
> > > > Here's the complete debugging output from "scanimage -L". My
> > > > apologies to the list for posting such a long message.
> > > > 
> > > [SNIPSNAP]
> > > > [plustek_pp] Assigning port handle 0
> > > > [plustek_pp] ptdrvOpen(port=0x0)
> > > > [plustek_pp] Try to claim the parport
> > > > [plustek_pp] Setting SPP-mode
> > > > [plustek_pp] Setting PS/2-mode
> > > > [plustek_pp] We're using libIEEE1284 I/O
> > > > [plustek_pp] Starting Scanner-Autodetection
> > > 
> > > Hmmm, did you really check your BIOS settings? Please make sure,
> > > that NO ECP is enabled. You might try and set the port to SPP
> > > mode. Also set the parport_pc modules parameter, i.e. 
> > > options parport_pc io=0x378  irq=none
> > > This seems to be necessary on some boards, esp. with VIA chipset.
> > 
> > Gerhard,
> > 
> > No, sorry, I've tried every combination, and nothing works.
> > 
> > I would be happy to try to debug this myself (and to send you
> > a patch, if I could find one). Is there any way I can get hold of
> > any documentation to understand the conversation between the PC and
> > the scanner?
> > 
> Well, as the scanner fails in an early stage, there's no need for a
> lot of documentation ;)
> In your case, you should focus on the different behaviour between the
> code running as kernel module and as user-space program. Especially
> the detection and init stuff could be interesting:
> MiscInitPorts() in file plustek-pp_misc.c
> detectScannerConnection() in file plustek-pp_detect.c
> 
> You might wanna dig somewhat deeper. As I do not have such a device, I
> could not test...
> 
> The following links provide some useful information about the parport
> interface and the ieee1284 lib
> http://www.beyondlogic.org/spp/parallel.htm
> http://cyberelk.net/tim/libieee1284/index.html 

Gerhard:

I dug deeper, and found out this:

If I configure sane to work without libieee1284, then it works OK (at
least, it detects the scanner). But this is a compile-time option; it
can't be selected by editing the plustek_pp.conf file. I hadn't picked
that up from reading the instructions: maybe it could be made clearer in
the documentation.

Using libieee1284, the scanner detection works if the ppdev module is
loaded, and it doesn't work if the module is not loaded.

So I've concluded that the problem is in the libieee1284 code. I'll keep
digging, but I'll probably only disturb the author of that code if I've
got any more questions.

Thanks,
John