avision locks up after one scan [regression, bisected]
My Xerox Document 152 locks up and needs to be power cycled after one scan using the latest git sane-backends. The latest release (1.0.30) is OK. git bisect reveals the problem is the following commit, and I have attached the full diff of that commit to this message. I have confirmed that reverting the code change from the latest git master branch version eliminates the symptom.
commit de19ebc6 Author: Michael Niewoehner foss@mniewoehner.de Date: Sat Sep 29 21:35:55 2018 +0200
backend/avision: i1120: add option AV_FASTFEED_ON_CANCEL
Some scanners like i1120 support fast feed-out of the sheet when
cancelling a running scan. Add a new option for this release type.
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
The patch appears to make an extra call to release_unit() for all avision scanners, not just the one with the new AV_FASTFEED_ON_CANCEL flag, although it makes me wonder if that was the right change even for the scanner type with that feature.git-bisect-save-avision-hang.sh
To clarify, the symptom is that, on the first attempt to scan, even if the document feeder is empty, scanimage takes a long time to exit, usually taking time close to a multiple of 30 seconds. After that, subsequent attempts to invoke the scanimage program on the scanner block, although it is possible to kill the program with control-C. This is a on a Linux system.
I have also attached my git bisect script, in case anyone is curious. The calls to invocations of the ubiqity_powrestrip.sh script toggle the AC power to the scanner in order to reset it.
Failing commit: avision-fast-feedout.diff
Git bisect script: (/uploads/e628d5d93bb60051b0d32da751beac4b/git-bisect-save-avision-hang.sh)
I can suggest a patch if necessary, but I think Michael or other sane-backend developers are likely to know better what the most correct fix is likely to be.
By the way, the scanner on which I reproduced this problem is a Xerox Document 152 (USB, duplex).
In any case, I am grateful to Michael for his efforts to improve the avision driver. We can all work to reduce occurrences of little mistakes like this, but I think it is well worth the eventual progress and appreciate the work going toward the goal of improving the avision driver.
Thanks in advance for any responses to this patch.