[sane-devel] New WIP open-source Brother backend

Jonathan Schulz jonathan.schulz at hotmail.de
Sun Sep 10 16:31:28 BST 2023


Dear all,

I have recently written a basic backend for my Brother DCP-L2500D all-in-one device (connected via USB). I am aware that the manufacturer provides a closed-source SANE backend, but I as far as I am aware, there are no binaries for arm64 linux. While I have tested my code with only one device, the manufacturer's driver suggests that the protocol is similar or identical for numerous similar devices.

I have also attempted to incorporate scanbd support via read-only properties, but I have run into some rather difficult issues (see below).

The (still unpolished!) code can be found here: https://github.com/jonschz/sane-backends/blob/master/backend/bropen.c (plus related bropen* files)

Furthermore, I have some beginner questions:
1. This backend may work on a lot of devices that I do not own and hence cannot test. What is the best way to go about this? I could make my backend detect those devices as well, but I don't know if that will have unintended side effects. In particular, I want to avoid any interference with interested users' installations of the manufacturer's closed-source drivers.
2. I keep getting weird issues when trying to run my backend from a scanbd script. Either it terminates early or I get a segfault. I do _not_ get issues when I run scanimage alone, and even running scanbd in the background (with the script disarmed) and running scanimage in the foreground works perfectly fine. Might do some further debugging in the future, right now I feel a bit stuck.

Here are some ideas I have for the future, in case there is interest here:
1. Right now, the scanned data are written to a file and then read back into memory. It would be preferable to do this all in memory. I did not have the time to look for an elegant solution for stream-decompressing JPEG (the device returns JPEG data for color).
2. Code formatting and other requirements by the SANE project.

Thanks in advance,

Jonathan




More information about the sane-devel mailing list