[sane-devel] Canon MX430 / MX510 / MX925 - does not recover when ADF out of paper

Matthias Peter Walther MatthiasPeterW at aol.com
Mon Mar 17 20:03:08 UTC 2014


Hello All,

I had some trouble to apply the new patch, but Rolf helped me to fix it.

Here comes the result with git + patch pixma_mp150.c.patch1, 3 pages in ADF.

It works correct, but the timeout at the end acts weird. In the log it
counts down 8 7 6...but between each line it pauses around 15-20
seconds. This scan took ages!

The log comes as attachment.

Bye
Matthias

Am 15.03.2014 20:16, schrieb Rolf Bensch:
> Hi All,
>
> Now we have Matthias on board with his MX375.
>
> Please don't use the old patches. I started changing code in pixma.c
> where we might get problems with other scanners, e.g. with the
> Imageclass sub-backend. So, we should find a fix which affects
> pixma_mp150.c only.
>
> We should start at the beginning. Please use attached patch with latest
> code from git. I added some additional debug outputs to show the status
> of adf scanning. Please create a debug file with 'export
> SANE_DEBUG_PIXMA=4'.
>
> I also added TODO comments as hints for possible fixes.
>
> Cheers,
> Rolf
>
>
>
> Am 14.03.2014 22:41, schrieb Matthias Peter Walther:
>> Hallo Rolf,
>>
>> thanks for your quick reply. I'm from Germany too, by the way. But to
>> keep this conformed, I'm gonna answer you in english.
>>
>> If I understood your posts correctly, you want me to use patch 3+4.
>> Patch 5 is only for the feature to initiate a scan from the device.
>> Which is nice, but I will look into that later.
>>
>> So I pulled my git-sane-backend-repo and patched it:
>>
>> mpw at Server0:~/sane$ patch -p1 < attachment-0003.bin
>> patching file sane-backends/backend/pixma.c
>> mpw at Server0:~/sane$ patch -p1 < attachment-0004.bin
>> patching file sane-backends/backend/pixma_mp150.c
>> Hunk #2 succeeded at 1397 (offset -12 lines).
>> Hunk #3 succeeded at 1439 (offset -12 lines).
>> Hunk #4 succeeded at 1493 (offset -12 lines).
>> Hunk #5 succeeded at 1560 (offset -12 lines).
>> Hunk #6 succeeded at 1568 (offset -12 lines).
>> Hunk #7 succeeded at 1580 (offset -12 lines).
>>
>> I think the offset is related to the age of the patch.
>>
>> After installing, I check the ldconfig:
>>
>> $ sudo ldconfig -v | grep libsane
>> /sbin/ldconfig.real: Kann »stat()« für »/lib/i686-linux-gnu« nicht
>> aufrufen: Datei oder Verzeichnis nicht gefunden
>> /sbin/ldconfig.real: Kann »stat()« für »/usr/lib/i686-linux-gnu« nicht
>> aufrufen: Datei oder Verzeichnis nicht gefunden
>> /sbin/ldconfig.real: Pfad »/usr/local/lib« mehrfach angegeben
>> /sbin/ldconfig.real: Pfad »/lib/x86_64-linux-gnu« mehrfach angegeben
>> /sbin/ldconfig.real: Pfad »/usr/lib/x86_64-linux-gnu« mehrfach angegeben
>>     libsane.so.1 -> libsane.so.1.0.25
>>     libsane.so.1 -> libsane.so.1.0.22
>> /sbin/ldconfig.real: Es ist nicht möglich, den Status (stat()) der Datei
>> /usr/lib/x86_64-linux-gnu/libsoftokn3.so zu lesen: Datei oder
>> Verzeichnis nicht gefunden
>>     libsane.so.1 -> libsane.so.1.0.22
>>     libsane-canon_mfp.so.1 -> libsane-canon_mfp.so.1.0.9
>>
>> This looks good, I think I had 1.0.24 from last october before. Okay, I
>> tried a scan then:
>>
>> $ scanadf
>> scanadf: sane_read: Error during device I/O
>> Error during device I/O
>> Scanned 0 pages
>> $
>>
>> This did not work before, either. Maybe my sane-frontend is too old? I
>> have the original one from Ubuntu 12.04.4.
>> $ scanadf --version
>> scanadf (sane-frontends) 1.0.14
>>
>> Next try, scanimage:
>> $ scanimage --source "Automatic Document Feeder" -p --batch
>> Scanning -1 pages, incrementing by 1, numbering from 1
>> Scanning page 1
>> Scanned page 1. (scanner status = 5)
>> Scanning page 2
>> scanimage: sane_read: Document feeder out of documents
>> Scanned page 2. (scanner status = 7)
>> mpw at Server0:~/sane$ ls
>> attachment-0003.bin  attachment-0004.bin  out1.pnm  sane-backends
>>
>> This is a first success. But as you can see in the output of ls, it
>> stores only the first page, the second is lost. Or is there something
>> wrong with my scanimage-command?
>>
>> BTW: Can you please change "Automatic Document Feeder" to simply "ADF",
>> that would be much more comfortable to type :)
>>
>> So thanks for your patch, I think it's almost perfect. I just need to
>> store the 2nd page.
>>
>> Please let me know, if you need more detailed debugging output. Will you
>> commit this two patches to the git repository?
>>
>> Grüße aus Münster
>> Matthias
>>
>> Am 14.03.2014 19:31, schrieb Rolf Bensch:
>>> Hi Matthias,
>>>
>>> Please read this thread:
>>> http://lists.alioth.debian.org/pipermail/sane-devel/2014-March/032138.html.
>>>
>>> Cheers,
>>> Rolf
>>>
>>>
>>> Am 12.03.2014 21:11, schrieb Matthias Peter Walther:
>>>> Hello,
>>>>
>>>> I'm new to this, but I'm gonna try my luck. I own a Canaon MX375
>>>> all-in-one. The PIXMA-backend has this annoying adf-empty-bug.
>>>>
>>>> Is there any information I could provice to help to fix this?
>>>>
>>>> The binary driver from canon.uk works with their gui-frontend only and
>>>> I'd like to get it working on a headless system.
>>>>
>>>> Thanks for any comments.
>>>>
>>>> Bye
>>>> Matthias Walther
>>>>
>>>>
>>

-------------- next part --------------
mpw at Server0:~$ SANE_DEBUG_PIXMA=4 scanimage -b test%02.pnm --source "Automatic Document Feeder" 
[sanei_debug] Setting debug level of pixma to 4.
[pixma] pixma is compiled with pthread support.
[pixma] pixma version 0.17.6
[pixma] pixma_collect_devices() found Canon PIXMA MX370 Series at libusb:002:016
[pixma] pixma_find_scanners() found 1 devices
[pixma] pixma_collect_devices() found Canon PIXMA MX370 Series at libusb:002:016
[pixma] pixma_open(): Canon PIXMA MX370 Series
scanimage: argument without option: `test%02.pnm'; try scanimage --help
[pixma] pixma_close(): Canon PIXMA MX370 Series
mpw at Server0:~$ less .bash_history 
mpw at Server0:~$ SANE_DEBUG_PIXMA=4 scanimage --batch=test%02d.pnm --source "Automatic Document Feeder" 
[sanei_debug] Setting debug level of pixma to 4.
[pixma] pixma is compiled with pthread support.
[pixma] pixma version 0.17.6
[pixma] pixma_collect_devices() found Canon PIXMA MX370 Series at libusb:002:016
[pixma] pixma_find_scanners() found 1 devices
[pixma] pixma_collect_devices() found Canon PIXMA MX370 Series at libusb:002:016
[pixma] pixma_open(): Canon PIXMA MX370 Series
Scanning -1 pages, incrementing by 1, numbering from 1
Scanning page 1
[pixma] Reader task id=140171997112064 (threaded)
[pixma] Reader task started
[pixma] 
[pixma] pixma_scan(): start
[pixma]   line_size=1914 image_size=1678578 channels=3 depth=8
[pixma]   dpi=75x75 offset=(0,0) dimension=638x877
[pixma]   gamma_table=0x167a7b0 source=1
[pixma]   threshold=127 threshold_curve=0
[pixma]   ADF page count: 0
[pixma] Current status: paper=0 cal=0 lamp=0 busy=0
[pixma] *mp150_scan***** start scanning *****
[pixma] *mp150_fill_buffer***** end of image  *****
[pixma] *mp150_finish_scan***** wait for next page from ADF  *****
[pixma] WARNING:image size mismatches
[pixma]     1678578 expected (877 lines) but 1665180 received (870 lines)
[pixma] pixma_read_image(): completed (underrun detected)
[pixma] Reader task terminated
Scanned page 1. (scanner status = 5)
Scanning page 2
[pixma] [pixma] Reader task id=140171997112064 (threaded)
Reader task started
[pixma] 
[pixma] pixma_scan(): start
[pixma]   line_size=1914 image_size=1678578 channels=3 depth=8
[pixma]   dpi=75x75 offset=(0,0) dimension=638x877
[pixma]   gamma_table=0x167a7b0 source=1
[pixma]   threshold=127 threshold_curve=0
[pixma]   ADF page count: 1
[pixma] Current status: paper=0 cal=0 lamp=0 busy=0
[pixma] *mp150_scan***** scan next sheet from ADF  *****
[pixma] *mp150_fill_buffer***** end of image  *****
[pixma] *mp150_finish_scan***** wait for next page from ADF  *****
[pixma] WARNING:image size mismatches
[pixma]     1678578 expected (877 lines) but 1663266 received (869 lines)
[pixma] pixma_read_image(): completed (underrun detected)
[pixma] Reader task terminated
Scanned page 2. (scanner status = 5)
Scanning page 3
[pixma] Reader task id=140171997112064 (threaded)
[pixma] Reader task started
[pixma] 
[pixma] pixma_scan(): start
[pixma]   line_size=1914 image_size=1678578 channels=3 depth=8
[pixma]   dpi=75x75 offset=(0,0) dimension=638x877
[pixma]   gamma_table=0x167a7b0 source=1
[pixma]   threshold=127 threshold_curve=0
[pixma]   ADF page count: 2
[pixma] Current status: paper=0 cal=0 lamp=0 busy=0
[pixma] *mp150_scan***** scan next sheet from ADF  *****
[pixma] *mp150_fill_buffer***** end of image  *****
[pixma] *mp150_finish_scan***** abort session  *****
[pixma] WARNING:image size mismatches
[pixma]     1678578 expected (877 lines) but 1665180 received (870 lines)
[pixma] pixma_read_image(): completed (underrun detected)
[pixma] Reader task terminated
Scanned page 3. (scanner status = 5)
Scanning page 4
[pixma] Reader task started
[pixma] 
[pixma] pixma_scan(): start
[pixma]   line_size=1914 image_size=1678578 channels=3 depth=8
[pixma] Reader task id=140171997112064 (threaded)
[pixma]   dpi=75x75 offset=(0,0) dimension=638x877
[pixma]   gamma_table=0x167a7b0 source=1
[pixma]   threshold=127 threshold_curve=0
[pixma]   ADF page count: 3
[pixma] No response yet. Timed out in 8 sec.
[pixma] No response yet. Timed out in 7 sec.
[pixma] No response yet. Timed out in 6 sec.
[pixma] No response yet. Timed out in 5 sec.
[pixma] No response yet. Timed out in 4 sec.
[pixma] No response yet. Timed out in 3 sec.
[pixma] No response yet. Timed out in 2 sec.
[pixma] No response yet. Timed out in 1 sec.
[pixma] WARNING: Error in response phase. cmd:f320
[pixma]   If the scanner hangs, reset it and/or unplug the USB cable.
[pixma] pixma_scan() failed ETIMEDOUT
[pixma] Reader task terminated: ETIMEDOUT
[pixma] read_image():reader task closed the pipe:0 bytes received, 1678578 bytes expected
scanimage: sane_read: Error during device I/O
Scanned page 4. (scanner status = 9)
[pixma] pixma_close(): Canon PIXMA MX370 Series
mpw at Server0:~$ ls test0*
test01.pnm  test02.pnm  test03.pnm


More information about the sane-devel mailing list