<a href="http://waddles.org/content/sane-canon-mp730-driver"></a>Things wrong in pixma_mp730.c:<br><ol><li>Protocol error. The scanner did not like having start_session and select_source commands sent to it when it already had a session open and was reading from the ADF.<br>
</li><li>The maximum resolution for the ADF is only 600dpi.</li><li>The maximum bounds should not apply for the ADF. This is still an issue. I changed the bounds in the pixma_config_t structure to be able to accept A4 pages, but the ADF can read up to 39 inches according to Canon&#39;s sales flyer. </li>
</ol><a href="http://waddles.org/sites/waddles.org/files/pixma_mp730_batch_fixes.diff_.txt">The patch containing fixes 1 and 2</a> is ready to be applied to CVS now. Fix 3 is not ready yet.<br><br>I have solved the ECANCELED problem using a different method. Please review the <a href="http://waddles.org/sites/waddles.org/files/pixma_proper_finish.diff_.txt">patch</a> on my website.<br>

<br>The change to pixma.c is still curious even to me. I found that sometimes when I was stepping through the code in gdb, it would end successfully without the ECANCELED return code, but every time I just let it run by itself, it always returned ECANCELED. By experimenting with different sleeps, from 10000 to 100000, I found that 30000 gives a successful scan consistently. I don&#39;t understand why it works, it just works.<br>
<br>So now I can scan many A4 pages successfully in batch mode through the ADF at resolutions 75dpi to 600dpi.<br><br>When I add your suggestion to change the way the width is calculated, it goes back to returning ECANCELED. See <a href="http://waddles.org/sites/waddles.org/files/pixma_mp730_rounded_width.txt">the log</a>.<br>
<br>The <a href="http://waddles.org/sites/waddles.org/files/mp730_1200_gray.txt">log of a 1200dpi grayscale scan</a> is also attached to my <a href="http://waddles.org/content/sane-canon-mp730-driver">site</a>.<br><br>Cheers,<br>
Wade.<br><br><div class="gmail_quote">2009/4/26 Nicolas Martin <span dir="ltr">&lt;<a href="mailto:nicolas.martin@freesurf.fr">nicolas.martin@freesurf.fr</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Le samedi 25 avril 2009 à 23:43 +1000, Wade Fitzpatrick a écrit :<br>
<div class="im">&gt; I tried moving the MP730_PID and DEV macro from pixma_mp730.c into<br>
&gt; pixma_imageclass.c but the scanner would not operate at all. It<br>
&gt; attached to the endpoints correctly and could read and write URBs but<br>
&gt; when it came to sending the read_image command (0xd420) it responded<br>
&gt; with a cancel command (0x1515).<br>
&gt; The other imageCLASS devices are all limited to 600dpi which fits<br>
&gt; their specifications but the MP730 is capable of 1200x2400dpi optical.<br>
&gt; Maybe the imageclass driver is not the best reference for MP730.<br>
&gt;<br>
</div>That&#39;s normal, there are some differences, so MP730 cannot work out of<br>
the box with the imageclass driver. The idea here was to compare both<br>
mp730 and imageclass files to check differences, if you do this, you&#39;ll<br>
see they are very similar.<br>
<br>
1/ grayscale issue<br>
Could you now just activate only the pixma trace log:<br>
$ export SANE_DEBUG_PIXMA=11<br>
and put the full error trace in a file, zip it and send it back, I would<br>
like to check if the scanner sent the end scan condition, or if<br>
something special happens at the moment it hangs. Also, how much data it<br>
expected to send versus how much is requested.<br>
<br>
2/ End condition canceled by software<br>
I have a clue (but it&#39;s only a guess) on what happens here, as this<br>
looks same to what happened for devices in the mp150 file.<br>
The &quot;Canceled by software&quot; end condition was raised because the frontend<br>
expected less data than the scanner was requested to send, so the<br>
backend sends an abort command to the scanner when all its expected data<br>
is received.<br>
In fact, all Pixma devices need a rounded up scan width, older devices<br>
had a 4 or 12 pixels alignment, while recent generations currently all<br>
use 32.<br>
For mp150 devices, the fix was simply to modify the scan width area<br>
requested by the frontend, to take this into account (the round up was<br>
only done for scanner parameters).<br>
Could you try the same in the mp730 file:<br>
<br>
in function mp730_check_param(), change the current content:<br>
<br>
 sp-&gt;depth = 8;         /* FIXME: Does MP730 supports other depth? */<br>
 sp-&gt;line_size = calc_raw_width (sp) * sp-&gt;channels;<br>
<br>
with that:<br>
<br>
 sp-&gt;depth = 8; /* FIXME: Does MP730 supports other depth? */<br>
 sp-&gt;w = calc_raw_width (sp);<br>
 sp-&gt;line_size = calc_raw_width (sp) * sp-&gt;channels;<br>
<br>
and give a try ?<br>
Also, could you take a complete [pixma] only log trace and send it<br>
back ?<br>
<font color="#888888"><br>
Nicolas<br>
</font><div><div></div><div class="h5">&gt;<br>
&gt; Back in the pixma_mp730 driver, when I run a test scan at 1200dpi<br>
&gt; Gray, it reads some image data then the scanner just keeps sending OK<br>
&gt; messages forever. It may be a hardware bug. Here is what it looks<br>
&gt; like:<br>
&gt;<br>
&gt;         [sanei_usb] 3DE02A 2C 2A 29 2B 29 2B 29 2A 29 2B 29 2A 2B 2F<br>
&gt;         2E *,*)+)+)*)+)*+/.<br>
&gt;         [sanei_usb] 3DF02C 2A 2D 2B 2C 2C 2D 29 2C 2E 30 31 32 2F 33<br>
&gt;         37 ,*-+,,-),.012/37<br>
&gt;         [sanei_usb] 3E003D 52 60 65 69 69<br>
&gt;         =R`eii<br>
&gt;         [sanei_usb] sanei_usb_read_bulk: wanted 48646 bytes, got 15878<br>
&gt;         bytes<br>
&gt;         [pixma] IN   T=17.283 len=15878<br>
&gt;<br>
&gt;         [pixma]  00003de0:2a 2c 2a 29 2b 29 2b 29  2a 29 2b 29 2a 2b<br>
&gt;         2f 2e<br>
&gt;         [pixma]  00003df0:2c 2a 2d 2b 2c 2c 2d 29  2c 2e 30 31 32 2f<br>
&gt;         33 37<br>
&gt;         [pixma]  00003e00:3d 52 60 65 69 69<br>
&gt;         [pixma]<br>
&gt;         [sanei_usb] sanei_usb_write_bulk: trying to write 10 bytes<br>
&gt;         [sanei_usb] 000 D4 20 00 00 00 00 00 C0 04<br>
&gt;         00                   . ........<br>
&gt;         [sanei_usb] sanei_usb_write_bulk: wanted 10 bytes, wrote 10<br>
&gt;         bytes<br>
&gt;         [pixma] OUT  T=17.341 len=10<br>
&gt;         [pixma]  00000000:d4 20 00 00 00 00 00 c0  04 00<br>
&gt;         [pixma]<br>
&gt;         [sanei_usb] sanei_usb_read_bulk: trying to read 512 bytes<br>
&gt;         [sanei_usb] 000 06 06 00 00 00<br>
&gt;         00                               ......<br>
&gt;         [sanei_usb] sanei_usb_read_bulk: wanted 512 bytes, got 6 bytes<br>
&gt;         [pixma] IN   T=17.344 len=6<br>
&gt;         [pixma]  00000000:06 06 00 00 00 00<br>
&gt;         [pixma]<br>
&gt;         [sanei_usb] sanei_usb_read_int: trying to read 16 bytes<br>
&gt;         [sanei_usb] sanei_usb_read_int: read failed: Resource<br>
&gt;         temporarily unavailable<br>
&gt;         [sanei_usb] sanei_usb_write_bulk: trying to write 10 bytes<br>
&gt;         [sanei_usb] 000 D4 20 00 00 00 00 00 C0 04<br>
&gt;         00                   . ........<br>
&gt;         [sanei_usb] sanei_usb_write_bulk: wanted 10 bytes, wrote 10<br>
&gt;         bytes<br>
&gt;         [pixma] OUT  T=17.448 len=10<br>
&gt;         [pixma]  00000000:d4 20 00 00 00 00 00 c0  04 00<br>
&gt;         [pixma]<br>
&gt;         [sanei_usb] sanei_usb_read_bulk: trying to read 512 bytes<br>
&gt;         [sanei_usb] 000 06 06 00 00 00<br>
&gt;         00                               ......<br>
&gt;         [sanei_usb] sanei_usb_read_bulk: wanted 512 bytes, got 6 bytes<br>
&gt;         [pixma] IN   T=17.451 len=6<br>
&gt;         [pixma]  00000000:06 06 00 00 00 00<br>
&gt;         [pixma]<br>
&gt;         [sanei_usb] sanei_usb_read_int: trying to read 16 bytes<br>
&gt;         [sanei_usb] sanei_usb_read_int: read failed: Resource<br>
&gt;         temporarily unavailable<br>
&gt;         [sanei_usb] sanei_usb_write_bulk: trying to write 10 bytes<br>
&gt;         [sanei_usb] 000 D4 20 00 00 00 00 00 C0 04<br>
&gt;         00                   . ........<br>
&gt;         [sanei_usb] sanei_usb_write_bulk: wanted 10 bytes, wrote 10<br>
&gt;         bytes<br>
&gt;         [pixma] OUT  T=17.556 len=10<br>
&gt;         [pixma]  00000000:d4 20 00 00 00 00 00 c0  04 00<br>
&gt;         [pixma]<br>
&gt;         [sanei_usb] sanei_usb_read_bulk: trying to read 512 bytes<br>
&gt;         [sanei_usb] 000 06 06 00 00 00<br>
&gt;         00                               ......<br>
&gt;         [sanei_usb] sanei_usb_read_bulk: wanted 512 bytes, got 6 bytes<br>
&gt;         [pixma] IN   T=17.559 len=6<br>
&gt;         [pixma]  00000000:06 06 00 00 00 00<br>
&gt;         [pixma]<br>
&gt;         [sanei_usb] sanei_usb_read_int: trying to read 16 bytes<br>
&gt;         [sanei_usb] sanei_usb_read_int: read failed: Resource<br>
&gt;         temporarily unavailable<br>
&gt;         [sanei_usb] sanei_usb_write_bulk: trying to write 10 bytes<br>
&gt;         [sanei_usb] 000 D4 20 00 00 00 00 00 C0 04<br>
&gt;         00                   . ........<br>
&gt;         [sanei_usb] sanei_usb_write_bulk: wanted 10 bytes, wrote 10<br>
&gt;         bytes<br>
&gt;         [pixma] OUT  T=17.663 len=10<br>
&gt;         [pixma]  00000000:d4 20 00 00 00 00 00 c0  04 00<br>
&gt;         [pixma]<br>
&gt;         [sanei_usb] sanei_usb_read_bulk: trying to read 512 bytes<br>
&gt;         [sanei_usb] 000 06 06 00 00 00<br>
&gt;         00                               ......<br>
&gt;         [sanei_usb] sanei_usb_read_bulk: wanted 512 bytes, got 6 bytes<br>
&gt;         [pixma] IN   T=17.666 len=6<br>
&gt;         [pixma]  00000000:06 06 00 00 00 00<br>
<br>
<br>
&gt; Regarding the ECANCELED error code on completion, this is the end of a<br>
&gt; successful scan. The image data is fine but the driver sends an<br>
&gt; abort_session command on completion<br>
&gt;<br>
&gt;         [sanei_usb] sanei_usb_write_bulk: trying to write 10 bytes<br>
&gt;         [sanei_usb] 000 D4 20 00 00 00 00 00 C0 04<br>
&gt;         00                   . ........<br>
&gt;         [sanei_usb] sanei_usb_write_bulk: wanted 10 bytes, wrote 10<br>
&gt;         bytes<br>
&gt;         [pixma] OUT  T=3.310 len=10<br>
&gt;         [pixma]  00000000:d4 20 00 00 00 00 00 c0  04 00<br>
&gt;         [pixma]<br>
&gt;         [sanei_usb] sanei_usb_read_bulk: trying to read 512 bytes<br>
&gt;         [sanei_usb] 000 06 06 20 00 37 50 55 55 56 55 56 55 58 55 57<br>
&gt;         56 .. .7PUUVUVUXUWV<br>
&gt;         [sanei_usb] 010 55 56 57 55 54 56 56 58 53 57 5A 58 A7 B6 B8<br>
&gt;         B9 UVWUTVVXSWZX....<br>
&gt;<br>
&gt;         [sanei_usb] sanei_usb_read_bulk: wanted 512 bytes, got 512<br>
&gt;         bytes<br>
&gt;         [pixma] IN   T=3.315 len=512<br>
&gt;         [pixma]  00000000:06 06 20 00 37 50 55 55  56 55 56 55 58 55<br>
&gt;         57 56<br>
&gt;         [pixma]  00000010:55 56 57 55 54 56 56 58  53 57 5a 58 a7 b6<br>
&gt;         b8 b9<br>
&gt;<br>
&gt;         [sanei_usb] sanei_usb_read_bulk: trying to read 48646 bytes<br>
&gt;<br>
&gt;<br>
&gt;         [sanei_usb] 353031 2F 34 2C 2A 3D 25 30 37 3E 30 43 2A 32 3B<br>
&gt;         37 1/4,*=%07&gt;0C*2;7<br>
&gt;         [sanei_usb] 35402B 47 37 44 4A 3A 41 5E 80 63 51 51 50 53 51<br>
&gt;         53 +G7DJ:A^.cQQPSQS<br>
&gt;         [sanei_usb] 355051 52 52 51 50 FF<br>
&gt;         QRRQP.<br>
&gt;         [sanei_usb] sanei_usb_read_bulk: wanted 48646 bytes, got 13654<br>
&gt;         bytes<br>
&gt;         [pixma] IN   T=3.389 len=13654<br>
&gt;<br>
&gt;         [pixma]  00003530:31 2f 34 2c 2a 3d 25 30  37 3e 30 43 2a 32<br>
&gt;         3b 37<br>
&gt;         [pixma]  00003540:2b 47 37 44 4a 3a 41 5e  80 63 51 51 50 53<br>
&gt;         51 53<br>
&gt;         [pixma]  00003550:51 52 52 51 50 ff<br>
&gt;         [pixma]<br>
&gt;         [sanei_usb] sanei_usb_write_bulk: trying to write 10 bytes<br>
&gt;         [sanei_usb] 000 EF 20 00 00 00 00 00 00 00<br>
&gt;         00                   . ........<br>
&gt;         [sanei_usb] sanei_usb_write_bulk: wanted 10 bytes, wrote 10<br>
&gt;         bytes<br>
&gt;         [pixma] OUT  T=3.441 len=10<br>
&gt;         [pixma]  00000000:ef 20 00 00 00 00 00 00  00 00<br>
&gt;         [pixma]<br>
&gt;         [sanei_usb] sanei_usb_read_bulk: trying to read 2 bytes<br>
&gt;         [sanei_usb] 000 06<br>
&gt;         06                                           ..<br>
&gt;         [sanei_usb] sanei_usb_read_bulk: wanted 2 bytes, got 2 bytes<br>
&gt;         [pixma] IN   T=3.444 len=2<br>
&gt;         [pixma]  00000000:06 06<br>
&gt;         [pixma]<br>
&gt;         [sanei_usb] sanei_usb_write_bulk: trying to write 10 bytes<br>
&gt;         [sanei_usb] 000 F3 20 00 00 00 00 00 00 0C<br>
&gt;         00                   . ........<br>
&gt;         [sanei_usb] sanei_usb_write_bulk: wanted 10 bytes, wrote 10<br>
&gt;         bytes<br>
&gt;         [pixma] OUT  T=3.444 len=10<br>
&gt;         [pixma]  00000000:f3 20 00 00 00 00 00 00  0c 00<br>
&gt;         [pixma]<br>
&gt;         [sanei_usb] sanei_usb_read_bulk: trying to read 14 bytes<br>
&gt;         [sanei_usb] 000 06 06 03 01 00 02 03 00 02 00 00 00 00<br>
&gt;         F5       ..............<br>
&gt;         [sanei_usb] sanei_usb_read_bulk: wanted 14 bytes, got 14 bytes<br>
&gt;         [pixma] IN   T=3.449 len=14<br>
&gt;         [pixma]  00000000:06 06 03 01 00 02 03 00  02 00 00 00 00 f5<br>
&gt;         [pixma]<br>
&gt;         [pixma] Current status: paper=1 cal=0 lamp=0<br>
&gt;         [sanei_usb] sanei_usb_write_bulk: trying to write 10 bytes<br>
&gt;         [sanei_usb] 000 F3 20 00 00 00 00 00 00 0C<br>
&gt;         00                   . ........<br>
&gt;         [sanei_usb] sanei_usb_write_bulk: wanted 10 bytes, wrote 10<br>
&gt;         bytes<br>
&gt;         [pixma] OUT  T=3.452 len=10<br>
&gt;         [pixma]  00000000:f3 20 00 00 00 00 00 00  0c 00<br>
&gt;         [pixma]<br>
&gt;         [sanei_usb] sanei_usb_read_bulk: trying to read 14 bytes<br>
&gt;         [sanei_usb] 000 06 06 03 01 00 02 03 00 02 00 00 00 00<br>
&gt;         F5       ..............<br>
&gt;         [sanei_usb] sanei_usb_read_bulk: wanted 14 bytes, got 14 bytes<br>
&gt;         [pixma] IN   T=3.452 len=14<br>
&gt;         [pixma]  00000000:06 06 03 01 00 02 03 00  02 00 00 00 00 f5<br>
&gt;         [pixma]<br>
&gt;         [pixma] Current status: paper=1 cal=0 lamp=0<br>
&gt;         [sanei_usb] sanei_usb_write_bulk: trying to write 20 bytes<br>
&gt;         [sanei_usb] 000 CF 60 00 00 00 00 00 00 0A 00 01 00 00 00 00<br>
&gt;         00 .`..............<br>
&gt;         [sanei_usb] 010 00 00 00<br>
&gt;         FF                                     ....<br>
&gt;         [sanei_usb] sanei_usb_write_bulk: wanted 20 bytes, wrote 20<br>
&gt;         bytes<br>
&gt;         [pixma] OUT  T=3.455 len=20<br>
&gt;         [pixma]  00000000:cf 60 00 00 00 00 00 00  0a 00 01 00 00 00<br>
&gt;         00 00<br>
&gt;         [pixma]  00000010:00 00 00 ff<br>
&gt;         [pixma]<br>
&gt;         [sanei_usb] sanei_usb_read_bulk: trying to read 2 bytes<br>
&gt;         [sanei_usb] 000 06<br>
&gt;         06                                           ..<br>
&gt;         [sanei_usb] sanei_usb_read_bulk: wanted 2 bytes, got 2 bytes<br>
&gt;         [pixma] IN   T=3.459 len=2<br>
&gt;         [pixma]  00000000:06 06<br>
&gt;         [pixma]<br>
&gt;         [pixma] pixma_read_image():cancelled by software<br>
&gt;         [pixma] Reader task terminated: ECANCELED<br>
&gt;         [pixma] pixma_close(): Canon MultiPASS MP730<br>
&gt;         [sanei_usb] sanei_usb_close: closing device 0<br>
&gt;<br>
&gt; I have managed to get some success by adding a small sleep to pixma.c<br>
&gt; but I&#39;m still testing that.<br>
&gt;<br>
&gt; Cheers,<br>
&gt; Wade.<br>
&gt;<br>
&gt;<br>
&gt; Moving from the &quot;MP730 driver broken since pixma-0.12.2&quot; thread...<br>
&gt;<br>
&gt; Nicolas Martin wrote:<br>
&gt; Concerning points 1 and 2 you raise, this is interesting:<br>
&gt;<br>
&gt; The pixma_mp730.c file has been left almost untouched for a while (no<br>
&gt; requests or testing ability so far), so it may be in a less &quot;enhanced&quot;<br>
&gt; state than other ones covering more recent Pixma models, that have<br>
&gt; been<br>
&gt; recently updated.<br>
&gt; Dennis Lou wrote a while back the pixma_imageclass.c file, based on<br>
&gt; the<br>
&gt; pixma_mp730.c file, and which covers several Canon ImageClass models<br>
&gt; in<br>
&gt; the pixma backend. The code has been nicely brushed up, and is now in<br>
&gt; a<br>
&gt; better shape than mp730&#39;s one.<br>
&gt; So for the 2 issues you raise, I&#39;ll take a look and compare the<br>
&gt; pixma_mp730.c code with pixma_imageclass.c and pixma_mp150.c ,<br>
&gt; probably<br>
&gt; will help a lot to solve those issues, thanks to your cooperation for<br>
&gt; testing and feedback.<br>
&gt;<br>
&gt; Nicolas<br>
&gt;<br>
&gt;<br>
&gt; Le vendredi 24 avril 2009 à 01:19 +1000, Wade Fitzpatrick a écrit :<br>
&gt; &gt; The only problems I can find now are:<br>
&gt;<br>
&gt; &gt;      1. Scanning at 1200dpi Grayscale. Sometimes it hangs depending<br>
&gt; on<br>
&gt; &gt;         the x and y values - the larger the values, the sooner it<br>
&gt; &gt;         fails. If it does succeed, the data is always bogus.<br>
&gt;<br>
&gt; &gt;      2. The return code after a successful scan is always ECANCELED<br>
&gt; &gt;         which causes a problem for batch mode as it will only scan<br>
&gt; one<br>
&gt; &gt;         page. It doesn&#39;t seem to matter for single scans.<br>
<br>
<br>
</div></div></blockquote></div><br>