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

Rolf Bensch rolf at bensch-online.de
Tue Mar 18 21:39:53 UTC 2014


Hi,

Am 18.03.2014 00:16, schrieb Matthias Peter Walther:
> 
> scan passes through, and it is possible to do multiple scans in a row.
> Also tested with resolution 300.
> 

This is a good message.

> Two issues:
> 
>  - image is too width (binary detects page width somehow automatically)

It seems so, but binary does!

Binary image is 2479 pixels wide and pixma has 2552 pixels. It seems
that binary crops image width to hide ADF frame and pixma doesn't.

>  - image not high enough, last 1-1.5 mm of the page are missing. But
> this is the same with the binary package from canon. See that white
> stripe at the end.
> 

It seems that ADF cannot scan whole page length. Binary crops here, too.
Pixma saves the expected image height of 3508 pixels.

You can investigate this behaviour @ 75 dpi, if you like. Otherwise you
can set the scan size (x, y positions and width, height) in the frontend
to crop ADF frames by yourself.

I prepared a new patch with these fixes (based on patch 2):
(1) remove s->param->adf_pageid to avoid doubled coded functions.
(2) all ADF scanners support 14" legal paper size in ADF mode, but only
A4 in flatbed mode.

Please test this patch again and try to use it in your productive work.

If everything is OK, I'll commit this patch and we can close the ADF
paper empty issue.

Many thanks for your help.

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