Closed vklachkov closed 6 months ago
Hi @zgdump,
first of all, I need to see protocol traces (and the same for #332 too). To obtain them, in the /etc/sane.d/airscan.conf
uncomment the following lines:
[debug]
trace = ~/airscan/trace
The ~/airscan/trace
will be created automatically and traces will be written there. For now I only need *.log
files, but not *.tar
.
P.S. Are you just a regular user, or you work for some distro?
@alexpevzner
I'm regular user.
Command:
$ scanimage -v --device-name="airscan:e0:HP_Laser_MFP_135wr" --mode color --format=jpeg --output="output.jpeg"
Logs:
I also tried using HTTP instead of HTTPS, replacing https://192.168.1.121:443/eSCL
with http://192.168.1.121/eSCL
, but although this speed up scan by 2 secs, it didn't fix the problem.
Hi @zgdump
sane_open
in your log takes few milliseconds. Typically it is fast, but if it is called very early, it may block waiting for device discovery completion, which may take, depending on circumstances, up to 5 seconds (starting from the driver initialization), but in most cases takes less time. Please note, discovery starts as soon as driver is loaded, so on many cases at the time sane_open
is called, discovery already completed.
sane_read()
, in blocking mode, will wait until scanning is finished and the whole image is downloaded. Depending on device and scan resolution it may take a lot of time. Please note, there is a non-blocking mode of the sane_read()
, at this mode it returns immediately if image is not ready yet.
sane_close()
will wait until completion of currently executing job (it will attempt to cancel job in progress, or just wait until completion of some cleanup steps, that performed after image downloading completion, and it really may take seconds, depending on device). Without these cleanup steps we may leave device in unstable state, so the next scan attempt will fail. In your case it really took ~6 seconds for device to respons.
So here I don't see anything to go wrong, though device is really a bit slow sometimes.
@alexpevzner
Thank you very much for your detailed answer! Now I understand why scan tooks so many time.
Have you looked logs for the https://github.com/alexpevzner/sane-airscan/issues/332? Is this also a problem with the scanner?
I was experimenting with the SANE API and noticed that
sane_open()
, first call ofsane_read()
andsane_close()
on scanner HP Laser MFP 135WR take a long time.sane_open()
call takes ~1 second. Firstsane_read()
call takes ~10 seconds.sane_close()
takes ~6 seconds.Time doesn't change whether the MFP is in power save mode or not.
To check, I woke up the scanner from power save mode and ran scanimage:
For example, the same command, but using
v4l
backend:sane-airscan config
``` $ sudo cat /etc/sane.d/airscan.conf ``` ```config [devices] "HP_Laser_MFP_135wr" = https://192.168.1.121:443/eSCL [options] discovery = disable [debug] #trace = ~/airscan/trace #enable = true ```If necessary, I can provide any logs and help with debugging.