Nicolas<br><br>My latest testing was on kernel 2.6.27-gentoo-r8. I don&#39;t see why a different kernel version would change the interface/endpoint numbering anyway - surely that is hardware specific to the MP730. I have the latest version of everything: kernel 2.6.27-gentoo-r8, libusb-0.1.12-r5, sane backends 1.0.20cvs. It&#39;s not a version problem, the MP730 has *never* worked using libsane. It worked enough to do scans using Wittawat Yamwong&#39;s ``scan&#39;&#39; utility until pixma-0.12.1 but never using libsane. We just never got that far in testing it back then.<br>
<br>Ubuntu users also complained about it but obviously never bothered to ask on sane-devel.<br><a href="http://ubuntuforums.org/showthread.php?t=592643&amp;highlight=mp730">http://ubuntuforums.org/showthread.php?t=592643&amp;highlight=mp730</a><br>
<a href="http://ubuntuforums.org/showthread.php?t=962535&amp;highlight=mp730">http://ubuntuforums.org/showthread.php?t=962535&amp;highlight=mp730</a><br><br>I didn&#39;t mean to suggest that the patch I have is ready for inclusion in CVS, only that it should apply to current if somebody wants to use it for testing. I&#39;m well aware that fixing this properly will mean a significant rewrite of sanei/sanei_usb.c and will probably touch most if not all backend drivers if you solve it the way I would, which is to specify the requisite interfaces and endpoints in the [backend]_config_t structure and pass that into sanei_usb code.<br>
<br>Let&#39;s take the remaining problems into another thread.<br><br>Cheers,<br>Wade.<br><br><div class="gmail_quote">2009/4/25 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;">Hi Wade,<br>
<br>
Sorry if act sometimes like &quot;guardians of the temple&quot;, but we need to be<br>
very accurate on the changes we make into the code, as there are lots of<br>
shared code in Sane backends (especially pixma) and libs.<br>
<br>
- So for points 1 and 2: we can close those.<br>
<br>
- Point 3: this is still to investigate, as we must be sure this<br>
endpoint issue is not brought by kernel 2.6.18-ck1 (BTW, do you know<br>
what does the -ck1 bring ?). This ck kernel is dated sept-2006 (on<br>
<a href="http://kernel.org" target="_blank">kernel.org</a>), and after googling a little bit &quot;2.6.18 usb endpoints&quot; it<br>
looks like there are some issues around that...<br>
My suggestion would still be to test with a recent kernel, with which we<br>
are sure Sane and endpoints work fine (recent Ubuntu distros can help a<br>
lot for that) and check if we can reproduce your endpoints issue.<br>
My fear here is not to introduce into the Sane code, some turnarounds<br>
and tweaks only for specific kernels, buggy on usb.<br>
<br>
Concerning points 1 and 2 you raise, this is interesting:<br>
<br>
The pixma_mp730.c file has been left almost untouched for a while (no<br>
requests or testing ability so far), so it may be in a less &quot;enhanced&quot;<br>
state than other ones covering more recent Pixma models, that have been<br>
recently updated.<br>
Dennis Lou wrote a while back the pixma_imageclass.c file, based on the<br>
pixma_mp730.c file, and which covers several Canon ImageClass models in<br>
the pixma backend. The code has been nicely brushed up, and is now in a<br>
better shape than mp730&#39;s one.<br>
So for the 2 issues you raise, I&#39;ll take a look and compare the<br>
pixma_mp730.c code with pixma_imageclass.c and pixma_mp150.c , probably<br>
will help a lot to solve those issues, thanks to your cooperation for<br>
testing and feedback.<br>
<br>
Nicolas<br>
<br>
<br>
Le vendredi 24 avril 2009 à 01:19 +1000, Wade Fitzpatrick a écrit :<br>
<div class="im">&gt; Hi Nicolas<br>
&gt;<br>
&gt; Thanks for reviewing my patches. I have to agree with you... too many<br>
&gt; late nights... must be coding in my sleep...<br>
</div>&gt;      1. I had the PIXMA_CAP_EVENTS flag removed at some stage as<br>
<div class="im">&gt;         that&#39;s what got the driver working again between pixma-0.12.1<br>
&gt;         and pixma-0.12.2. It doesn&#39;t seem to make any difference now<br>
&gt;         and I can&#39;t explain why so just ignore it. I don&#39;t think the<br>
&gt;         resolution and maximum scan area parameters are correct but<br>
&gt;         that&#39;s an issue for another day.<br>
</div>&gt;      2. I don&#39;t remember adding that line but I guess I must have. It<br>
<div class="im">&gt;         may have been an accidental &#39;p&#39; in vim. Ignore this one too.<br>
</div>&gt;      3. I checked out a fresh new cvs today and applied just the lines<br>
<div class="im">&gt;         you pasted below to sanei/sanei_usb.c - it works just fine<br>
&gt;         with that change alone. I ran through about 30 successful<br>
&gt;         tests too: using ADF, button-controlled, ADF<br>
&gt;         +button-controlled, Gray, Color and at various resolutions and<br>
&gt;         geometries on and off the platen glass, pressing Cancel during<br>
&gt;         a scan, pressing Ctrl-C during a scan, jamming the paper in<br>
&gt;         the ADF, batch scans etc.<br>
&gt; The only problems I can find now are:<br>
</div>&gt;      1. Scanning at 1200dpi Grayscale. Sometimes it hangs depending on<br>
<div class="im">&gt;         the x and y values - the larger the values, the sooner it<br>
&gt;         fails. If it does succeed, the data is always bogus.<br>
</div>&gt;      2. The return code after a successful scan is always ECANCELED<br>
<div><div></div><div class="h5">&gt;         which causes a problem for batch mode as it will only scan one<br>
&gt;         page. It doesn&#39;t seem to matter for single scans.<br>
&gt; Does this hold true for other models too?<br>
&gt; Does batch mode succeed on other models with ADF?<br>
&gt;<br>
&gt; I can&#39;t believe I&#39;ve spent so much time on such a trivial change :(<br>
&gt;<br>
&gt; Regards,<br>
&gt; Wade.<br>
&gt; 2009/4/23 Nicolas &lt;<a href="mailto:nicolas0martin@gmail.com">nicolas0martin@gmail.com</a>&gt;<br>
&gt;         Hi Wade,<br>
&gt;<br>
&gt;         Good news that you succeeded in having your MP730 work after<br>
&gt;         2,5 years !<br>
&gt;<br>
&gt;         I did carefully inspect the small changes you have done to the<br>
&gt;         pixma backend, but there are some points I don&#39;t understand<br>
&gt;         clearly, or maybe I&#39;ve missed sthg, but you can surely give us<br>
&gt;         some more info here:<br>
&gt;<br>
&gt;         1/ File backend/pixma_mp730.c<br>
&gt;<br>
&gt;         I don&#39;t understand the change you&#39;ve brought here individually<br>
&gt;         for each device, the line that you replaced for MP730:<br>
&gt;<br>
&gt;         -  DEVICE (&quot;Canon MultiPASS MP730&quot;, &quot;MP730&quot;, MP730_PID, 1200,<br>
&gt;         637, 868, PIXMA_CAP_ADF),<br>
&gt;         +  DEVICE (&quot;Canon MultiPASS MP730&quot;, &quot;MP730&quot;, MP730_PID, 1200,<br>
&gt;         637, 868, PIXMA_CAP_ADF|PIXMA_CAP_EVENTS),<br>
&gt;<br>
&gt;         has exactly the same effect than the original one in the<br>
&gt;         device definition:<br>
&gt;         -        PIXMA_CAP_GRAY|PIXMA_CAP_EVENTS|cap           \<br>
&gt;         +              PIXMA_CAP_GRAY|cap /* capabilities */<br>
&gt;          \<br>
&gt;<br>
&gt;         Here, you move the PIXMA_CAP_EVENTS flag from the global<br>
&gt;         device definition to the individual definition of each device.<br>
&gt;<br>
&gt;         - For MP730, this looks to have the same effect, or where is<br>
&gt;         the difference ?<br>
&gt;         - But this changes the definition for all other devices here,<br>
&gt;         and I would not like to bring here any regression to other<br>
&gt;         devices.<br>
&gt;<br>
&gt;         So: could you give the motivation for this modification here ?<br>
&gt;<br>
&gt;         2/ file pixma_io_sanei.c<br>
&gt;<br>
&gt;         The only diff I see here adds a PDBG debug statement:<br>
&gt;         + PDBG (pixma_dbg (3, &quot;sanei_usb_read_bulk returned error<br>
&gt;         code: %i\n&quot;, error));<br>
&gt;<br>
&gt;         The other line is a commented line:<br>
&gt;<br>
&gt;         +      /*error = pixma_map_status_errno (pixma_get_be16<br>
&gt;         (buf)); */<br>
&gt;<br>
&gt;         And I don&#39;t understand the comment you added:<br>
&gt;         &quot;The call to |pixma_map_status_errno() in |<br>
&gt;         backend/pixma_io_sane.c:pixma_read()<br>
&gt;         is in the wrong place as |pixma_read() may be re-entrant so as<br>
&gt;         to read a partial buffer.&quot;<br>
&gt;<br>
&gt;         - There are _no_ calls to |pixma_map_status_errno() in current<br>
&gt;         cvs ||pixma_read()<br>
&gt;         The one here is added as part of you modifications, but is<br>
&gt;         commented out.<br>
&gt;         - This part of the pixma code is common to all pixma devices<br>
&gt;         - The modifications you added here do not bring any functional<br>
&gt;         change.<br>
&gt;<br>
&gt;         So one again, what are those changes for ?<br>
&gt;<br>
&gt;         3/ File sanei_usb.c<br>
&gt;<br>
&gt;         This is the only file where modifications appear to have a<br>
&gt;         functional impact:<br>
&gt;         |+                 /* don&#39;t try to read non-scanner device<br>
&gt;         classes */<br>
&gt;         +                 if (interface-&gt;bInterfaceClass == 0x07) {<br>
&gt;         +                   DBG (3, &quot;sanei_usb_open: skipping Printer<br>
&gt;         interface\n&quot;);<br>
&gt;         +                   continue;<br>
&gt;         +                 }<br>
&gt;         +                 if (interface-&gt;bInterfaceClass == 0x08) {<br>
&gt;         +                   DBG (3, &quot;sanei_usb_open: skipping Mass<br>
&gt;         Storage interface\n&quot;);<br>
&gt;         +                   continue;<br>
&gt;         +                 }<br>
&gt;         +                 if (interface-&gt;bInterfaceClass == 0xff &amp;&amp; i<br>
&gt;         == 3) {<br>
&gt;         +                   DBG (3, &quot;sanei_usb_open: skipping second<br>
&gt;         Vendor Specific interface\n&quot;);<br>
&gt;         +                   continue;<br>
&gt;         +                 }<br>
&gt;<br>
&gt;         As Allan pointed out, this may need some deeper analysis to<br>
&gt;         the sanei_usb code, but modifications in this file are very<br>
&gt;         sensitive, as they impact all usb devices<br>
&gt;         supported by Sane, not only pixma.<br>
&gt;         As for the 1.0.20 release, I would not recommend to add this<br>
&gt;         change now, as it probably needs deeper testing and<br>
&gt;         understanding.<br>
&gt;<br>
&gt;         In other words, to step further, Wade:<br>
&gt;         Could you give a try with the current Sane CVS files and patch<br>
&gt;         only file sanei_usb.c, see if it is still ok?<br>
&gt;         If not, this means there&#39;s something I did not catch, so we&#39;ll<br>
&gt;         need to talk again to finalize the changes, if any, required<br>
&gt;         for MP730.<br>
&gt;<br>
&gt;         Nicolas<br>
<br>
&gt;<br>
<br>
<br>
</div></div></blockquote></div><br>