[sane-devel] New scanner Canon MF4770N Multi function

Rolf Bensch rolf at bensch-online.de
Fri Sep 20 20:14:14 UTC 2013


Hi Ralph,

I found a patch for different flatbed (platen) and ADF page length
handling. I adapted this for your scanner. Your scanner supports 11" for
flatbed (platen) and 14" for ADF.

Cheers,
Rolf


Am 20.09.2013 16:47, schrieb Rolf Bensch:
> Hi Ralph,
>
> Am 20.09.2013 06:34, schrieb littlesincanada:
>> Hi Rolf,
>> OK, diff included for pixma-imageclass.c to git unstable.
>>
>> I figured out the issue with the underrun: when the printer is scanning
>> with the ADF for Preview (full area scan), it auto detects the end of
>> paper and terminates the scan earlier than the sane driver is expecting.
>> It sees the end of the paper and knows to stop at that point (nothing
>> left to scan).
>>
> Here the backend expects maximum paper length if you don't request a
> smaller format from scanimage or xsane. The scanner stops scanning when
> the paper went through the document feeder.
>
>> It cannot do this when scanning from the platen since it doesn't know
>> where the end of the page is. Therefore, I don't get the warning when
>> Previewing from the platen.
>>
> Sure, the scanner expects 11.7" paper length, but your scanner supports
> only 11". Please replace the device define line with this one:
>
> DEV ("Canon imageCLASS MF4770n", "MF4770", MF4770_PID, 600, 640, 825,
> PIXMA_CAP_ADF),
>
> This should fix this issue. Please report if this is successful. Then
> I'll commit your patch to git.
>
> If you don't want to scan large documents above 11" on the document
> feeder, I'll patch this later.
>
>> I couldn't really get any response from the buttons. My time with the
>> printer is running out (I have to ship it to my daughter in Uni) so I'm
>> going to have to call it a do at that.
>>
> You can check button support with scanimage. Please follow these items
> for debugging:
>
> (1) Connect your scanner to the usb bus.
> (2) 'export SANE_DEBUG_PIXMA=11' on the console.
> (3) Press any button.
> (4) 'scanimage -A' on the console.
>
> The response from scanimage should contain these lines:
>
>   Buttons:
>     --button-update
>         Update button state
> [pixma] INTR T=1.655 len=32
> [pixma]  00000000:00 10 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> [1] [read-only]
>         Target operation type
>     --scan-resolution <int> [0] [read-only]
>         Scan resolution
>
> The [pixma] lines are from my scanner which is different from yours.
>
> (5) repeat from (3) for all other buttons.
>
> Please send me the [pixma] responses for all buttons. Then I can create
> a patch for this.
>
> If you won't get [pixma] debug lines SANE doesn't support the buttons
> from your scanner.
>
> Cheers,
> Rolf

-------------- next part --------------
--- ./pixma_imageclass.c	2013-09-20 21:38:26.000000000 +0200
+++ ../sane-backends/backend/pixma_imageclass.c	2013-09-20 22:09:38.000000000 +0200
@@ -510,6 +510,13 @@
 
   sp->depth = 8;
   sp->line_size = ALIGN_SUP (sp->w, 32) * sp->channels;
+
+  /* Some exceptions here for particular devices */
+  /* Those devices can scan up to 14" with ADF, but Letter 11" in flatbed */
+  if (sp->source == PIXMA_SOURCE_FLATBED
+      && ( s->cfg->pid == MF4770_PID ))
+    sp->h = MIN (sp->h, 825 * sp->xdpi / 75);
+
   return 0;
 }
 
@@ -778,7 +785,7 @@
   DEV ("Canon imageCLASS MF4410", "MF4410", MF4410_PID, 600, 640, 877, PIXMA_CAP_ADF),
   DEV ("Canon i-SENSYS MF4550d", "MF4550", MF4550_PID, 600, 640, 877, PIXMA_CAP_ADF),
   DEV ("Canon i-SENSYS MF3010", "MF3010", MF3010_PID, 600, 640, 877, 0),
-  DEV ("Canon imageCLASS MF4770n", "MF4770", MF4770_PID, 600, 640, 825, PIXMA_CAP_ADF),
+  DEV ("Canon imageCLASS MF4770n", "MF4770", MF4770_PID, 600, 640, 1050, PIXMA_CAP_ADF),
   /* FIXME: the following capabilities all need updating/verifying */
   DEV ("Canon imageCLASS MF5630", "MF5630", MF5630_PID, 600, 640, 877, PIXMA_CAP_ADF),
   DEV ("Canon laserBase MF5650", "MF5650", MF5650_PID, 600, 640, 877, PIXMA_CAP_ADF),


More information about the sane-devel mailing list