[SOLVED] Brother MFC-L2730DW - Scanner Segfault (24-bit Mode Only)

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
martinch
Level 1
Level 1
Posts: 30
Joined: Thu Dec 28, 2017 3:50 pm

[SOLVED] Brother MFC-L2730DW - Scanner Segfault (24-bit Mode Only)

Post by martinch »

Hi guys,

My parents have a PC running Linux Mint 18.3 Cinnamon (64-bit, 4.13-26 kernel, fresh install), and have just purchased a Brother MFC-L2730DW multi-function device, which is connected via USB. Whilst it prints without problem, there is one issue with scanning.

When selecting the "24-bit" colour option, libsane-brother4.so.1.0.7 segfaults with the following in /var/log/syslog, almost immediately after requesting a scan or preview:

Code: Select all

Jan 21 13:07:48 LinuxMintPC kernel: [  738.461869] usb 3-9: usbfs: interface 0 claimed by usblp while 'xsane' sets config #1
Jan 21 13:07:48 LinuxMintPC kernel: [  738.461880] usb 3-9: usbfs: process 3908 (xsane) did not claim interface 1 before use
Jan 21 13:07:58 LinuxMintPC kernel: [  749.340537] xsane[3908]: segfault at 3ec ip 00007f4cf880f26f sp 00007ffef012c3d0 error 4 in libsane-brother4.so.1.0.7[7f4cf87fa000+25000]
If you choose the "24-bit [Fast]" option (which is the default), it works fine. Probably unsurprisingly, this is the case with Simple Scan and XSane.

I'm wondering if this is a config issue, and the 24-bit option shouldn't be being displayed - I set up the printer using Brother's automated install script, which produced the following error at the end:

Code: Select all

Setting up brscan-skey (0.2.4-1) ...
ls: cannot access '/etc/udev/rules.d/*.rules': No such file or directory
Hit Enter/Return key.
Despite what the above says, running ls /etc/udev/rules.d/ shows one file - 60-brother-libsane-type1-inst.rules.

I've tried to read through the install script source, but it's massive and a bit beyond my shell script reading abilities. I did find this post, which indicates that the last step output by the installer can be:

Code: Select all

brsaneconfig4 -a name=<name> model=<model> ip=<ip>
Part of me wonders if I should just run brsaneconfig4, although I'm not sure what the ip parameter should be, given that it's USB connected..? I did have a rummage around the files in /etc/opt/brother/scanner/brscan4 and /etc/opt/brother/scanner/brscan-skey, but there wasn't anything which looked obvious to me.

Any ideas?

Thanks!

P.S. Full output from the installer:

Code: Select all

user@LinuxMintPC ~/Downloads/Drivers/Brother/MFC-L2730DW $ sudo ./linux-brprinter-installer-2.2.0-1 
[sudo] password for user: 
Input model name ->MFC-L2730DW

You are going to install following packages.
   mfcl2730dwpdrv-4.0.0-1.i386.deb
   brscan4-0.4.4-3.amd64.deb
   brscan-skey-0.2.4-1.amd64.deb
OK? [y/N] ->y

dpkg -x mfcl2730dwpdrv-4.0.0-1.i386.deb /
dpkg-deb: building package 'mfcl2730dwpdrv' in 'mfcl2730dwpdrv-4.0.0-1a.i386.deb'.
dpkg -b ./brother_driver_packdir mfcl2730dwpdrv-4.0.0-1a.i386.deb
dpkg -i --force-all mfcl2730dwpdrv-4.0.0-1a.i386.deb
Selecting previously unselected package mfcl2730dwpdrv:i386.
(Reading database ... 241850 files and directories currently installed.)
Preparing to unpack mfcl2730dwpdrv-4.0.0-1a.i386.deb ...
Unpacking mfcl2730dwpdrv:i386 (4.0.0-1) ...
Setting up mfcl2730dwpdrv:i386 (4.0.0-1) ...
lpadmin -p MFCL2730DW -E -v usb://Brother/MFC-L2730DW%20series?serial=Redacted -P /usr/share/ppd/brother/brother-MFCL2730DW-cups-en.ppd
#
Will you specify the Device URI? [Y/n] ->n

Test Print? [y/N] ->y

wait 5s.
lpr -P MFCL2730DW /usr/share/cups/data/testprint
You are going to install following packages.
   brscan4-0.4.4-3.amd64.deb

=========================================
Brother License Agreement

<snip!>
=========================================
Do you agree? [Y/n] ->y

wget -T 10 -nd --no-cache http://www.brother.com/pub/bsc/linux/packages/brscan4-0.4.4-3.amd64.deb
--2018-01-21 12:29:49--  http://www.brother.com/pub/bsc/linux/packages/brscan4-0.4.4-3.amd64.deb
Resolving www.brother.com (www.brother.com)... 213.123.252.41, 213.123.252.83
Connecting to www.brother.com (www.brother.com)|213.123.252.41|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 74110 (72K) [text/plain]
Saving to: ‘brscan4-0.4.4-3.amd64.deb’

brscan4-0.4.4-3.amd 100%[===================>]  72.37K  --.-KB/s    in 0.03s   

2018-01-21 12:29:49 (2.42 MB/s) - ‘brscan4-0.4.4-3.amd64.deb’ saved [74110/74110]

dpkg -i --force-all brscan4-0.4.4-3.amd64.deb
Selecting previously unselected package brscan4.
(Reading database ... 241883 files and directories currently installed.)
Preparing to unpack brscan4-0.4.4-3.amd64.deb ...
Unpacking brscan4 (0.4.4-3) ...
Setting up brscan4 (0.4.4-3) ...
This software is based in part on the work of the Independent JPEG Group.
You are going to install following packages.
   brscan-skey-0.2.4-1.amd64.deb
dpkg -i --force-all brscan-skey-0.2.4-1.amd64.deb
Selecting previously unselected package brscan-skey.
(Reading database ... 241923 files and directories currently installed.)
Preparing to unpack brscan-skey-0.2.4-1.amd64.deb ...
Unpacking brscan-skey (0.2.4-1) ...
Setting up brscan-skey (0.2.4-1) ...
ls: cannot access '/etc/udev/rules.d/*.rules': No such file or directory
Hit Enter/Return key.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
deepakdeshp
Level 20
Level 20
Posts: 12334
Joined: Sun Aug 09, 2015 10:00 am

Re: Brother MFC-L2730DW - Scanner Segfault (24-bit Mode Only)

Post by deepakdeshp »

If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help.
Regards,
Deepak

Mint 21.1 Cinnamon 64 bit with AMD A6 / 8GB
Mint 21.1 Cinnamon AMD Ryzen3500U/8gb
deepakdeshp
Level 20
Level 20
Posts: 12334
Joined: Sun Aug 09, 2015 10:00 am

Re: Brother MFC-L2730DW - Scanner Segfault (24-bit Mode Only)

Post by deepakdeshp »

If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help.
Regards,
Deepak

Mint 21.1 Cinnamon 64 bit with AMD A6 / 8GB
Mint 21.1 Cinnamon AMD Ryzen3500U/8gb
martinch
Level 1
Level 1
Posts: 30
Joined: Thu Dec 28, 2017 3:50 pm

Re: Brother MFC-L2730DW - Scanner Segfault (24-bit Mode Only)

Post by martinch »

I've done a bit more digging/prodding - brscan-skey -l doesn't list the device, and using the "scan to file" option on the printer touch screen doesn't appear to work - the printer just "hangs" when trying to connect via USB (I gave up waiting after about 10s and cancelled it). Whilst Brother's documentation says UDP 54925 (in) and TCP 54921 (out) need to be open, I don't think this should be an issue given it was connected directly to the PC via USB? In any case, just to be sure, I'd disabled ufw (nothing appeared in /var/log/syslog, anyway).
Thanks - although I'd already read that, I'd not edited 60-libsane.rules nor created the sym-links due to misreading a couple of things and thinking they were unnecessary- doh! I've added the specified line to /lib/udev/rules.d/0-libsane.rules, and sym-linked /usr/lib64/sane/* to /usr/lib/sane/, but it hasn't made a difference.
deepakdeshp wrote:viewtopic.php?t=116639
Unless I'm missing something, that seems to address print functionality, not scanning issues?

Just to be clear, printing works fine whichever option I pick. Scanning from XSane works as long as I don't select the "24-bit" option - every other colour depth option works. If I select "24 bit", then it crashes towards the end of scanning a preview with a segfault in libsane-brother4.so.1.0.7 being logged in /var/log/syslog.
User avatar
Arch_Enemy
Level 6
Level 6
Posts: 1491
Joined: Tue Apr 26, 2016 3:28 pm

Re: Brother MFC-L2730DW - Scanner Segfault (24-bit Mode Only)

Post by Arch_Enemy »

martinch wrote:I've done a bit more digging/prodding - brscan-skey -l doesn't list the device, and using the "scan to file" option on the printer touch screen doesn't appear to work - the printer just "hangs" when trying to connect via USB (I gave up waiting after about 10s and cancelled it). Whilst Brother's documentation says UDP 54925 (in) and TCP 54921 (out) need to be open, I don't think this should be an issue given it was connected directly to the PC via USB? In any case, just to be sure, I'd disabled ufw (nothing appeared in /var/log/syslog, anyway).
Thanks - although I'd already read that, I'd not edited 60-libsane.rules nor created the sym-links due to misreading a couple of things and thinking they were unnecessary- doh! I've added the specified line to /lib/udev/rules.d/0-libsane.rules, and sym-linked /usr/lib64/sane/* to /usr/lib/sane/, but it hasn't made a difference.
deepakdeshp wrote:viewtopic.php?t=116639
Unless I'm missing something, that seems to address print functionality, not scanning issues?

Just to be clear, printing works fine whichever option I pick. Scanning from XSane works as long as I don't select the "24-bit" option - every other colour depth option works. If I select "24 bit", then it crashes towards the end of scanning a preview with a segfault in libsane-brother4.so.1.0.7 being logged in /var/log/syslog.
If you're connected by USB, ignore the IP stuff completely.
Scan to file appears to only work if you have Brother's Windows software installed (on a Windows computer, of course). You can also re-enable UFW, it has no bearing on USB connections.

Best thing I can suggest is to reload the Brother software (see if there is an update first) and start over. Have the printer ON and NO 'asleep' so it is active when reinstalling and it should find it no problem. You'll have to invoke XSANE or simplescan to access the scanner; using the front panel isn't implemented in the Linux drivers. Or, at least, it wasn't...I haven't looked at Brother's site for quite a while, since my MFC is working just fine as is. ;)

And, I just did a photo scan at 24 Bits at 1200DPI, no probs. You'll have to isolate whether the issues is with Brother's driver or XSane; you can load simple scan and see what it does there. If it's isolated to XSane, completely remove and reinstall it.
I have travelled 37629424162.9 miles in my lifetime

One thing I would suggest, create a partition as a 50G partition as /. Partition the rest as /Home. IF the system fails, reinstall and use the exact same username and all your 'stuff' comes back to you.
martinch
Level 1
Level 1
Posts: 30
Joined: Thu Dec 28, 2017 3:50 pm

Re: Brother MFC-L2730DW - Scanner Segfault (24-bit Mode Only)

Post by martinch »

Arch_Enemy wrote:If you're connected by USB, ignore the IP stuff completely.
I too couldn't see a reason why it would be relevant (as I couldn't see a reason for it touching the network interfaces, unless brscan-skey is doing something weird like pushing the received data back through localhost) - I was clutching at straws and trying to remove any possibility of interference at that point! Naturally, ufw is back on, and the network lead's been put back now. :)
Arch_Enemy wrote:Scan to file appears to only work if you have Brother's Windows software installed (on a Windows computer, of course)
They make an application that replicates the function in Linux (scan-key-tool aka brscan-skey). it needs to be run at the start of every session, though (the installer doesn't seem to add it to the auto-runs list for some reason). :)
Arch_Enemy wrote:Best thing I can suggest is to reload the Brother software (see if there is an update first) and start over. Have the printer ON and NO 'asleep' so it is active when reinstalling and it should find it no problem.
I may well give that a go (I'd be surprised if there was an update, given I downloaded it last weekend ... lol) ... I did e-mail Brother to see if they have any ideas, too (worth a shot).
Arch_Enemy wrote:And, I just did a photo scan at 24 Bits at 1200DPI, no probs.
"24-bit [Fast]" works fine for me, it's just plain "24 bit" that falls over. It's almost as though the drivers wanted to expose "24-bit [fast]" as "24-bit" ...
Arch_Enemy wrote:you can load simple scan and see what it does there
Simple Scan is unusable as it falls over every time with a segfault being logged in /var/log/syslog (I can't see a way of telling it which colour depth setting to use).
User avatar
Arch_Enemy
Level 6
Level 6
Posts: 1491
Joined: Tue Apr 26, 2016 3:28 pm

Re: Brother MFC-L2730DW - Scanner Segfault (24-bit Mode Only)

Post by Arch_Enemy »

I think the problem is with your driver. I did a 24 bit 1200DPi scan with my MFC before I logged on today, No Prob. After reading your initial post I did it again with Simple Scan, no prob. I went to Brother's web site and saw they updated the software in December, so I took a gamble and loaded up. I just this minute did another scan with Simple Scan of the same photo, which is a full-page 8x10 colour photo, at 1200DPi at 24 bits. No prob.

You can uninstall the driver using Brother's uninstall utility, that will be found in the directory you used to install the driver. You can also do it in Synaptic, but I would do it from Brother's utility first, then check Synaptic and see if it's still there, and then use Synaptic as well. Then reinstall using the updated install utility.

Interesting note, however. I already had Brother Scan Key installed, but I reinstalled it. It says you have to have GiMP installed, which I use for photo processing anyway, and no joy. After looking at the disclaimer that you have to have the 2 ports open in your firewall, I guess it means the scan key will only work if you are connected through the network. Don't know why it wouldn't work through USB, but I tired different ways to do it and it always stuck at "Connecting to computer", perhaps an indication it wanted to go through WiFi.
I have travelled 37629424162.9 miles in my lifetime

One thing I would suggest, create a partition as a 50G partition as /. Partition the rest as /Home. IF the system fails, reinstall and use the exact same username and all your 'stuff' comes back to you.
martinch
Level 1
Level 1
Posts: 30
Joined: Thu Dec 28, 2017 3:50 pm

Re: Brother MFC-L2730DW - Scanner Segfault (24-bit Mode Only)

Post by martinch »

Sorry for the tardy reply - been meaning to write one, but work got in the way :(
Arch_Enemy wrote:I think the problem is with your driver.
Agreed, either the driver's a bit off, or there's some final config missing.
Arch_Enemy wrote:I did a 24 bit 1200DPi scan with my MFC before I logged on today, No Prob ... I just this minute did another scan with Simple Scan of the same photo, which is a full-page 8x10 colour photo, at 1200DPi at 24 bits. No prob.

Good to know :) (and thanks for going to that effort! :D)
Arch_Enemy wrote:You can uninstall the driver using Brother's uninstall utility ... Then reinstall using the updated install utility.
Will give it a go at the weekend. :)
Arch_Enemy wrote:I already had Brother Scan Key installed ... and no joy. ... Don't know why it wouldn't work through USB, but I tired different ways to do it and it always stuck at "Connecting to computer", perhaps an indication it wanted to go through WiFi.
:( Well, at least it's not just me then! :)
martinch
Level 1
Level 1
Posts: 30
Joined: Thu Dec 28, 2017 3:50 pm

Re: Brother MFC-L2730DW - Scanner Segfault (24-bit Mode Only)

Post by martinch »

Well, I finally got it fully working. The short version is that the automated installer was pulling down the wrong version of the scanner driver package - a more detailed explanation follows.

After staring at the installer output for about the tenth time, I noticed that it was trying to install "brscan4-0.4.4-3.amd64.deb", but the file listed for manual download was "brscan4-0.4.4-4.amd64.deb". Whilst it's probably quite likely that I could just have run dpkg on the updated scanner driver package, I thought it might be better to go through the installer script, as it looks like it's doing some extra steps.

Working through the installer script, it fetches a file from Brother's web site (of the form http://www.brother.com/pub/bsc/linux/infs/<model without dash>), which tells it which files to grab. Looking at what Brother's site returns for brscan4 models, it lists the old version of the package. I updated this block in the install script (around line 900):

Code: Select all

    if [ "$SCANNER_LNK" != '' ];then
      if [ "$arch" = 'i386' ];then        
        SCANFILE=$(grep "DEB32=" ${wkdir}/"$SCANNER_LNK" | sed s/"DEB32="//g )        
      else                    
        SCANFILE=$(grep "DEB64=" ${wkdir}/"$SCANNER_LNK" | sed s/"DEB64="//g )
      fi
    fi
to

Code: Select all

    if [ "$SCANNER_LNK" != '' ];then
      if [ "$arch" = 'i386' ];then        
        SCANFILE=$(echo "DEB32=brscan4-0.4.4-4.i386.deb" | grep "DEB32=" | sed s/"DEB32="//g )
      else            
        SCANFILE=$(echo "DEB64=brscan4-0.4.4-4.amd64.deb" | grep "DEB64=" | sed s/"DEB64="//g )
      fi
    fi
and then re-ran the install script.

Before running the above, I tested it on a VM. One thing I did notice, was that it was 404'ing when trying to download the printer driver file. It turns out if you manually download the driver and put it in the same directory as the installer, it doesn't try to download it (which is why I didn't experience this when I initially installed the printer, as I downloaded everything).

Having updated the driver, the "24-bit" colour depth option no longer appears in XSane (only "24-bit [Fast]"). One thing to note: I hadn't undone the "symlink /usr/lib64/sane/ to /usr/lib/sane/" step listed on the Easy Linux Project article from before - this may or may not be necessary.

So, to sum up:
  • The install script gets what to install from Brother's site. For the printer driver, this is a 404, and for the scanner driver, this is stale by 1 revision.
  • If the install script can't download a file, manually downloading the file and putting it in the same directory will stop it trying to wget it.
  • Scanning works in Simple Scan and XSane, and displays "24-bit [Fast]" instead of "24-bit"
  • Scan-to-file from the printer works over USB (output to /home/<user>/brscan/, if memory serves), and brscan-skey -l detects the scanner.
  • You may need to symlink /usr/lib/lib64/sane/ to /usr/lib/lib/sane/
Hopefully the above is of help to someone in the future! (and thanks to those who helped, especially Arch_Enemy!)
User avatar
Pjotr
Level 23
Level 23
Posts: 19927
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: [SOLVED] Brother MFC-L2730DW - Scanner Segfault (24-bit Mode Only)

Post by Pjotr »

Good that you've solved it. You might want to contact Brother about this, because apparently they should update their installer script....
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
martinch
Level 1
Level 1
Posts: 30
Joined: Thu Dec 28, 2017 3:50 pm

Re: [SOLVED] Brother MFC-L2730DW - Scanner Segfault (24-bit Mode Only)

Post by martinch »

Pjotr wrote:Good that you've solved it. You might want to contact Brother about this, because apparently they should update their installer script....
Already on that :)
User avatar
Arch_Enemy
Level 6
Level 6
Posts: 1491
Joined: Tue Apr 26, 2016 3:28 pm

Re: [SOLVED] Brother MFC-L2730DW - Scanner Segfault (24-bit Mode Only)

Post by Arch_Enemy »

martinch wrote: Sun Feb 04, 2018 8:13 am
Pjotr wrote:Good that you've solved it. You might want to contact Brother about this, because apparently they should update their installer script....
Already on that :)
AH! Thank YOU! Nice find with the driver revision. I reinstalled it when you started this thread, and when I read your last post I looked in the Brother directory and there was .3 sitting there. I changed the install script, reran the installation and tried again. I have a scan key! BTW, the installer DID create the sym links when it ran.

Thank you! I sure wish Canon would resume Linux drivers. The reasons I bought the Brother were it has a 100 page paper tray, the scanner was listed in SANE's database, and it was CHEAP! It's been 4 years now, and it still chugs away. It spent 3 years printing work orders, at a pace of up to 10 a day. I was a Dell Field Service tech, and also did safes and ATMs and wanted a simple, quick printer to print the tickets. This did everything I needed, and has proved reliable and cost effective. The only thing is, as a photo printer, it isn't so hot. It's good for 'proofs', and prints them quickly, but for photo quality I like my Canons...but have to boot to Windows.

I tried TurboPrint..on Arch. It didn't work very well with the Pro-100, and when I did that 5th update...borked my system again and that's when I came back to Mint. I never contacted TurboPrint to see if I could get another key, basically because I was not impressed with the print quality.
I have travelled 37629424162.9 miles in my lifetime

One thing I would suggest, create a partition as a 50G partition as /. Partition the rest as /Home. IF the system fails, reinstall and use the exact same username and all your 'stuff' comes back to you.
martinch
Level 1
Level 1
Posts: 30
Joined: Thu Dec 28, 2017 3:50 pm

Re: [SOLVED] Brother MFC-L2730DW - Scanner Segfault (24-bit Mode Only)

Post by martinch »

Arch_Enemy wrote: Wed Feb 07, 2018 12:00 pmAH! Thank YOU! Nice find with the driver revision ... I have a scan key!
You're welcome - it's good to know that I managed to help someone, as it feels like I've managed to put something back in to the forums :)
Arch_Enemy wrote: Wed Feb 07, 2018 12:00 pmBTW, the installer DID create the sym links when it ran.
Good to know! :)
Arch_Enemy wrote: Wed Feb 07, 2018 12:00 pmI sure wish Canon would resume Linux drivers.
I thought they provided basic drivers, but their policy was that wouldn't provide any actual support if you asked them a question about them?
Arch_Enemy wrote: Wed Feb 07, 2018 12:00 pmIt's been 4 years now, and it still chugs away. It spent 3 years printing work orders, at a pace of up to 10 a day ... The only thing is, as a photo printer, it isn't so hot. It's good for 'proofs', and prints them quickly, but for photo quality I like my Canons...but have to boot to Windows.
Yeah, Brother's stuff's always had a reputation for producing solid (but not stellar) output, but being reliable and cheap to run (which, I'm guessing, is a compromise most people will be willing to make!). Having said that, I was surprised how good the black-and-white image output was on my parent's MFC-L2730 (possibly a bit "crunchy" on the blacks, but no discernible banding, etc). Canon's photo printers have always had a very good reputation, although so have EPSON and HP (my EPSON R800 has been excellent and worked out about the same cost as lab prints for A4s, although it is expensive to refill, and one of my colleagues swears by their HP). :)
User avatar
Arch_Enemy
Level 6
Level 6
Posts: 1491
Joined: Tue Apr 26, 2016 3:28 pm

Re: [SOLVED] Brother MFC-L2730DW - Scanner Segfault (24-bit Mode Only)

Post by Arch_Enemy »

martinch wrote: Thu Feb 08, 2018 1:01 pm
Yeah, Brother's stuff's always had a reputation for producing solid (but not stellar) output, but being reliable and cheap to run (which, I'm guessing, is a compromise most people will be willing to make!). Having said that, I was surprised how good the black-and-white image output was on my parent's MFC-L2730 (possibly a bit "crunchy" on the blacks, but no discernible banding, etc). Canon's photo printers have always had a very good reputation, although so have EPSON and HP (my EPSON R800 has been excellent and worked out about the same cost as lab prints for A4s, although it is expensive to refill, and one of my colleagues swears by their HP). :)
I have an R800 I bought used as well, but I never tried it because of the cost of the dyes. I also have an HP I bought used; I should connect it and see how (if!) it works, but I already have 4 printers queued up now! Maybe if the iP6700 stops functioning (it has been having "issues" recently...dang, it's only been ~12 years!) the HP Photosmart will take over. But the Pro-100 and the 6700 have separate ink tanks. I think the HP does as well...but Canon's ink is better.
I have travelled 37629424162.9 miles in my lifetime

One thing I would suggest, create a partition as a 50G partition as /. Partition the rest as /Home. IF the system fails, reinstall and use the exact same username and all your 'stuff' comes back to you.
Locked

Return to “Printers & Scanners”