I installed SANE backend (hardware.sane.enable = true; on NixOS) and tested if my scanner is detected by running scanimage -L (as suggested here https://nixos.wiki/wiki/Scanners).
Interestingly, the first time I run this command, I can see my scanner (and my webcam):
$ scanimage -L
device `xerox_mfp:libusb:001:012' is a Samsung Samsung SCX-3200 Series multi-function peripheral
device `v4l:/dev/video0' is a Noname HP HD Camera virtual device
but the next time I run it, I only see my webcam:
$ scanimage -L
device `v4l:/dev/video0' is a Noname HP HD Camera virtual device
I only have to unplug and replug the USB connection to see it again (only once).
I have tried using simple-scan to scan a document but I get a similar experience (I can see the scanner only if I just plug it in without testing the connection with scanimage -L but in any case, the application doesn't manage to scan even just a page).
I thought it may be the same issue as in https://unix.stackexchange.com/a/191816/115070 so I disabled USB autosuspend using TLP, I can see that it has been taken into account:
$ tlp-stat -u
--- TLP 1.0 --------------------------------------------
+++ USB
Autosuspend = disabled
but this doesn't help actually.
Update: lsusb
The scanner is always visible with lsusb:
Bus 001 Device 006: ID 04e8:3441 Samsung Electronics Co., Ltd
Update: sane-find-scanner
The scanner is always visible with sane-find-scanner (in normal mode or in sudo mode):
found USB scanner (vendor=0x04e8 [Samsung Electronics Co., Ltd.], product=0x3441 [SCX-3200 Series]) at libusb:001:005
# Your USB scanner was (probably) detected. It may or may not be supported by
# SANE. Try scanimage -L and read the backend's manpage.
Update: permissions
scanimage -L behaves the same in normal and sudo mode. It detects the scanner only the first time after plugging / restarting, including across modes (normal then sudo or sudo then normal).
Update: searching the mailing list and commit history
It really looks like the issue is just that the scanner is unsupported (see https://www.mail-archive.com/[email protected]/msg34458.html in particular). I'm just a bit surprised with the behavior of scanimage -L in this case. It would have been less confusing if it was never detected.
Important update: works on another laptop
It looks like the problem doesn't come from a lack of support after all.
I have tested the SANE backend with the same scanner and an older laptop (Dell Latitude E6500). It works perfectly well with scanimage -L and simple-scan.
Given the lack of difference in the way I configured the two laptops, I can only assume that the problem I was having on my first laptop (HP EliteBook Folio 1040 G3 Notebook PC) is a hardware problem.