<div dir="ltr"><div>Hi,</div><div>This is a difficult one. Interfaces with the backends are fairly simple. I wasn't involved when this was formulated but I assume that the simplicity is deliberate on purpose to keep it flexible.</div><div><br></div><div>Generally, I find that this error is returned from a lower level operation not working as intended. Some of the backends are quite complex and nuance in the reporting back of issues is often not really possible. SANE_STATUS_INVAL is a case in point. It could mean practically anything.<br></div><div><br></div><div>If could be that we could expand the API somewhat to allow more verbose reporting from a backend through a new function call. However, although we could expand what such as the DLL layer can report back, it would be a bit of work adding that in. Also it is unlikely that backends would be updated to make of it, at least in the short term. Many of our backends don't even have maintainers.</div><div><br></div><div>Cheers,</div><div>Ralph<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Nov 24, 2024 at 7:15 AM G.W. Haywood <<a href="mailto:sane-devel@jubileegroup.co.uk">sane-devel@jubileegroup.co.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi there,<br>
<br>
We have a HP M1522n all-in-one printer which has been in continual use<br>
for both printing and scanning for about the past fifteen years. It's<br>
connected (only) to our LAN with a static IP in the 192.168.x.x range.<br>
<br>
All the workstations on our network are Linux boxes. Most of the time<br>
we use the simple-scan front end, but occasionally I'll use scanimage<br>
at the command line.<br>
<br>
Years ago when I first set up networking for the HP I did it manually.<br>
I lied about the gateway - gave it a nonexistent IP - so it can't talk<br>
to the Internet even if it tries. It's been that way ever since.<br>
Originally I used the HP-supplied software for Linux. Life was good.<br>
<br>
After I upgraded to Debian Buster the scanner stopped responding.<br>
Printing continued to work just fine. After much ado I installed<br>
'airprint', and it started responding to scan requests once more.<br>
Never did find out why hpaio: stopped working.<br>
<br>
This time I upgraded to Bullseye. Printing was still OK but the<br>
scanner wasn't found by scanimage -L. The scanning system resisted<br>
several weeks of intermittent attempts to kick it into life.<br>
<br>
Finally I tracked down the problem to an apparently damaged shared<br>
library. No idea what caused the damage. It was simple to rectify by<br>
a reinstall (and curiously enough hpaio: started working again, but I<br>
guess that's down to something in the Bullseye upgrade). But it was<br>
almost by accident that I found the problem, and it took a long time.<br>
<br>
I'm not really satisfied with that.<br>
<br>
The debug file output is below at [***]. The docs at<br>
<br>
<a href="http://www.sane-project.org/html/doc012.html" rel="noreferrer" target="_blank">http://www.sane-project.org/html/doc012.html</a><br>
<br>
seem to deny that what it contains is possible. Specfically, section<br>
4.3.4 (sane_open) claims that the possible returned values are:<br>
<br>
SANE_STATUS_DEVICE_BUSY<br>
SANE_STATUS_INVAL<br>
SANE_STATUS_IO_ERROR<br>
SANE_STATUS_NO_MEM<br>
SANE_STATUS_ACCESS_DENIED<br>
<br>
but the returned value that I saw in the debug output from the command<br>
<br>
8<----------------------------------------------------------------------8<----------------------------------------------------------------------<br>
$ /usr/bin/simple-scan hpaio:/net/HP_LaserJet_M1522n_MFP?ip=192.168.44.169<br>
8<----------------------------------------------------------------------8<----------------------------------------------------------------------<br>
<br>
(output written into the file ~/.cache/simple-scan/simple-scan.log) is<br>
<br>
SANE_STATUS_UNSUPPORTED<br>
<br>
at +8.12s in the output.<br>
<br>
[***] The entire log file output: [***]<br>
8<----------------------------------------------------------------------8<----------------------------------------------------------------------<br>
[+0.05s] DEBUG: simple-scan.vala:2012: Starting /usr/bin/simple-scan 3.38.1, PID=2919927<br>
[+0.06s] DEBUG: unsetenv() is not thread-safe and should not be used after threads are created<br>
[+0.08s] DEBUG: _g_io_module_get_default: Found default implementation gvfs (GDaemonVfs) for ‘gio-vfs’<br>
[+0.18s] DEBUG: _g_io_module_get_default: Found default implementation dconf (DConfSettingsBackend) for ‘gsettings-backend’<br>
[+0.29s] DEBUG: app-window.vala:1990: Loading state from /home/ged/.cache/simple-scan/state<br>
[+0.30s] DEBUG: app-window.vala:1969: Restoring window to 1590x844 pixels<br>
[+0.46s] DEBUG: scanner.vala:1548: sane_init () -> SANE_STATUS_GOOD<br>
[+0.46s] DEBUG: scanner.vala:1554: SANE version 1.0.31<br>
[+0.46s] DEBUG: scanner.vala:1615: Requesting redetection of scan devices<br>
[+0.46s] DEBUG: scanner.vala:828: Processing request<br>
[+0.55s] DEBUG: app-window.vala:2065: Saving state to /home/ged/.cache/simple-scan/state<br>
[+0.75s] DEBUG: app-window.vala:2065: Saving state to /home/ged/.cache/simple-scan/state<br>
[+6.72s] DEBUG: app-window.vala:2065: Saving state to /home/ged/.cache/simple-scan/state<br>
[+7.08s] DEBUG: simple-scan.vala:1817: Requesting scan at 300 dpi from device 'hpaio:/net/HP_LaserJet_M1522n_MFP?ip=192.168.44.169'<br>
[+7.08s] DEBUG: scanner.vala:1683: Scanner.scan ("hpaio:/net/HP_LaserJet_M1522n_MFP?ip=192.168.44.169", dpi=300, scan_mode=ScanMode.GRAY, depth=2, type=single, paper_width=0, paper_height=0, brightness=0, contrast=48, delay=3000ms)<br>
[+7.41s] DEBUG: app-window.vala:2065: Saving state to /home/ged/.cache/simple-scan/state<br>
[+7.91s] DEBUG: app-window.vala:2065: Saving state to /home/ged/.cache/simple-scan/state<br>
[+8.12s] DEBUG: scanner.vala:341: sane_get_devices () -> SANE_STATUS_GOOD<br>
[+8.12s] DEBUG: scanner.vala:828: Processing request<br>
[+8.12s] DEBUG: scanner.vala:889: sane_open ("hpaio:/net/HP_LaserJet_M1522n_MFP?ip=192.168.44.169") -> SANE_STATUS_UNSUPPORTED<br>
[+8.12s] WARNING: scanner.vala:893: Unable to open device: Operation not supported<br>
[+8.28s] DEBUG: app-window.vala:2065: Saving state to /home/ged/.cache/simple-scan/state<br>
[+8.50s] DEBUG: app-window.vala:2065: Saving state to /home/ged/.cache/simple-scan/state<br>
[+11.75s] DEBUG: autosave-manager.vala:201: Deleting autosave records<br>
[+11.76s] DEBUG: scanner.vala:1711: Stopping scan thread<br>
[+11.76s] DEBUG: scanner.vala:828: Processing request<br>
[+11.86s] DEBUG: scanner.vala:1722: sane_exit ()<br>
8<----------------------------------------------------------------------8<----------------------------------------------------------------------<br>
<br>
It wasn't until I came across a post on some forum which suggested<br>
setting the environment variable SANE_DEBUG_DLL to 255 that I found<br>
this output on the *terminal*, not in the file:<br>
<br>
8<----------------------------------------------------------------------8<----------------------------------------------------------------------<br>
zeroconf: ZEROCONF_MDNS_HINT: initial scan finished<br>
zeroconf: device_list wait: OK<br>
zeroconf: zeroconf_device_list_get: building list of devices<br>
zeroconf: zeroconf_device_list_get: resulting list:<br>
API: sane_get_devices(): done<br>
[16:36:47.074438] [dll] load: searching backend `hpaio' in `/usr/lib/aarch64-linux-gnu/sane:/usr/lib/sane:/usr/lib64/sane'<br>
[16:36:47.074509] [dll] load: trying to load `/usr/lib/aarch64-linux-gnu/sane/libsane-hpaio.so.1'<br>
[16:36:47.074582] [dll] load: dlopen()ing `/usr/lib/aarch64-linux-gnu/sane/libsane-hpaio.so.1'<br>
[16:36:47.075651] [dll] load: dlopen() failed (/lib/aarch64-linux-gnu/libhpip.so.0: invalid ELF header)<br>
[16:36:47.075723] [dll] sane_get_devices: found 0 devices<br>
[16:36:47.075903] [dll] sane_open: trying to open `hpaio://net/HP_LaserJet_M1522n_MFP?ip=192.168.44.169'<br>
[16:36:47.075988] [dll] init: initializing backend `hpaio'<br>
[16:36:47.076016] [dll] op_unsupported: call to unsupported backend operation<br>
WSDD: 2001:470:6976:44:96bb:293b:bae0:63b9: done discovery<br>
WSDD: <a href="http://192.168.44.15" rel="noreferrer" target="_blank">192.168.44.15</a>: done discovery<br>
WSDD: fe80::722b:79fb:927e:f503: done discovery<br>
zeroconf: ZEROCONF_WSD: initial scan finished<br>
[16:36:50.017799] [dll] sane_exit: exiting<br>
8<----------------------------------------------------------------------8<----------------------------------------------------------------------<br>
<br>
It seems to me that the log file content could have been a bit more<br>
forthcoming. The notion of "operation unsupported" is to me very<br>
different from that of "broken shared object".<br>
<br>
Did I miss something obvious?<br>
<br>
Could the error message in the log file conveniently be improved? It<br>
would have saved me a *lot* of effort if it had mentioned the broken<br>
shared object file.<br>
<br>
-- <br>
<br>
73,<br>
Ged.</blockquote></div>