[sane-devel] IScan 1.14.0 startup delay, not working Perf 2450, not compiling on Mandriva LE2005/gcc 3.4.3

Olaf Meeuwissen olaf.meeuwissen@avasys.jp
Mon, 20 Jun 2005 09:58:25 +0900


--=-=-=

Till Kamppeter <till.kamppeter@gmx.net> writes:

> libusb: 0.1.8
> kernel: 2.6.11
>
> I am trying to get an Epson Perfection 2450 and 4180 to work on the
> distro mentioned in the subject.
>
> At first I tried /home/test/iscan-1.14.0-3.i386.rpm, but iscan had a
> long delay to start up with both with the Perfection 4180 and 2450
> Photo. The 4180 actually worked, once the iscan window was open. Also
> multiple page scanning with the pages initiated by the scanner's
> button works. The 2450 did not work.

As for the 4180, that is most likely due to the firmware upload that
happens when you start iscan.  The 2450 problem "features" in a libusb
bug report as well as in a mail here on sane-devel.

  http://alioth.debian.org/tracker/index.php?func=detail&aid=300830&group_id=30186&atid=410366
  http://lists.alioth.debian.org/pipermail/sane-devel/2004-June/011233.html

You could try the solution suggested in that thread but note that it
violates the libusb specs and doesn't work on at least RH9 (you don't
care about that I guess).

There is also a similar (closed) bug in the SANE project bug tracker.

  http://sourceforge.net/tracker/index.php?func=detail&aid=1070123&group_id=1674&atid=101674

I've tried this approach as well but with little to no success for the
2450 :-(  Karl committed the patch in the comments on 2005-01-09, so
you may give the CVS version of the epson backend a (long) shot.

> Here the debug output for the 2450 Photo (in epkowa.conf only "usb"
> line is active, in dll.conf "epson", "plustek", and "snapscan" are
> commented out):
>
> [snip]
> [epkowa] SANE EPKOWA Backend 1.14.0 - 2005-02-18
> [epkowa] attach(libusb:001:086, 3)
> [epkowa] attach: opening libusb:001:086
> [epkowa] Found valid EPSON scanner: 0x4b8/0x112 (vendorID/productID)
> [epkowa] send buf, size = 2
> [epkowa] buf[0] 1b .
> [epkowa] buf[1] 40 @
> [epkowa] receive buf, expected = 1, got = 0

Oops!  We didn't get a reply and continue happily anyway ...
I tried reproducing this and "got = 1" here.  I suspect that you
created the logs after one (or more) failures to preview without
power cycling.  When I repeated after my first failure, it hangs
for a while before it reports "got = 0" then as well.  I can not
get passed the "Could not send command to scanner" message on my
system (Debian testing), though, unless I replug or power cycle.

> [snip]
>
> Clicking on "Preview" shows at first a window with a progress bar and
> "Scanner is warming up. Please wait". On the progress bar nothing
> happens and after some seconds a second window appears containing:
> "Could not send command to scanner. Check the scanner's status".
>
> On the console the following lines were added:
>
> -----------------------------------------------------------------------------
> [epkowa] reset calling open_scanner
> [epkowa] open_scanner()
> [epkowa] set = 0.000000
> [epkowa] set = 0.000000
> [epkowa] set = 215.899994
> [epkowa] set = 297.179993
> [epkowa] open_scanner()
> -----------------------------------------------------------------------------

I get to see a bit more, most notably lines like the following

  [epkowa] receive buf, expected = 1, got = 0

indicating that something seems to be not alright at the USB layer.
We are aware of the problem, but so far have not been able to find a
solution.

> Due to the long delay on starting iscan and the 2450 not working I
> decided to compile from source, using iscan-1.14.0-3.tar.gz.
>
> I did
>
> -----------------------------------------------------------------------------
> rpm -e --nodeps libsane1-devel
> urpmi libgtk+1.2-devel
> ./configure --prefix=/usr --sysconfdir=/etc
> -----------------------------------------------------------------------------
>
> libusb1-devel was already installed.
>
> Then I continued:
>
> -----------------------------------------------------------------------------
> [root@majax iscan-1.14.0]# make
> [snip]
> g++ -c -DHAVE_CONFIG_H -I. -I. -I../include/sane -I../include
> -DPATH_SANE_CONFIG_DIR=/etc/sane.d -DPATH_SANE_DATA_DIR=/usr/share
> -DV_MAJOR=1 -DV_MINOR=0 -g -O2 cfilebuf.cc
> cfilebuf.cc:252: error: expected unqualified-id before ';' token
> cfilebuf.cc:253: error: expected unqualified-id before ';' token
> make[1]: *** [cfilebuf.o] Error 1
> make[1]: Leaving directory `/root/i/iscan-1.14.0/lib'
> make: *** [all-recursive] Error 1
> [root@majax iscan-1.14.0]#
> -----------------------------------------------------------------------------
>
> Any idea what went wrong here? I am using gcc 3.4.3. The package is
> supposed to compile with gcc 3.2 or newer according to the Avasys web
> site.

Sorry, we haven't looked much at 3.4 and beyond (because we compile
our packages on obsolete distributions :-|).  Just apply the patch I
attached.  It already made it into our new release candidate.

With the patch iscan will compile but you will not be able to link
with libesmod.so because of C++ ABI changes.  You will need a 3.4
compiled version for linking to succeed and you don't have sources.
So much for non-free software :-{

Your only real solution to compile from "source" is to go back to gcc
3.3 (or 3.2).

> I am grateful for any help, both on the binary RPM and on the
> compilation issues.

Hope this helps,
-- 
Olaf Meeuwissen                          EPSON AVASYS Corporation, LAN
FSF Associate Member #1962           sign up at http://member.fsf.org/
GnuPG key: 6BE37D90/AB6B 0D1F 99E7 1BF5 EB97  976A 16C7 F27D 6BE3 7D90
Penguin's lib!       -- I hack, therefore I am --               LPIC-2

--=-=-=
Content-Disposition: attachment; filename=iscan-1.14.0-3_gcc-3.4.diff
Content-Description: GCC 3.4 fixes for iscan 1.14.0

Index: lib/cfilebuf.cc
===================================================================
RCS file: /cvsroot/iscan/source/lib/cfilebuf.cc,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- lib/cfilebuf.cc	2 Nov 2004 02:13:18 -0000	1.4
+++ lib/cfilebuf.cc	25 Apr 2005 00:27:08 -0000	1.5
@@ -249,7 +249,7 @@
 // force a single location of code for compilation by explicit
 // template instantiation, avoiding all kinds of nasty linking
 // problems
-template basic_cfilebuf< char  >;
-template basic_cfilebuf<wchar_t>;
+template class basic_cfilebuf< char  >;
+template class basic_cfilebuf<wchar_t>;
 
 }	// namespace iscan
Index: frontend/file-selector.cc
===================================================================
RCS file: /cvsroot/iscan/source/frontend/file-selector.cc,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- frontend/file-selector.cc	22 Apr 2005 08:35:36 -0000	1.14
+++ frontend/file-selector.cc	25 Apr 2005 00:27:08 -0000	1.15
@@ -161,7 +161,7 @@
   int size = 1;			// terminating { 0 } element
   for (int i = 0; 0 != _format[i].name; ++i)
     ++size;
-  _fmt = new (const format *)[size];
+  _fmt = new const format * [size];
 				// okay, so we may waste a few
 
   int cnt = 0;

--=-=-=--