[SANE] examples/scan.py hangs device forever - Device busy
Way to reproduce:
-
python3 scan.py test.png sane:pixma:04A92759_0165900002C6
- it works well for first time -
python3 scan.py test.png sane:pixma:04A92759_0165900002C6
- second time hangs forever. May be it depends on length of pause between first call, I'll specify it later
Result:
- Second call hangs forever, untill kill.
- After second call SANE changes ID of the device (removes second part
_0165900002C6
) - Device hangs forever, after
killall -9 python3
neitherscanimage -d pixma:04A92759_0165900002C6
norscanimage -d pixma:04A92759
not works. They sayscanimage: open of device pixma:04A92759 failed: Device busy
Expeted result:
No hangs, the device works
Bash log:
Check `scanimage`'s work
root@csar:/home/csar/pytho# scanimage -L
device `pixma:04A92759_0165900002C6' is a CANON Canon i-SENSYS MF3010 multi-function peripheral
device `hpaio:/net/HP_LaserJet_400_MFP_M425dn?ip=192.168.21.248' is a Hewlett-Packard HP_LaserJet_400_MFP_M425dn all-in-one
root@csar:/home/csar/pytho# scanimage -vvvv -d pixma:04A92759_0165900002C6 > /dev/null
scanimage: scanning image of size 640x877 pixels at 24 bits/pixel
scanimage: acquiring RGB frame
scanimage: min/max graylevel value = 2/255
scanimage: read 1683840 bytes in total
Closing device
Calling sane_exit
scanimage: finished
... next call is immidiately after previous ends, but the next after it works well
root@csar:/home/csar/pytho# scanimage -vvvv -d pixma:04A92759_0165900002C6 > /dev/null
scanimage: scanning image of size 640x877 pixels at 24 bits/pixel
scanimage: acquiring RGB frame
scanimage: min/max graylevel value = 255/0
scanimage: sane_read: Device busy
Closing device
Calling sane_exit
... repeat any times
root@csar:/home/csar/pytho# scanimage -vvvv -d pixma:04A92759_0165900002C6 > /dev/null
scanimage: scanning image of size 640x877 pixels at 24 bits/pixel
scanimage: acquiring RGB frame
scanimage: min/max graylevel value = 2/255
scanimage: read 1683840 bytes in total
Closing device
Calling sane_exit
scanimage: finished
Problem:
root@csar:/home/csar/pytho# python3 scan.py test.png sane:pixma:04A92759_0165900002C6 > stdout1.txt 2>stderr1.txt
root@csar:/home/csar/pytho# python3 scan.py test.png sane:pixma:04A92759_0165900002C6 > stdout2.txt 2>stderr2.txt
♥♥♥
[1]+ Stopped python3 scan.py test.png sane:pixma:04A92759_0165900002C6 > stdout2.txt 2> stderr2.txt
root@csar:/home/csar/pytho# killall python3
root@csar:/home/csar/pytho# scanimage -L
device `pixma:04A92759' is a CANON Canon i-SENSYS MF3010 multi-function peripheral
device `hpaio:/net/HP_LaserJet_400_MFP_M425dn?ip=192.168.21.248' is a Hewlett-Packard HP_LaserJet_400_MFP_M425dn all-in-one
root@csar:/home/csar/pytho# scanimage -vvvv -d pixma:04A92759 > /dev/null
scanimage: open of device pixma:04A92759 failed: Device busy
Calling sane_exit
scanimage: finished
each ♥
- is CTRL+C
press.
I waited a time before try to stop app. There was no movement of scanner's scanning line (I don't know right word for moving part).
Logs:
Environment:
OS: Ubuntu 16.04.6 LTS
libinsane: 1.0.3-21-g34612d4
Device: Canon i-SENSYS MF3010
libsane/xenial-updates,now 1.0.25+git20150528-1ubuntu2.16.04.1 amd64
libsane-common/xenial-updates,xenial-updates,now 1.0.25+git20150528-1ubuntu2.16.04.1 all
libsane-hpaio/xenial,now 3.16.3+repack0-1 amd64
sane-utils/xenial-updates,now 1.0.25+git20150528-1ubuntu2.16.04.1 amd64
Edited by Vasilii Blazhnov