-
Notifications
You must be signed in to change notification settings - Fork 24
Multi Threading scanning #32
Comments
Please call |
TestScanMultiple.txt Exiting in thread: 1Exiting in thread: 2 Exception in thread Thread-1: |
How much free memory does your device has ? It seems it's running out of memory. Unfortunately, Pyinsane uses quite a lot of memory to store the chunk of the images. In another bug report, someone reported having issues scanning at 600dpi with only 1GB of ram (raspberry pi). |
I am using a pi, but I have a swap file that adds a GB so 2 in total. I am only scanning at 150 dpi so it should not be to much of a hog at that level. Was the error replicated on your machine with the script I attached in the previous comment? |
I have a use case where I need to scan 2 different scanners at the same time. when I attempt to multi thread pyinsane2 I get the following
TestScanMultiple.txt
error. attached is the python script that generated this error. Any help would be greatly appreciated.
===== RESTART: /home/pi/Documents/LinearBookScanner/TestScanMultiple.py =====
init in thread: 1init in thread: 2
Devices Recieved in thread: 2
Exiting in thread: 2
Exception in thread Thread-1:
Traceback (most recent call last):
File "/home/pi/Documents/LinearBookScanner/TestScanMultiple.py", line 12, in Scan
devices = pyinsane2.get_devices()
File "/usr/local/lib/python3.5/dist-packages/pyinsane2/sane/abstract_proc.py", line 268, in get_devices
for x in remote_do('get_devices', local_only)
File "/usr/local/lib/python3.5/dist-packages/pyinsane2/sane/abstract_proc.py", line 69, in remote_do
result = os.read(fifo_s2c, length)
OSError: [Errno 9] Bad file descriptor
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
self.run()
File "/usr/lib/python3.5/threading.py", line 862, in run
self._target(*self._args, **self._kwargs)
File "/home/pi/Documents/LinearBookScanner/TestScanMultiple.py", line 16, in Scan
pyinsane2.exit()
File "/usr/local/lib/python3.5/dist-packages/pyinsane2/sane/abstract_proc.py", line 120, in exit
remote_do('exit')
File "/usr/local/lib/python3.5/dist-packages/pyinsane2/sane/abstract_proc.py", line 56, in remote_do
os.write(fifo_c2s, length)
OSError: [Errno 9] Bad file descriptor
The text was updated successfully, but these errors were encountered: