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

Rolf Bensch rolf at bensch-online.de
Wed Mar 19 14:20:51 UTC 2014


Hi,


Am 19.03.2014 00:12, schrieb Matthias Peter Walther:
> Hallo Rolf,
> 
> that one screwed it. The scanner scans the first page, starts loading
> the second one and aborts. See the attached log. I inserted 3 papers as
> usual.
> 

This was my fault. Please try attached patch as replacement for last
patch 3.

> The image size is 638x1050 (standard resolution, I think that is 75 or
> 150(?)). The image is in relation much higher than wide as a standard
> German DinA4 paper now, but the filled/scanned area is exact the same,
> last 1mm is still missing and the rest is plain, digital white. I think
> there might be a maximum hight the firmware of the scanner can handle in
> adf mode. How can we smartly test that? Or do we have to do that by hand?
> 

Yes, maximum paper height is 1050 px @ 75 dpi. The ADF units stops
scanning at paper end and the frontend saves excepted paper height of
1050 px, except the frontend (user) sets a shorter height.

> There's another adf related iussue: If something goes wrong with the
> hardware/pulling in of the papers, sane aborts and gets status 9. The
> only way to get the device out of this and to work again, is to restart
> the device or to once load the binary and close it. Could you look into
> there, if there is a command to reset the scanner somehow? See second
> log attached, tested with patch1+2 only.
> 

Please send me a log file with enabled usb outputs (export
SANE_DEBUG_PIXMA=11).

Cheers,
Rolf
-------------- next part --------------
--- ./pixma_mp150.c	2014-03-18 21:57:18.000000000 +0100
+++ ../sane-backends/backend/pixma_mp150.c	2014-03-18 22:11:32.000000000 +0100
@@ -1273,22 +1273,8 @@
     
   /* Some exceptions here for particular devices */
   /* Those devices can scan up to 14" with ADF, but A4 11.7" in flatbed */
-  if (( s->cfg->pid == MX850_PID ||
-        s->cfg->pid == MX860_PID ||
-        s->cfg->pid == MX870_PID ||
-        s->cfg->pid == MX880_PID ||
-        s->cfg->pid == MX320_PID ||
-        s->cfg->pid == MX330_PID ||
-        s->cfg->pid == MX340_PID ||
-        s->cfg->pid == MX350_PID ||
-        s->cfg->pid == MX360_PID ||
-        s->cfg->pid == MX410_PID ||
-        s->cfg->pid == MX420_PID ||
-        s->cfg->pid == MX510_PID ||
-        s->cfg->pid == MX920_PID ||
-        s->cfg->pid == MX7600_PID )
-       &&
-        sp->source == PIXMA_SOURCE_FLATBED)
+  /* PIXMA_CAP_ADF also works for PIXMA_CAP_ADFDUP */
+  if ((s->cfg->cap & PIXMA_CAP_ADF) && sp->source == PIXMA_SOURCE_FLATBED)
     sp->h = MIN (sp->h, 877 * sp->xdpi / 75);
     
   if (sp->source == PIXMA_SOURCE_TPU)
@@ -1343,8 +1329,7 @@
 
   /* Generation 4: send XML dialog */
   /* adf: first page or idle */
-  if ((mp->generation == 4 && s->param->adf_pageid == 0) ||
-      mp->adf_state == state_idle)
+  if (mp->generation == 4 && mp->adf_state == state_idle)
     {
       if (!send_xml_dialog (s, XML_START_1))
         return PIXMA_EPROTO;
@@ -1402,10 +1387,8 @@
 
   tmo = 10;
   /* adf: first page or idle */
-  if ((s->param->adf_pageid == 0 || mp->generation <= 2) ||
-      mp->adf_state == state_idle)
+  if (mp->generation <= 2 || mp->adf_state == state_idle)
     { /* single sheet or first sheet from ADF */
-      /* TODO: s->param->adf_pageid != 0 @ next scan session! */
       PDBG (pixma_dbg (4, "*mp150_scan***** start scanning *****\n"));
       error = start_session (s);
       while (error == PIXMA_EBUSY && --tmo >= 0)
@@ -1505,11 +1488,6 @@
         return PIXMA_ECANCELED;
       if ((mp->last_block & 0x28) == 0x28)
         {  /* end of image */
-           /* TODO: reset ADF page counter here!
-            *       there are 2 counters: s->param->adf_pageid == sp->adf_pageid and
-            *                             ss->page_count (see pixma.c)
-            *       OR
-            *       define a new parameter in mp150_t for new session detection in mp150_scan() */
            PDBG (pixma_dbg (4, "*mp150_fill_buffer***** end of image  *****\n"));
            mp->state = state_finished;
            return 0;
@@ -1686,8 +1664,8 @@
   DEVICE ("Canon PIXMA MP610", "MP610", MP610_PID, 4800, 0, 0, 638, 877, PIXMA_CAP_CIS),
 
   DEVICE ("Canon PIXMA MX300", "MX300", MX300_PID, 600, 0, 0, 638, 877, PIXMA_CAP_CIS),
-  DEVICE ("Canon PIXMA MX310", "MX310", MX310_PID, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS | PIXMA_CAP_ADF),
-  DEVICE ("Canon PIXMA MX700", "MX700", MX700_PID, 2400, 0, 0, 638, 877, PIXMA_CAP_CIS | PIXMA_CAP_ADF),
+  DEVICE ("Canon PIXMA MX310", "MX310", MX310_PID, 1200, 0, 0, 638, 1050, PIXMA_CAP_CIS | PIXMA_CAP_ADF),
+  DEVICE ("Canon PIXMA MX700", "MX700", MX700_PID, 2400, 0, 0, 638, 1050, PIXMA_CAP_CIS | PIXMA_CAP_ADF),
   DEVICE ("Canon PIXMA MX850", "MX850", MX850_PID, 2400, 0, 0, 638, 1050, PIXMA_CAP_CIS | PIXMA_CAP_ADFDUP),
   DEVICE ("Canon PIXMA MX7600", "MX7600", MX7600_PID, 4800, 0, 0, 638, 1050, PIXMA_CAP_CIS | PIXMA_CAP_ADFDUP),
 
@@ -1716,7 +1694,7 @@
   DEVICE ("Canon PIXMA MX360", "MX360", MX360_PID, 1200, 0, 0, 638, 1050, PIXMA_CAP_CIS | PIXMA_CAP_ADF),
   DEVICE ("Canon PIXMA MX410", "MX410", MX410_PID, 1200, 0, 0, 638, 1050, PIXMA_CAP_CIS | PIXMA_CAP_ADF),
   DEVICE ("Canon PIXMA MX420", "MX420", MX420_PID, 1200, 0, 0, 638, 1050, PIXMA_CAP_CIS | PIXMA_CAP_ADF),
-  DEVICE ("Canon PIXMA MX880 Series", "MX880", MX880_PID, 2400, 0, 0, 638, 877, PIXMA_CAP_CIS | PIXMA_CAP_ADFDUP),
+  DEVICE ("Canon PIXMA MX880 Series", "MX880", MX880_PID, 2400, 0, 0, 638, 1050, PIXMA_CAP_CIS | PIXMA_CAP_ADFDUP),
 
   /* Generation 4: CIS */
   DEVICE ("Canon PIXMA MP640", "MP640", MP640_PID, 4800, 0, 0, 638, 877, PIXMA_CAP_CIS),
@@ -1743,27 +1721,27 @@
   DEVICE ("Canon PIXMA E500",   "E500",   E500_PID,   1200, 0, 0, 638, 877, PIXMA_CAP_CIS),
 
   /* Latest devices (2012) Generation 4 CIS */
-  DEVICE ("Canon PIXMA MX370 Series", "MX370", MX370_PID, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS | PIXMA_CAP_ADF),
-  DEVICE ("Canon PIXMA MX430 Series", "MX430", MX430_PID, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS | PIXMA_CAP_ADF),
+  DEVICE ("Canon PIXMA MX370 Series", "MX370", MX370_PID, 1200, 0, 0, 638, 1050, PIXMA_CAP_CIS | PIXMA_CAP_ADF),
+  DEVICE ("Canon PIXMA MX430 Series", "MX430", MX430_PID, 1200, 0, 0, 638, 1050, PIXMA_CAP_CIS | PIXMA_CAP_ADF),
   DEVICE ("Canon PIXMA MX510 Series", "MX510", MX510_PID, 1200, 0, 0, 638, 1050, PIXMA_CAP_CIS | PIXMA_CAP_ADF),
-  DEVICE ("Canon PIXMA MX710 Series", "MX710", MX710_PID, 2400, 0, 0, 638, 877, PIXMA_CAP_CIS | PIXMA_CAP_ADFDUP),
-  DEVICE ("Canon PIXMA MX890 Series", "MX890", MX890_PID, 2400, 0, 0, 638, 877, PIXMA_CAP_CIS | PIXMA_CAP_ADFDUP),
-  DEVICE ("Canon PIXMA E600 Series",  "E600",  E600_PID,  1200, 0, 0, 638, 877, PIXMA_CAP_CIS | PIXMA_CAP_ADF),
+  DEVICE ("Canon PIXMA MX710 Series", "MX710", MX710_PID, 2400, 0, 0, 638, 1050, PIXMA_CAP_CIS | PIXMA_CAP_ADFDUP),
+  DEVICE ("Canon PIXMA MX890 Series", "MX890", MX890_PID, 2400, 0, 0, 638, 1050, PIXMA_CAP_CIS | PIXMA_CAP_ADFDUP),
+  DEVICE ("Canon PIXMA E600 Series",  "E600",  E600_PID,  1200, 0, 0, 638, 1050, PIXMA_CAP_CIS | PIXMA_CAP_ADF),
   DEVICE ("Canon PIXMA MG4200", "MG4200", MG4200_PID, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS),
 
   /* Latest devices (2013) Generation 4 CIS */
   DEVICE ("Canon PIXMA E510",  "E510",  E510_PID,  1200, 0, 0, 638, 877, PIXMA_CAP_CIS),
-  DEVICE ("Canon PIXMA E610",  "E610",  E610_PID,  1200, 0, 0, 638, 877, PIXMA_CAP_CIS | PIXMA_CAP_ADF),
+  DEVICE ("Canon PIXMA E610",  "E610",  E610_PID,  1200, 0, 0, 638, 1050, PIXMA_CAP_CIS | PIXMA_CAP_ADF),
   DEVICE ("Canon PIXMA MP230", "MP230", MP230_PID, 600, 0, 0, 638, 877, PIXMA_CAP_CIS),
   DEVICE ("Canon PIXMA MG2200 Series", "MG2200", MG2200_PID, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS),
   DEVICE ("Canon PIXMA MG3200 Series", "MG3200", MG3200_PID, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS),
   DEVICE ("Canon PIXMA MG5400 Series", "MG5400", MG5400_PID, 2400, 0, 0, 638, 877, PIXMA_CAP_CIS),
   DEVICE ("Canon PIXMA MG6300 Series", "MG6300", MG6300_PID, 2400, 0, 0, 638, 877, PIXMA_CAP_CIS),
-  DEVICE ("Canon PIXMA MX390 Series", "MX390", MX390_PID, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS | PIXMA_CAP_ADF),
-  DEVICE ("Canon PIXMA MX450 Series", "MX450", MX450_PID, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS | PIXMA_CAP_ADF),
-  DEVICE ("Canon PIXMA MX520 Series", "MX520", MX520_PID, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS | PIXMA_CAP_ADF),
-  DEVICE ("Canon PIXMA MX720 Series", "MX720", MX720_PID, 2400, 0, 0, 638, 877, PIXMA_CAP_CIS | PIXMA_CAP_ADF),
-  DEVICE ("Canon PIXMA MX920 Series", "MX920", MX920_PID, 2400, 0, 600, 638, 877, PIXMA_CAP_CIS | PIXMA_CAP_ADFDUP),
+  DEVICE ("Canon PIXMA MX390 Series", "MX390", MX390_PID, 1200, 0, 0, 638, 1050, PIXMA_CAP_CIS | PIXMA_CAP_ADF),
+  DEVICE ("Canon PIXMA MX450 Series", "MX450", MX450_PID, 1200, 0, 0, 638, 1050, PIXMA_CAP_CIS | PIXMA_CAP_ADF),
+  DEVICE ("Canon PIXMA MX520 Series", "MX520", MX520_PID, 1200, 0, 0, 638, 1050, PIXMA_CAP_CIS | PIXMA_CAP_ADF),
+  DEVICE ("Canon PIXMA MX720 Series", "MX720", MX720_PID, 2400, 0, 0, 638, 1050, PIXMA_CAP_CIS | PIXMA_CAP_ADF),
+  DEVICE ("Canon PIXMA MX920 Series", "MX920", MX920_PID, 2400, 0, 600, 638, 1050, PIXMA_CAP_CIS | PIXMA_CAP_ADFDUP),
   DEVICE ("Canon PIXMA MG2400 Series", "MG2400", MG2400_PID, 600, 0, 0, 638, 877, PIXMA_CAP_CIS),
   DEVICE ("Canon PIXMA MG2500 Series", "MG2500", MG2500_PID, 600, 0, 0, 638, 877, PIXMA_CAP_CIS),
   DEVICE ("Canon PIXMA MG3500 Series", "MG3500", MG3500_PID, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS),


More information about the sane-devel mailing list