# Epson Iscan problems

## reynolds531

I was pleased to see Iscan -- Epson's scanner software -- put into portage recently. But I've had a couple of problems getting it working.

The first problem was that it didn't compile, throwing out lots of messages about glibcxx3.4:

```
odule-2.0.so -ldl /usr/lib/libglib-2.0.so /usr/lib/libsane.so /usr/lib/libusb.so

/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/../../../../i686-pc-linux-gnu/bin/ld: warning: libstdc++.so.6, needed by ../non-free/libesmod.so, not found (try using -rpath or -rpath-link)

../non-free/libesmod.so: undefined reference to `std::ios_base::Init::~Init [in-charge]()@GLIBCXX_3.4'

../non-free/libesmod.so: undefined reference to `std::nothrow@GLIBCXX_3.4'

../non-free/libesmod.so: undefined reference to `std::bad_alloc::~bad_alloc [in-charge]()@GLIBCXX_3.4'

../non-free/libesmod.so: undefined reference to `operator delete(void*)@GLIBCXX_3.4'../non-free/libesmod.so: undefined reference to `typeinfo for std::bad_alloc@GLIBCXX_3.4'

../non-free/libesmod.so: undefined reference to `operator delete[](void*)@GLIBCXX_3.4'

../non-free/libesmod.so: undefined reference to `vtable for std::bad_alloc@GLIBCXX_3.4'

../non-free/libesmod.so: undefined reference to `operator new[](unsigned)@GLIBCXX_3.4'

../non-free/libesmod.so: undefined reference to `operator new(unsigned)@GLIBCXX_3.4'../non-free/libesmod.so: undefined reference to `__cxa_pure_virtual@CXXABI_1.3'

../non-free/libesmod.so: undefined reference to `__cxa_allocate_exception@CXXABI_1.3'

../non-free/libesmod.so: undefined reference to `vtable for __cxxabiv1::__si_class_type_info@CXXABI_1.3'

../non-free/libesmod.so: undefined reference to `vtable for __cxxabiv1::__class_type_info@CXXABI_1.3'

../non-free/libesmod.so: undefined reference to `__gxx_personality_v0@CXXABI_1.3'

../non-free/libesmod.so: undefined reference to `operator new[](unsigned, std::nothrow_t const&)@GLIBCXX_3.4'

../non-free/libesmod.so: undefined reference to `__cxa_throw@CXXABI_1.3'

../non-free/libesmod.so: undefined reference to `std::ios_base::Init::Init[in-charge]()@GLIBCXX_3.4'

collect2: ld returned 1 exit status

make[2]: *** [iscan] Error 1

make[2]: *** Waiting for unfinished jobs....
```

That "3.4" led me to think that the ebuild was downloading the version of iscan designed to work with versions of gcc 3.4 and up. I have gcc 3.3.6.

To use the version of iscan meant to be compiled with gcc <3.4, I made an overlay with an exact copy of the official ebuild, except that I changed the following line:

```
SRC_URI="http://lx1.avasys.jp/iscan/v${PV//./}/${P}-1.c2.tar.gz"
```

to:

```
SRC_URI="http://lx1.avasys.jp/iscan/v${PV//./}/${P}-1.tar.gz"
```

After that, it compiled fine, but I still couldn't get iscan to work. All I'd get was the message:

```
Couldn't send command to scanner. Check the scanner's status.
```

That reminded me of a recent problem with sane-backends, where it wouldn't work with multifunction devices (scanner/printer etc) unless the usb printer module was killed. (That problem is discussed here: https://forums.gentoo.org/viewtopic-t-377052-highlight-cx4600.html.)

Sure enough, when I disabled usblp and usb-storage (my scanner is also a printer and a memory-card reader), iscan worked (though only as root).

I was going to file a bug report on this second problem, but I'm not sure if it's appropriate, since I'm using a different source than in the official ebuild.

If anyone knows how I can fix this problem (so I don't have to kill modules), I'd appreciate it. Also, any suggestions on how to use iscan as user.

----------

## i92guboj

The problem with usblp is a known one. The only solution that I know (and what I do) is to use a 2.6.12.x kernel. The problem seems to be related to the .14 series of the kernel. So .12 whould work fine without having to shut off the usblp module to start the scanner.

About the other issue, it is a permissions related one, and maybe the config that you need to alter is the libusb or hotplug configuration (or maybe you need just to add your user to the correct group, if the rest of the configuration is fine), look here in case it helps: https://forums.gentoo.org/viewtopic-t-329637.html

- Regards.

----------

## reynolds531

I was able to fix the usb-conflict issue by looking at the ebuild that solved that problem for the sane-backends package (1.0.16-r4). 

That ebuild applied a patch called kernel-2.6.13usb-problem.patch to a file called sanei_usb.c.

I applied that patch to a file of the same name in the iscan source and it worked!

----------

## reynolds531

I think I found a solution for the permissions problem also. The script /etc/hotplug/usb/iscan-device sets permissions for iscan. 

The script sets default permissions:

```
DEFAULT_OWNER=root

DEFAULT_GROUP=root

DEFAULT_PERMS=0666
```

I changed the second line to DEFAULT_GROUP=scanner and it worked. Scanner is the group created by the sane-backends package and I had already added my user to it.

[Edit: VERY BAD IDEA! - after making this change, I could only launch iscan once; on subsequent tries nothing would happen.  Also my system got caught in some kind of loop where it was constantly checking the status of the memory-card-reader that's part of my printer. I changd "scanner" back to "root." I also discovered that I only have the permissions problem when the scanner is plugged in during boot. I can fix the problem just by unplugging and plugging back in the usb cord. Anyway, I'll probably let this rest. I think I've reached the limits of blind mucking-about.]

----------

## reynolds531

I just made the switch to gcc3.4.4 and the multifunction-device problem exists in that version of the iscan source code as well (the same patch fixes it). So I guess I will file a bug report.

----------

