Brother MFC-9340CDW Duplex Scanning on Ubuntu 24.04


2024 Aug 10 - Brian Kloppenborg

Initial issue

I recently purchased a new computer and installed Ubuntu 24.04 on it. While everything appeared to be working correctly, I soon noticed that duplex (two sided) scanning on my Brother MFC-9340CDW printer was not working as expected. Despite having the “Both” option selected in simple-scan it only digitized a single size of each page.

Inspection

My first thought was that the jump from 22.04 to 24.04 may have resulted in some change in how my scanning software was accessing the scanner. On my 22.04 machine, I had two scanners: a “Brother MFC-9340CDW” and a “WDS Brother MFC-9340CDW”, but on my newer machine I only had the second option. After some research, I learned that my new machine is using airscan to locate its scanner, so the “WDS” variant must originate from there.

But where was the other scanner coming from? After some additional research, I found that my 22.04 machine had the brscan4 package installed, which is distributed by Brother itself. So I must have installed and configured that package at some point in the past. So the solution to my scanning issue must be quite simple: install and configure the brscan4 package, which it was!

But this got me wondering, why does brscan4 allow duplex scanning, but airscan does not? Running simple-scan --debug yielded some interesting results. On my 22.04 machine, which uses the correct drivers, I see the following output:

[+20.04s] DEBUG: scanner.vala:795: Option 4: name='source' title='Scan source' type=string size=64 values=["FlatBed", "Automatic Document Feeder(left aligned)", "Automatic Document Feeder(left aligned,Duplex)", "Automatic Document Feeder(centrally aligned)", "Automatic Document Feeder(centrally aligned,Duplex)"] cap=soft-select,soft-detect
...
[+20.04s] DEBUG: scanner.vala:602: sane_control_option (4, SANE_ACTION_SET_VALUE, source="Automatic Document Feeder(centrally aligned,Duplex)") -> (SANE_STATUS_GOOD, "Automatic Document Feeder(centrally aligned,Duplex)")

Whereas on my 24.04 machine which uses airscan’s WDS driver, I get the following

[+20.04s] DEBUG: scanner.vala:795: Option 4: name='source' title='Scan source' type=string size=64 values=["FlatBed", "ADF"] cap=soft-select,soft-detect
...
[+20.04s] DEBUG: scanner.vala:602: sane_control_option (4, SANE_ACTION_SET_VALUE, source="ADF") -> (SANE_STATUS_GOOD, "ADF")

so it appears that airscan’s WDS driver doesn’t pick up the document feeder. Why?

After putting airscan into trace mode, the issue became a bit more clear. The printer reports that it does NOT support duplex scanning, but that it has both a front side and back side scanning capability:

<wscn:ADF>
  <wscn:ADFSupportsDuplex>0</wscn:ADFSupportsDuplex>
  <wscn:ADFFront>
    <wscn:ADFOpticalResolution>
      <wscn:Width>1200</wscn:Width>
      <wscn:Height>600</wscn:Height>
    </wscn:ADFOpticalResolution>
    ...
  </wscn:ADFFront>
  <wscn:ADFBack>
    <wscn:ADFOpticalResolution>
      <wscn:Width>1200</wscn:Width>
      <wscn:Height>600</wscn:Height>
    </wscn:ADFOpticalResolution>
    ...
  </wscn:ADFBack>
</wscn:ADF>

Inspection of the corresponding source code shows that airscan expects the printer to have BOTH an ADF AND duplex support to support two-side scanning. Because the Brother MFC-9340CDW is a single-pass duplex scanner, that assumption is violated.

This issue has been reported to the sane-airscan developers under issue 346.

The solution

Until this issue is fixed upstream, the easiest way to get duplex scanning working again is to install the brscan4 package and configure it:

  1. Manually download and install the drivers for your brother printer.
  2. Install the drivers using gdebi or some other package manager.
  3. Manually set up the sane configuration for your printer using the brsaneconfig program:
sudo brsaneconfig4 -a name=MFC-9370CDW model=MFC-9370CDW ip=192.168.1.9
Tags:
Categories: