Brother x86 scanner driver on Raspberry Pi with QEMU and SANE
4
votes
3
answers
8387
views
I have a Brother 7055 Printer/Scanner and a Raspberry Pi, I'm trying to turn both into a print and scan server. Unfortunately, Brother doesn't provide any ARM drivers. I run into this blog post about QEMU emulation on the Raspberry Pi and indeed I've managed to install the x86 printer drivers using this approach, I'm sharing it via CUPS and all good. Now I'm trying to make the scanner work and the Brother software is installed without any errors but the scanner doesn't show up when I run
scanimage -L
The scanner is connected:
dporobic@raspberrypi:~ $ lsusb
Bus 001 Device 005: ID 04f9:0248 Brother Industries, Ltd DCP-7055 scanner/printer
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
But can't see the scanner:
dporobic@raspberrypi:~ $ scanimage -L
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).
sane-find-scanner does see something but can't make it work as brother uses it's own sane drivers.
porobic@raspberrypi:~ $ sudo sane-find-scanner
# sane-find-scanner will now attempt to detect your scanner. If the
# result is different from what you expected, first make sure your
# scanner is powered up and properly connected to your computer.
# No SCSI scanners found. If you expected something different, make sure that
# you have loaded a kernel SCSI driver for your SCSI adapter.
# Also you need support for SCSI Generic (sg) in your operating system.
# If using Linux, try "modprobe sg".
found USB scanner (vendor=0x04f9, product=0x0248) at libusb:001:005
found USB scanner (vendor=0x0424, product=0xec00) at libusb:001:003
# Your USB scanner was (probably) detected. It may or may not be supported by
# SANE. Try scanimage -L and read the backend's manpage.
# Not checking for parallel port scanners.
# Most Scanners connected to the parallel port or other proprietary ports
# can't be detected by this program.
Debugging scanimage gives me following output, it looks like the brother4 lib can't be loaded:
dporobic@raspberrypi:~ $ sudo SANE_DEBUG_DLL=255 scanimage -L
[sanei_debug] Setting debug level of dll to 255.
[dll] sane_init: SANE dll backend version 1.0.13 from sane-backends 1.0.24
[dll] sane_init/read_dlld: attempting to open directory `./dll.d'
[dll] sane_init/read_dlld: attempting to open directory `/etc/sane.d/dll.d'
[dll] sane_init/read_dlld: using config directory `/etc/sane.d/dll.d'
[dll] sane_init/read_dlld: considering /etc/sane.d/dll.d/libsane-extras
[dll] sane_init/read_config: reading dll.d/libsane-extras
[dll] sane_init/read_dlld: done.
[dll] sane_init/read_config: reading dll.conf
[dll] add_backend: adding backend `brother4'
[dll] sane_get_devices
[dll] load: searching backend brother4' in
/usr/lib/arm-linux-gnueabihf/sane:/usr/lib/sane'
[dll] load: trying to load `/usr/lib/arm-linux-gnueabihf/sane/libsane-brother4.so.1'
[dll] load: dlopen()ing `/usr/lib/arm-linux-gnueabihf/sane/libsane-brother4.so.1'
**[dll] load: dlopen() failed (/usr/lib/arm-linux-gnueabihf/sane/libsane-brother4.so.1: cannot open shared object file: No such file or directory)**
[dll] sane_get_devices: found 0 devices
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).
[dll] sane_exit: exiting
[dll] sane_exit: finished
The lib files are there but it looks like the files can't be opened or accessed:
dporobic@raspberrypi:~ $ ls -l /usr/lib/arm-linux-gnueabihf/sane/ | grep brother
-rwxr-xr-x 1 root root 129696 Jan 8 11:08 libsane-brother4.so
-rwxr-xr-x 1 root root 129696 Jan 8 11:08 libsane-brother4.so.1
-rwxr-xr-x 1 root root 129696 Jan 8 11:08 libsane-brother4.so.1.0.7
Maybe some dependencies of the libsane-brother4.so lib are missing but running objdump -x and looking under the dynamic section gives me following output (I'm not very familiar with objdump so I hope I'm interpreting this correctly):
dporobic@raspberrypi:~ $ objdump -x /usr/lib/arm-linux-gnueabihf/sane/libsane-brother4.so | grep NEEDED
NEEDED libpthread.so.0
NEEDED libnsl.so.1
NEEDED libusb-0.1.so.4
NEEDED libm.so.6
NEEDED libdl.so.2
NEEDED libc.so.6
And I seem to have those libraries on my Pi, only one of those is only available as ARM version and not as i386, all other come in both:
dporobic@raspberrypi:~ $ sudo ldconfig -p | grep -E 'libpthread.so.0|libnsl.so.1|libusb-0.1.so.4|libm.so.6|libdl.so.2|libc.so.6'
libusb-0.1.so.4 (libc6,hard-float) => /lib/arm-linux-gnueabihf/libusb-0.1.so.4
libusb-0.1.so.4 (libc6,hard-float) => /usr/lib/arm-linux-gnueabihf/libusb-0.1.so.4
libpthread.so.0 (libc6,hard-float, OS ABI: Linux 2.6.32) => /lib/arm-linux-gnueabihf/libpthread.so.0
libpthread.so.0 (libc6, OS ABI: Linux 2.6.32) => /lib/i386-linux-gnu/libpthread.so.0
libnsl.so.1 (libc6,hard-float, OS ABI: Linux 2.6.32) => /lib/arm-linux-gnueabihf/libnsl.so.1
libnsl.so.1 (libc6, OS ABI: Linux 2.6.32) => /lib/i386-linux-gnu/libnsl.so.1
libm.so.6 (libc6,hard-float, OS ABI: Linux 2.6.32) => /lib/arm-linux-gnueabihf/libm.so.6
libm.so.6 (libc6, OS ABI: Linux 2.6.32) => /lib/i386-linux-gnu/libm.so.6
libdl.so.2 (libc6,hard-float, OS ABI: Linux 2.6.32) => /lib/arm-linux-gnueabihf/libdl.so.2
libdl.so.2 (libc6, OS ABI: Linux 2.6.32) => /lib/i386-linux-gnu/libdl.so.2
libc.so.6 (libc6,hard-float, OS ABI: Linux 2.6.32) => /lib/arm-linux-gnueabihf/libc.so.6
libc.so.6 (ELF, OS ABI: Linux 2.6.32) => /lib/i386-linux-gnu/libc.so.6
But the one lib that I need is not listed, probably that's why it can't be loaded:
dporobic@raspberrypi:~ $ sudo ldconfig -p | grep libsane-brother4.so
dporobic@raspberrypi:~ $
Originally the borther4 lib was located in /usr/lib/sane
, I've added this path to /etc/ld.so.conf.d/libsane-brother.conf
and run sudo ldconfig
but I only get this libsane.so.1
lib when I check in ldconfig -v
:
dporobic@raspberrypi:~ $ sudo ldconfig -v 2>/dev/null | grep brother -B1
/usr/lib/sane:
libsane.so.1 -> libsane-brother4.so.1.0.7
Can't make the libsane-brother.so.1
lib appear in the ld cache...
**Update**
It seems to be unrelated to dlconfig, on my opensuse machine where the scanner is working the libsane-brother.so.1 lib
is not showing in the ldconfig cache, just like on the Pi but there the lib is loaded without any problem.
dporobic@latitude:~> sudo ldconfig -v 2>/dev/null | grep -E 'sane|brother'
libksane.so.0 -> libksane.so.0.2.0
libsane.so.1 -> libsane.so.1.0.24
Loading correctly, no error:
dporobic@latitude:~> sudo SANE_DEBUG_DLL=255 scanimage -L
[sanei_debug] Setting debug level of dll to 255.
[dll] sane_init: SANE dll backend version 1.0.13 from sane-backends 1.0.24
[dll] sane_init/read_dlld: attempting to open directory `./dll.d'
[dll] sane_init/read_dlld: attempting to open directory `/etc/sane.d/dll.d'
[dll] sane_init/read_dlld: opendir failed: No such file or directory
[dll] sane_init/read_config: reading dll.conf
[dll] add_backend: adding backend `brother4'
[dll] sane_get_devices
[dll] load: searching backend brother4' in
/usr/lib64/sane'
[dll] load: trying to load `/usr/lib64/sane/libsane-brother4.so.1'
**[dll] load: dlopen()ing `/usr/lib64/sane/libsane-brother4.so.1'**
[dll] init: initializing backend `brother4'
[dll] init: backend `brother4' is version 1.0.1
[dll] sane_get_devices: found 1 devices
device `brother4:bus2;dev1' is a Brother DCP-7055 USB scanner
[dll] sane_exit: exiting
[dll] sane_exit: calling backend `brother4's exit function
[dll] sane_exit: finished
So the question is now why Sane can't open libsane-brother.so.1 lib
even though it's in the correct path...
Note: The same scanner directly connected to my OpenSuse machine and with same drivers installed does show up when I run scanimage -L
so it must be working with sane, the onyl questionable thing here is the Pi.
Asked by Damir Porobic
(151 rep)
Jan 7, 2017, 06:01 PM
Last activity: Jun 8, 2022, 05:03 PM
Last activity: Jun 8, 2022, 05:03 PM