[sane-devel] Canon Pixma MX525

Rolf Bensch rolf at bensch-online.de
Mon Mar 10 20:39:21 UTC 2014


Hi Trygve,

The attached patch should fix these issues:
(1) interlacing @ 1200 dpi
(2) 14" legal paper size in ADF mode
(3) button support

I'm not sure that your scanner has button support. The buttons look like
the MX925, and that one has. Please test this so:
(1) set debug level: 'export SANE_DEBUG_PIXMA=11'
(2) press any button (maybe you need to set size, format and dpi in your
scanner's menu)
(3) read button status with 'scanimage -A'

Then you should see something like this:

  Buttons:
    --button-update
        Update button state
[pixma] INTR T=1.714 len=32
[pixma]  00000000:00 40 00 00 00 00 00 00  00 00 00 00 00 00 00 00
[pixma]  00000010:00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
[pixma]
    --button-1 <int> [1] [read-only]
        Button 1
    --button-2 <int> [0] [read-only]
        Button 2
    --original <int> [0] [read-only]
        Type of original to scan
    --target <int> [4] [read-only]
        Target operation type
    --scan-resolution <int> [0] [read-only]
        Scan resolution

To understand sent data please look into the code or sane-pixma man page.

Cheers,
Rolf


Am 10.03.2014 20:00, schrieb Trygve Flathen:
> On Mon, Mar 10, 2014 at 6:17 PM, Rolf Bensch <rolf at bensch-online.de> wrote:
>> ADF paper empty detection is buggy for all MP150 based scanners. If you
>> like to help fixing this issue, please join this thread:
>> http://lists.alioth.debian.org/pipermail/sane-devel/2014-March/032138.html.
>> I cannot fix this by myself 'cause I have no ADF scanner.
> 
> Thanks for the pointer to that thread. By joining the thread, I assume
> you mean use the same subject. I will have a look at the code etc. in
> the near future.
> 
> 
> Meanwhile, I can confirm that the following, except for resolution
> 1200, works as expected (at least by first looks)  on my
> USB-only-connected Pixma MX525, source flatbed:
> 
>    scanimage --resolution 75 > 75.pnm
>    scanimage --resolution 150 > 150.pnm
>    scanimage --resolution 300 > 300.pnm
>    scanimage --resolution 600 > 600.pnm
>    scanimage --resolution 1200 > 1200.pnm
>    scanimage --mode color > color.pnm
>    scanimage --mode gray > gray.pnm
>    scanimage --mode lineart > lineart.pnm
>    scanimage --gamma 0.7  > gamma.pnm
>    scanimage --gamma 4  > gamma4.pnm
>    scanimage -l 100 -t 50 -x 20 -y 20 > pos.pnm
>    scanimage -l 100 -t 150 -x 20 -y 20 --resolution 1200 > 1200small.pnm
>    scanimage --format tiff >x.tiff
>    scanimage -p > x.pnm
> 
> With resolution 1200, there seems to be some interlacing in the output.
> See http://flathen.net/tmp/75.pnm
> and http://flathen.net/tmp/1200.pnm.gz   (287MB, 410MB unpacked)
> and http://flathen.net/tmp/1200small.pnm
> (You need the big one to see clearly.)
> 
> -Trygve
> 
> 
> Some other outputs:
> 
> $ scanimage -V
> scanimage (sane-backends) 1.0.25git; backend version 1.0.25
> $ scanimage -L
> device `pixma:04A91769_12999B' is a CANON Canon PIXMA MX520 Series
> multi-function peripheral
> $ scanimage -A
> 
> All options specific to device `pixma:04A91769_12999B':
>   Scan mode:
>     --resolution auto||75|150|300|600|1200dpi [75]
>         Sets the resolution of the scanned image.
>     --mode auto|Color|Gray|Lineart [Color]
>         Selects the scan mode (e.g., lineart, monochrome, or color).
>     --source Flatbed|Automatic Document Feeder [Flatbed]
>         Selects the scan source (such as a document-feeder). Set source before
>         mode and resolution. Resets mode and resolution to auto values.
>     --button-controlled[=(yes|no)] [no]
>         When enabled, scan process will not start immediately. To proceed,
>         press "SCAN" button (for MP150) or "COLOR" button (for other models).
>         To cancel, press "GRAY" button.
>   Gamma:
>     --custom-gamma[=(auto|yes|no)] [yes]
>         Determines whether a builtin or a custom gamma-table should be used.
>     --gamma-table auto|0..255,...
>         Gamma-correction table.  In color mode this option equally affects the
>         red, green, and blue channels simultaneously (i.e., it is an intensity
>         gamma table).
>     --gamma auto|0.299988..5 [2.2]
>         Changes intensity of midtones
>   Geometry:
>     -l auto|0..216.069mm [0]
>         Top-left x position of scan area.
>     -t auto|0..297.011mm [0]
>         Top-left y position of scan area.
>     -x auto|0..216.069mm [216.069]
>         Width of scan-area.
>     -y auto|0..297.011mm [297.011]
>         Height of scan-area.
>   Buttons:
>     --button-update
>         Update button state
>     --button-1 <int> [0] [read-only]
>         Button 1
>     --button-2 <int> [0] [read-only]
>         Button 2
>     --original <int> [0] [read-only]
>         Type of original to scan
>     --target <int> [0] [read-only]
>         Target operation type
>     --scan-resolution <int> [0] [read-only]
>         Scan resolution
>   Extras:
>     --threshold auto|0..100% (in steps of 1) [inactive]
>         Select minimum-brightness to get a white point
>     --threshold-curve auto|0..127 (in steps of 1) [inactive]
>         Dynamic threshold curve, from light to dark, normally 50-65
> 
> $ scanimage -T
> scanimage: scanning image of size 638x877 pixels at 24 bits/pixel
> scanimage: acquiring RGB frame, 8 bits/sample
> scanimage: reading one scanline, 1914 bytes... PASS
> scanimage: reading one byte... PASS
> scanimage: stepped read, 2 bytes... PASS
> scanimage: stepped read, 4 bytes... PASS
> scanimage: stepped read, 8 bytes... PASS
> scanimage: stepped read, 16 bytes... PASS
> scanimage: stepped read, 32 bytes... PASS
> scanimage: stepped read, 64 bytes... PASS
> scanimage: stepped read, 128 bytes... PASS
> scanimage: stepped read, 256 bytes... PASS
> scanimage: stepped read, 512 bytes... PASS
> scanimage: stepped read, 1024 bytes... PASS
> scanimage: stepped read, 2048 bytes... PASS
> scanimage: stepped read, 2047 bytes... PASS
> scanimage: stepped read, 1023 bytes... PASS
> scanimage: stepped read, 511 bytes... PASS
> scanimage: stepped read, 255 bytes... PASS
> scanimage: stepped read, 127 bytes... PASS
> scanimage: stepped read, 63 bytes... PASS
> scanimage: stepped read, 31 bytes... PASS
> scanimage: stepped read, 15 bytes... PASS
> scanimage: stepped read, 7 bytes... PASS
> scanimage: stepped read, 3 bytes... PASS
> 
-------------- next part --------------
--- ./pixma_mp150.c	2014-03-10 21:09:46.000000000 +0100
+++ ../sane-backends/backend/pixma_mp150.c	2014-03-10 21:15:27.000000000 +0100
@@ -925,6 +925,7 @@
    * poll event with 'scanimage -A' */
   if (s->cfg->pid == MG6200_PID
       || s->cfg->pid == MG6300_PID
+      || s->cfg->pid == MX520_PID
       || s->cfg->pid == MX920_PID)
   /* button no. in buf[7]
    * size in buf[10] 01=A4; 02=Letter; 08=10x15; 09=13x18; 0b=auto
@@ -1120,6 +1121,7 @@
               && s->cfg->pid != MP220_PID
               && s->cfg->pid != MX360_PID
               && s->cfg->pid != MX370_PID
+              && s->cfg->pid != MX520_PID
               && s->cfg->pid != MX890_PID
               && s->cfg->pid != MX920_PID
               && s->cfg->pid != MG3100_PID
@@ -1280,6 +1282,7 @@
         s->cfg->pid == MX410_PID ||
         s->cfg->pid == MX420_PID ||
         s->cfg->pid == MX510_PID ||
+        s->cfg->pid == MX520_PID ||
         s->cfg->pid == MX920_PID ||
         s->cfg->pid == MX7600_PID )
        &&
@@ -1732,7 +1735,7 @@
   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 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, 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 MG2400 Series", "MG2400", MG2400_PID, 600, 0, 0, 638, 877, PIXMA_CAP_CIS),


More information about the sane-devel mailing list