Xsane, network scanner, and MX23.1

I have realised, much too late, that the service saned is
not required to access a network scanner.
It is only needed if one has a usb or sata scanner attached to a computer , and one wishes to access it remotely from another computer… like a shared printer.

In my 2 distros in which xsane can access my scanner (mx21 and debian 11) I stopped saned and it made no difference, xsane could still access my scanner.

I then went to MX23, where xsane can not access my scanner
, stopped the saned daemon, and xsane still could not access my scanner. So saned is not required, but if present it does not interfere.

The solution lies elsewhere.

2 Likes

I used to install mine manually, but I got lazy and the last few times used the brother driver install tool. Its on their website where you download the drivers. Just tried it in my virtualbox MX23. It installed fine and I am able to scan and print. Mine is MFC-7840W it is also a network printer.

https://support.brother.com/g/b/downloadlist.aspx?c=us&lang=en&prod=mfc640cw_all&os=128

1 Like

If this helps: this is what it installed

2024-01-10 10:39:42 install libc6-i386:amd64 2.36-9+deb12u3
2024-01-10 10:39:42 install lib32gcc-s1:amd64 12.2.0-14
2024-01-10 10:39:42 install lib32stdc++6:amd64 12.2.0-14
2024-01-10 10:39:43 install brmfc7840wlpr:i386 2.0.2-1
2024-01-10 10:39:43 install cupswrappermfc7840w:i386 2.0.2-1
2024-01-10 10:40:56 install brscan3:amd64 0.2.13-1
2024-01-10 10:40:58 install brscan-skey:amd64 0.3.2-0
2024-01-10 10:41:00 install libusb-0.1-4:amd64 2:0.1.12-32

1 Like

Thanks Joel,
It is indeed possible that I messed up the manual install, although I have done it many times , and I have notes.

I will try the brother automatic install…
I notice that you have brscan3… I have brscan2… it may be that brscan2 has issues.
I used 64 bit driver for the scanner, and 32 bit for the printer… same as you. I did not install brscan-key… it is not essential.

Regards
Neville

1 Like

Hi @JoelA ,
I tried the brother automatic install… in Debian 12 in a VM.
It is the same as the manual install… Xsane fails to find the scanner device.

So I have to conclude that brscan2 has a problem with Debian 12 and derivatives, but brscan3 is OK.

I sent a note to Brother. Maybe they can pinpoint the problem.

Thank you
Neville

3 Likes

I have a SOLUTION !!!

One of the brother libraries /usr/lib64/sane/libsane-brother2.so.1.0.7
requires a version of libusb.so that is not present in my MX23

$ ldd /usr/lib64/sane/libsane-brother2.so.1.0.7 |more
	linux-vdso.so.1 (0x00007ffdf95f6000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f7e7247f000)
	libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007f7e72465000)
	libusb-0.1.so.4 => not found
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f7e72221000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f7e72460000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7e72040000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f7e7249a000)

Notice that libusb-0.1.so.4 is NOT FOUND.

What I have is an earlier version

nevj@trinity:/usr/lib/x86_64-linux-gnu
$ ls libusb*
libusb-1.0.so.0      libusbmuxd-2.0.so.6      libusbmuxd.so.6
libusb-1.0.so.0.3.0  libusbmuxd-2.0.so.6.0.0  libusbmuxd.so.6.0.0

So how do I get a later version?
Turns out there is a package

So lets install it

root@trinity:/common/Brother/debbrother# apt-get install libusb-0.1-4
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  libusb-0.1-4
0 upgraded, 1 newly installed, 0 to remove and 12 not upgraded.
Need to get 23.4 kB of archives.
After this operation, 59.4 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bookworm/main amd64 libusb-0.1-4 amd64 2:0.1.12-32 [23.4 kB]
Fetched 23.4 kB in 0s (96.0 kB/s)       
Selecting previously unselected package libusb-0.1-4:amd64.
(Reading database ... 423937 files and directories currently installed.)
Preparing to unpack .../libusb-0.1-4_2%3a0.1.12-32_amd64.deb ...
Unpacking libusb-0.1-4:amd64 (2:0.1.12-32) ...
Setting up libusb-0.1-4:amd64 (2:0.1.12-32) ...
Processing triggers for libc-bin (2.36-9+deb12u3) ...

So now I have 2 versions of libusb

nevj@trinity:/usr/lib/x86_64-linux-gnu
$ ls -l libusb*
lrwxrwxrwx 1 root root     19 May  5  2018 libusb-0.1.so.4 -> libusb-0.1.so.4.4.4
-rw-r--r-- 1 root root  31024 May  5  2018 libusb-0.1.so.4.4.4
lrwxrwxrwx 1 root root     19 Apr 11  2022 libusb-1.0.so.0 -> libusb-1.0.so.0.3.0
-rw-r--r-- 1 root root 121936 Apr 11  2022 libusb-1.0.so.0.3.0

That should be OK.
Now try xsane ( for the umpteenth time)
and it works

There is my xsane gui… just like in MX21.

End of issue… well not quite.
In the course of researching this, I found and followed the following Ubuntu discussion

One of the hints I tried (unsuccessfuly) was to add a udev rule for the brother scanner
I did this…

cd /lib/udev/rules.d
$ cat >  /lib/udev/rules.d/60-libsane-brother.rules
  ATTRS{idVendor}=="04f9", ENV{libsane_matched}="yes"
CTRL D

then reboot, and purge and reinstall the brother drivers.
It did nothing useful.
It is still there… I need to cleanup and check if it is necessary to have this as well as the missing library.

Thank you to those who made suggestions.

PS I checked back to MX21… it has the library libusb-0.1.so.4
So it looks to me like Debian has left behind that library, when it moved from Debian 11 to Debian 12. MX simply reflects the Debian situation.
I wonder what would have happened had I done an inline upgrade rather than a fresh install of the latest release?

4 Likes

The udev rule is unnecessary.
I did the whole thing again in Debian 12… without the udev rule…
just installing libusb-0.1-4… and xsane works.

In Void Linux, the situation was slightly different

$ ldd /usr/lib64/sane/libsane-brother2.so.1.0.7
        linux-vdso.so.1 (0x00007fff257ad000)
        libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007faa3a090000)
        libnsl.so.1 => /usr/lib/libnsl.so.1 (0x00007faa3a077000)
        libusb-0.1.so.4 => /usr/lib/libusb-0.1.so.4 (0x00007faa3a070000)
        libm.so.6 => /usr/lib/libm.so.6 (0x00007faa39e23000)
        libdl.so.2 => /usr/lib/libdl.so.2 (0x00007faa3a06b000)
        libc.so.6 => /usr/lib/libc.so.6 (0x00007faa39a00000)
        /usr/lib64/ld-linux-x86-64.so.2 (0x00007faa3a0a8000)

So Void has the libusb-0.1.so.4 library

$ ls -l libusb*
lrwxrwxrwx 1 root root     19 Jan  7  2023 libusb-0.1.so.4 -> libusb-0.1.so.4.4.4
-rwxr-xr-x 1 root root  22432 Jan  7  2023 libusb-0.1.so.4.4.4
-rw-r--r-- 1 root root 220218 Apr 13  2022 libusb-1.0.a
lrwxrwxrwx 1 root root     19 Apr 13  2022 libusb-1.0.so -> libusb-1.0.so.0.3.0
lrwxrwxrwx 1 root root     19 Apr 13  2022 libusb-1.0.so.0 -> libusb-1.0.so.0.3.0
-rwxr-xr-x 1 root root 120912 Apr 13  2022 libusb-1.0.so.0.3.0
-rw-r--r-- 1 root root  26322 Jan  7  2023 libusb.a
lrwxrwxrwx 1 root root     19 Jan  7  2023 libusb.so -> libusb-0.1.so.4.4.4

it is a link to libusb-0.1.so.4.4.4
but the package manager does not list it

$ xbps-query -Rs libusb

[*] libgusb-0.4.8_1                   GLib wrapper around libusb1
[*] libgusb-devel-0.4.8_1             GLib wrapper around libusb1 - developm...
[*] libusb-1.0.26_1                   Library which allows userspace access ...
[*] libusb-compat-0.1.8_1             libusb-0.1 compatibility library
[*] libusb-compat-devel-0.1.8_1       libusb-0.1 compatibility library - dev...
[*] libusb-devel-1.0.26_1             Library which allows userspace access .
.....

So it is an old package that has been removed from the Void repo.
No new install of Void would have it.
I had better archive that file carefully now, to future-proof scanning in Void.

I found this comment
“libusb-0.1-4 is in many ways a totally different library, and you can
keep that package installed without any conflict with a newer
libusb-1.* package.”

So it is OK to keep both versions of this library.

2 Likes

Thanks a million. I don’t use the scanner often anymore, so I dreaded the thought of having to buy a new one when it still works perfectly well.
Your discovery of the missing libusb-0.1.so.4 library also worked perfectly for my Brother DCP7010L on MX23. Your excellent detective work has saved me many hours of frustrating code searching. This collective effort is one of the big contributors to making Linux so enjoyable.

1 Like

Hi @Guadalix ,
Thanks for the feedback.
It may be worth keeping a private copy of libusb-0.1.so.4 in case it disappears from
Debian’s repo. It has already disappeared from the Void Linux repo.

Regards
Neville

2 Likes