plustek: Thread: Mandriva 2005LE and plustek_pp - How to fix


[<<] [<] Page 1 of 1 [>] [>>]
Subject: Mandriva 2005LE and plustek_pp - How to fix
From: ####@####.#### (Andreas Funke)
Date: 26 Jun 2005 03:35:38 +0100
Message-Id: <37088E2A.06DDADCC.02DE227F@netscape.net>

I have found 2 problems regarding the abovementioned backend in Mandriva 2005 LE (Mandrake 10.2), and they affect both the "direct" and "kernel module" access methods to my parallel port scanner (a BrightScan OptiPro, which is a rebadged Plustek PT12):

1. Scanning never takes place unless I set warmup time to 0 (zero) seconds. The last line in the debug output is related to the warmup time (the program seems unable to perform a simple countdown starting at any number of seconds!);

2. The scanner "hangs" unpredictably after scanning some pages, or particularly when the current settings result in big output files (bigger than 2 or 3MB).

3. Compiling the kernel module fails due to the new gcc 3.4.3 (the "inline" functions result in an unrecoverable compilation error).

Well, after scanning the archives of this mailing list, and experimenting myself with the source code of the backend, I found out how to get this backend to function properly with Mandriva 2005 LE:

1. Visit any download mirror of Mandriva, and browser the FTP directory structure until you find the source rpm for sane. Save it to your computer:

sane-1.0.15-7mdk.src.rpm

2. Become root (type "su" in a terminal) and install the source rpm:

rpm -ivh sane-1.0.15-7mdk.src.rpm

3. Change to the sources directory:

cd /usr/src/RPM/SOURCES

4. Unpack the sane-backends source code:

tar -jxvf sane-backends-1.0.15.tar.bz2

5. Enter the backend source code subdirectory:

cd sane-backends-1.0.15/backend

6. In order to fix the GCC 3.4.3 compilation error, edit the file plustek-pp_procs.h and modify line 81:

from
# define _INL   inline
to
# define _INL

7. In order to fix the timer (warmup) problem, and possibly the "hang" problem in the motor driver with particular scanning settings or file sizes, edit the file "plustek-pp_misc.c" and modify the following lines:

Line 604
From 
_LOC _INL void MiscStartTimer( pTimerDef timer , unsigned long us)
to
_LOC void MiscStartTimer( pTimerDef timer , unsigned long us)

Line 623
From
_LOC _INL int MiscCheckTimer( pTimerDef timer )
to
_LOC int MiscCheckTimer( pTimerDef timer )

8. Don't forget to save changes to the edited files

9. Change again to the SOURCES directory:
/usr/src/RPM/SOURCES

10. Remove the old sane-backend source tarball:
rm -f sane-backends-1.0.15.tar.bz2

11. Recreate it from the modified source code:
tar -jcvf sane-backends-1.0.15.tar.bz2 sane-backends-1.0.15

12. Rebuild the binary as well as the source packages:
rpmbuild -ba /usr/src/RPM/SPECS/sane.spec

13. After the build process is complete, reinstall your libsane1 and sane-backends packages from the newly compiled binaries, for your apropriate architecture, located at 
/usr/src/RPM/RPMS

For example, the binaries for my Pentium4 machine were created at:
/usr/src/RPM/RPMS/i586

In order to reinstall them, I have first removed the old packages with "rpm -e --nodeps sane-backends libsane1" and then reinstalled them from the location above ("rpm -Uvh libsane1-1.0.15-7mdk.i586.rpm sane-backends-1.0.15-7mdk.i586.rpm")

14. Restore sane configuration files from the "rpmsave" files:

cp -f /etc/sane/dll.conf.rpmsave /etc/sane/dll.conf
cp -f /etc/sane/plustek_pp.conf.rpmsave /etc/sane/plustek_pp.conf

15. First test the scanner with "option warmup 0" and then try another warmup values. It should work now. 

__________________________________________________________________
Switch to Netscape Internet Service.
As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register

Netscape. Just the Net You Need.

New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp
Subject: RE: Mandriva 2005LE and plustek_pp - How to fix
From: ####@####.#### (Andreas Funke)
Date: 26 Jun 2005 14:39:14 +0100
Message-Id: <36414F67.295735FC.02DE227F@netscape.net>

Errata and a few additional considerations:

1. Where I wrote
/etc/sane/

please read:
/etc/sane.d/

2. The most relevant steps in my previous message are #6 and $7. The remaining steps where designed to not break the RPM database of Mandriva, but there are alternative ways that can be followed by experienced users;

3. Exactly as suggested by the documentation, it is advisable to set the parallel port mode in BIOS to EPP, and NOT choosing ECP or ECP+EPP. In this particular machine, the EPP 1.7 mode works better than the EPP 1.9 mode;

4. When I switch the power on, the scanner's light turns on and remains in that state until the sane backend accesses it, provided that /etc/sane.d/plustek_pp.conf contains "option lOffOnEnd 1". Since I'm not using the scanner all the time, and I don't like the fact that the lamp stays on for hours or days without being used, I created a simple initscript that works well in any recent version of Mandrake or Mandriva. The script is saved to /etc/init.d/ with the name "lampoff" and then activating it in the default runlevels by running "chkconfig --add lampoff", as root:

#!/bin/bash
#
# chkconfig: 12345 24 60
# description: activate and turn off scanner lamp at boot

#Sources Functions
. /etc/rc.d/init.d/functions

# see how we were called.
case "$1" in
  start)
    scanimage -n
    touch /var/lock/subsys/lampoff
    ;;
  stop)
    rm -f /var/lock/subsys/lampoff
    ;;
  status)
    echo "no available status info"
    ;;
  restart)
    scanimage -n
    touch /var/lock/subsys/lampoff
    ;;
  *)
    gprintf "*** Usage: $0 {start|stop|status|restart}\n"
    exit 1
esac

exit 0

__________________________________________________________________
Switch to Netscape Internet Service.
As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register

Netscape. Just the Net You Need.

New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp
Subject: Re: Mandriva 2005LE and plustek_pp - How to fix
From: Gerhard Jaeger ####@####.####
Date: 27 Jun 2005 07:49:56 +0100
Message-Id: <200506270849.19881.gerhard@gjaeger.de>

Thanx for providing this!

Gerhard

On Sunday 26 June 2005 15:38, Andreas Funke wrote:
> Errata and a few additional considerations:
> 
> 1. Where I wrote
> /etc/sane/
> 
> please read:
> /etc/sane.d/
> 
> 2. The most relevant steps in my previous message are #6 and $7. The remaining steps where designed to not break the RPM database of Mandriva, but there are alternative ways that can be followed by experienced users;
> 
> 3. Exactly as suggested by the documentation, it is advisable to set the parallel port mode in BIOS to EPP, and NOT choosing ECP or ECP+EPP. In this particular machine, the EPP 1.7 mode works better than the EPP 1.9 mode;
> 
> 4. When I switch the power on, the scanner's light turns on and remains in that state until the sane backend accesses it, provided that /etc/sane.d/plustek_pp.conf contains "option lOffOnEnd 1". Since I'm not using the scanner all the time, and I don't like the fact that the lamp stays on for hours or days without being used, I created a simple initscript that works well in any recent version of Mandrake or Mandriva. The script is saved to /etc/init.d/ with the name "lampoff" and then activating it in the default runlevels by running "chkconfig --add lampoff", as root:
> 
> #!/bin/bash
> #
> # chkconfig: 12345 24 60
> # description: activate and turn off scanner lamp at boot
> 
> #Sources Functions
> . /etc/rc.d/init.d/functions
> 
> # see how we were called.
> case "$1" in
>   start)
>     scanimage -n
>     touch /var/lock/subsys/lampoff
>     ;;
>   stop)
>     rm -f /var/lock/subsys/lampoff
>     ;;
>   status)
>     echo "no available status info"
>     ;;
>   restart)
>     scanimage -n
>     touch /var/lock/subsys/lampoff
>     ;;
>   *)
>     gprintf "*** Usage: $0 {start|stop|status|restart}\n"
>     exit 1
> esac
> 
> exit 0

[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.