[sane-devel] Canon MP510 support modifications (generation 1)

Gernot Hassenpflug aikishugyo at gmail.com
Tue Aug 10 00:20:23 UTC 2010


On Tue, Aug 10, 2010 at 12:56 AM, Gernot Hassenpflug
<aikishugyo at gmail.com> wrote:
> On Tue, Aug 10, 2010 at 12:31 AM, m. allan noah <kitno455 at gmail.com> wrote:
>> It is not unusual for a machine to need the left and right side of
>> image to fall on some byte boundary of a full width scan, or the delta
>> x to need to be somehow 'even' (number of bytes, number of pixels,
>> etc). Of course, this machine could have some other crazy limits no
>> one has seen before :)
>
> Looks like the MP510 insists on the x start being multiples of 0x20
> (decimal 32) under the Windows driver.
> This is for generation 2 devices, which this is --- I made a mistake
> in writing it is a generation 1 device. Now the trick is to find out
> why the code is not detecting this limitation (i.e., ascertain what
> generation the backend thinks this machine is). Fun!
>
> Regards,
> Gernot
> --
> ISP Asahi-Net: http://asahi-net.jp/en/
> No.1 in Japan by customer satisfaction
> (Nikkei News, 7 July 2010)
>

In file pixma_mp150.c, in the "send_scan_param" function, I added an
exception for the MP510, to do what is done for the generations > 2 in
terms of setting the x parameter. This fixes the problem.

========
  if (mp->generation <= 2)
    {
      data = pixma_newcmd (&mp->cb, cmd_scan_param, 0x30, 0);
      pixma_set_be16 (s->param->xdpi | 0x8000, data + 0x04);
      pixma_set_be16 (s->param->ydpi | 0x8000, data + 0x06);

      if (s->cfg->pid == MP510_PID)
	pixma_set_be32 (s->param->x - s->param->xs, data + 0x08);
      else
	pixma_set_be32 (s->param->x, data + 0x08);

      pixma_set_be32 (s->param->y, data + 0x0c);
      pixma_set_be32 (raw_width, data + 0x10);
      pixma_set_be32 (h, data + 0x14);
      data[0x18] = ((s->param->channels != 1) || is_ccd_grayscale (s))
? 0x08 : 0x04;
      data[0x19] = s->param->depth * ((is_ccd_grayscale (s)) ? 3 :
s->param->channels);	/* bits per pixel */
      data[0x1a] = (is_scanning_from_tpu (s) ? 1 : 0);
      data[0x20] = 0xff;
      data[0x23] = 0x81;
      data[0x26] = 0x02;
      data[0x27] = 0x01;
    }
  else
========

I do not know what other generation 2 devices might exhibit this
problem, the only clue I had was that the support for the MP510 was
classied as "basic" in the SANE support matrix. Now it can be
classified as "complete".

Best regards,
Gernot
-- 
ISP Asahi-Net: http://asahi-net.jp/en/
No.1 in Japan by customer satisfaction
(Nikkei News, 7 July 2010)



More information about the sane-devel mailing list