[sane-devel] New scanner Canon MF4770N Multi function

2013-09-24 Thread Rolf Bensch
Hi Ralph,

I just committed your patch to git. I also edited some doc files and set
the scanner to status :good due to buggy ADF.

Maybe you'll have access to the scanner again in future. Then we can fix
buggy ADF.

Many thanks for your help.

Cheers,
Rolf


Am 21.09.2013 17:24, schrieb littlesincanada:
 Hi,
 Final patch included.
 
 The ADF dirty fix did the job for me: after the first scan subsequent
 pages are ejected from the ADF.
 I have not included it in the patch file though.
 
 I wish I had the time to have a go at this, but I only have the scanner
 today and lots of other stuff to do :(
 
 Anyway, apart from all that, it's great! Fully functional scanning and
 no errors.
 Contributing is cool.
 
 BTW: udev rule (I don't know if this is supplied by sane or the distro,
 but here it is anyway):
 
 # Canon imageCLASS MF4770N
 ATTRS{idVendor}==04a9, ATTRS{idProduct}==2774,
 ENV{libsane_matched}=yes
 
 Until next time!
 
 Cheers,
 Ralph
 
 
 On 21/09/13 00:50, Rolf Bensch wrote:
 Hi Ralph,

 Am 21.09.2013 07:39, schrieb littlesincanada:
 Hi Rolf,
 Enclosed is the output file for the ADF multi page issue.
 As before, I load up 2 pages into the ADF.
 On first scan with xsane, the first page is pulled through and scanned
 normally.
 As the first page is finishing, the ADF starts to draw through the
 second page (like a fax machine typically does), then waits with it
 after the first page is finished.
 The trace in the enclosed file acknowledges that the ADF still has some
 pages in it.
 The scanner Processing/Data light is flashing so the scanner thinks that
 a job is still in progress.

 When I try to scan the next sheet, the trace shows that xsane thinks the
 scanner is busy and cannot proceed.

 Maybe attached dirty patch will help for this issue.

 The problem is that the backend doesn't recognize that a 2nd page starts
 scanning. Therefore it starts with the start session command. Normally a
 scan is closed with the abort session command, but not a multi page scan
 session. It is waiting for the next page and sends the abort session
 command after the last page has been scanned.

 But maybe it is too complicated and we should follow KISS: A complete
 scan session for each single page. We can do this here because we don't
 use gama tables and other calibration for the scanner. But maybe this
 will cause other problems with the frontend (batch scan).

 The main control variables are in pixma.c in pixma_sane_t: idle and
 page_cout.

 =

 BTW, the flatbed will actually do the full  11.7 so please put the
 flatbed scan height back to 877:

 In iclass_check_param():
  sp-h = MIN (sp-h, 877 * sp-xdpi / 75);

 The ADF will indeed scan legal up to 14 in length.
 Apart from that everything looks cool.

 OK

 It is a shame that we have dimension information hidden in the
 iclass_check_param() function.
 We could do with adding an extra entry in pixma_config_t for separate
 ADF/flatbed geometry.

 Indeed. This was a quick paste and copy patch. I'll patch this later. I
 did this before for e.g. adftpu_min_dpi.

 On Sunday, I have to say bye-bye to the printer, so from then on, I
 cannot do anything further :(
 There might be some time for me to look at the ADF issue tomorrow
 (Saturday) and test any further patches.

 Sorry, I have no time to create any further patches today.

 Maybe you can solve this by yorself. Please send your final patch, so
 that I can add this to git.

 Many thanks for your help.

 Cheers,
 Rolf
 



[sane-devel] New scanner Canon MF4770N Multi function

2013-09-24 Thread Ralph Little
Hi,
Yes indeed if I get some time with it in the future I will work to resolve this.
I wonder how many of the other imageClass printers in this range have the same 
issue with their ADFs or if this is something that is new to this family of 
scanners.

Cheers,
Ralph






 From: Rolf Bensch rolf at bensch-online.de
To: littlesincanada littlesincanada at yahoo.co.uk 
Cc: Sane Development sane-devel at lists.alioth.debian.org 
Sent: Tuesday, September 24, 2013 12:31:44 PM
Subject: Re: [sane-devel] New scanner Canon MF4770N Multi function
 

Hi Ralph,

I just committed your patch to git. I also edited some doc files and set
the scanner to status :good due to buggy ADF.

Maybe you'll have access to the scanner again in future. Then we can fix
buggy ADF.

Many thanks for your help.

Cheers,
Rolf


Am 21.09.2013 17:24, schrieb littlesincanada:
 Hi,
 Final patch included.
 
 The ADF dirty fix did the job for me: after the first scan subsequent
 pages are ejected from the ADF.
 I have not included it in the patch file though.
 
 I wish I had the time to have a go at this, but I only have the scanner
 today and lots of other stuff to do :(
 
 Anyway, apart from all that, it's great! Fully functional scanning and
 no errors.
 Contributing is cool.
 
 BTW: udev rule (I don't know if this is supplied by sane or the distro,
 but here it is anyway):
 
 # Canon imageCLASS MF4770N
 ATTRS{idVendor}==04a9, ATTRS{idProduct}==2774,
 ENV{libsane_matched}=yes
 
 Until next time!
 
 Cheers,
 Ralph
 
 
 On 21/09/13 00:50, Rolf Bensch wrote:
 Hi Ralph,

 Am 21.09.2013 07:39, schrieb littlesincanada:
 Hi Rolf,
 Enclosed is the output file for the ADF multi page issue.
 As before, I load up 2 pages into the ADF.
 On first scan with xsane, the first page is pulled through and scanned
 normally.
 As the first page is finishing, the ADF starts to draw through the
 second page (like a fax machine typically does), then waits with it
 after the first page is finished.
 The trace in the enclosed file acknowledges that the ADF still has some
 pages in it.
 The scanner Processing/Data light is flashing so the scanner thinks that
 a job is still in progress.

 When I try to scan the next sheet, the trace shows that xsane thinks the
 scanner is busy and cannot proceed.

 Maybe attached dirty patch will help for this issue.

 The problem is that the backend doesn't recognize that a 2nd page starts
 scanning. Therefore it starts with the start session command. Normally a
 scan is closed with the abort session command, but not a multi page scan
 session. It is waiting for the next page and sends the abort session
 command after the last page has been scanned.

 But maybe it is too complicated and we should follow KISS: A complete
 scan session for each single page. We can do this here because we don't
 use gama tables and other calibration for the scanner. But maybe this
 will cause other problems with the frontend (batch scan).

 The main control variables are in pixma.c in pixma_sane_t: idle and
 page_cout.

 =

 BTW, the flatbed will actually do the full? 11.7 so please put the
 flatbed scan height back to 877:

 In iclass_check_param():
? ? ? sp-h = MIN (sp-h, 877 * sp-xdpi / 75);

 The ADF will indeed scan legal up to 14 in length.
 Apart from that everything looks cool.

 OK

 It is a shame that we have dimension information hidden in the
 iclass_check_param() function.
 We could do with adding an extra entry in pixma_config_t for separate
 ADF/flatbed geometry.

 Indeed. This was a quick paste and copy patch. I'll patch this later. I
 did this before for e.g. adftpu_min_dpi.

 On Sunday, I have to say bye-bye to the printer, so from then on, I
 cannot do anything further :(
 There might be some time for me to look at the ADF issue tomorrow
 (Saturday) and test any further patches.

 Sorry, I have no time to create any further patches today.

 Maybe you can solve this by yorself. Please send your final patch, so
 that I can add this to git.

 Many thanks for your help.

 Cheers,
 Rolf
 



-- next part --
An HTML attachment was scrubbed...
URL: 
http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20130924/68c10e21/attachment.html


[sane-devel] New scanner Canon MF4770N Multi function

2013-09-21 Thread Rolf Bensch
Hi Ralph,

Please log the USB protocols of a multipage ADF scan with 'export
SANE_DEBUG_PIXMA=11' and 'xsane 2 pixma.log'. The log file will be too
big for the ml. Please send it off list to my email address.

Cheers,
Rolf

Am 20.09.2013 23:20, schrieb Ralph Little:
 Hi,
 Something else that didn't quite work during last night's testing was
 loading multiple pages into the ADF.
 Using xsane, the first scan works fine.
 However, the ADF starts to load the second page towards the end of the
 first scan (fax-style) and appears to be waiting for xsane to request it.
 xsane reckons that it is finished but the scanner is not. It ends up in
 a strange situation where the scanner and xsane are out of sync.
 
 While in this state, xsane will not perform a scan because the scanner
 is busy.
 Everything is fine after the scan is cancelled on the scanner panel.
 xsane is not expecting to be doing multiple scans in this setup.
 Perhaps the pixma driver can detect this situation and issue a cancel to
 the scanner?
 It could perform the first scan, detect if there is paper still in the
 scanner and if so, send an abort to the scanner.
 
 If I get time, I will play around with this tonight, but my time with
 the unit is running out.
 Shame, this is a lot of fun.
 
 Cheers,
 Ralph
 
 
 
 *From:* Rolf Bensch rolf at bensch-online.de
 *To:* littlesincanada littlesincanada at yahoo.co.uk
 *Cc:* sane-devel at lists.alioth.debian.org
 *Sent:* Friday, September 20, 2013 1:14:14 PM
 *Subject:* Re: [sane-devel] New scanner Canon MF4770N Multi function
 
 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]  :00 10 00 00 00 00 00 00  00 00 00 00 00 00 00 00
  [pixma]  0010: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
 
 
 



[sane-devel] New scanner Canon MF4770N Multi function

2013-09-20 Thread 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]  :00 10 00 00 00 00 00 00  00 00 00 00 00 00 00 00
[pixma]  0010: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



[sane-devel] New scanner Canon MF4770N Multi function

2013-09-20 Thread Ralph Little
Hi Rolf,
If the scanner is stopping scanning on a paper-end detector in the ADF (which I 
suspect it is, although I can't be sure), then it might stop at any arbitrary 
point even in preview mode. I only get the underrun warning when requesting a 
preview from the ADF. It could be as you say and the scanner is designed to 
scan a maximum? of 11 from the ADF.

I will try your change and see what happens, though and I will try the ADF with 
shorter paper to see what happens. I suspect that what sane gets is arbitrarily 
determined by the physical length of the paper.


I did try the buttons on the scanner. When in remote mode for computer 
scanning, none of the buttons seem to cause a USB interrupt. They all double 
beep which indicates that press is invalid. I'm not sure which buttons would 
be expected to work in this context. 


Here is a good picture of the panel:

http://bimg2.mlstatic.com/impresora-multifuncional-laser-canon-image-class-mf4770n_MLV-F-4579386679_072013.jpg

If you have a chance, could you have a look and let me know which buttons are 
customarily used? There are no Colour/Grey/Scan buttons as such. The OK buttom 
might have served this purpose, but it is inactive in scan mode.

There are only two which might seem to fit this bill on the far right hand 
side: ScanPC1 and ScanPC2 which I think is intended for network scanning, 
a setup that I have not tried.

I will let you know tonight.

Cheers and thanks again for your help,

Ralph






 From: Rolf Bensch rolf at bensch-online.de
To: littlesincanada littlesincanada at yahoo.co.uk 
Cc: sane-devel at lists.alioth.debian.org 
Sent: Friday, September 20, 2013 7:47:02 AM
Subject: Re: [sane-devel] New scanner Canon MF4770N Multi function
 

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]? :00 10 00 00 00 00 00 00? 00 00 00 00 00 00 00 00
[pixma]? 0010: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 --
An HTML attachment was scrubbed...
URL: 
http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20130920/f3049ff9/attachment-0001.html


[sane-devel] New scanner Canon MF4770N Multi function

2013-09-20 Thread Rolf Bensch
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]  :00 10 00 00 00 00 00 00  00 00 00 00 00 00 00 00
 [pixma]  0010: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.c2013-09-20 21:38:26.0 +0200
+++ ../sane-backends/backend/pixma_imageclass.c 2013-09-20 22:09:38.0 
+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),


[sane-devel] New scanner Canon MF4770N Multi function

2013-09-20 Thread Ralph Little
Hi,
Something else that didn't quite work during last night's testing was loading 
multiple pages into the ADF.
Using xsane, the first scan works fine. 
However, the ADF starts to load the second page towards the end of the first 
scan (fax-style) and appears to be waiting for xsane to request it.
xsane reckons that it is finished but the scanner is not. It ends up in a 
strange situation where the scanner and xsane are out of sync.

While in this state, xsane will not perform a scan because the scanner is busy. 
Everything is fine after the scan is cancelled on the scanner panel.
xsane is not expecting to be doing multiple scans in this setup.
Perhaps the pixma driver can detect this situation and issue a cancel to the 
scanner? 
It could perform the first scan, detect if there is paper still in the scanner 
and if so, send an abort to the scanner.

If I get time, I will play around with this tonight, but my time with the unit 
is running out.
Shame, this is a lot of fun.

Cheers,
Ralph






 From: Rolf Bensch rolf at bensch-online.de
To: littlesincanada littlesincanada at yahoo.co.uk 
Cc: sane-devel at lists.alioth.debian.org 
Sent: Friday, September 20, 2013 1:14:14 PM
Subject: Re: [sane-devel] New scanner Canon MF4770N Multi function
 

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]? :00 10 00 00 00 00 00 00? 00 00 00 00 00 00 00 00
 [pixma]? 0010: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 --
An HTML attachment was scrubbed...
URL: 
http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20130920/f28b0884/attachment.html


[sane-devel] New scanner Canon MF4770N Multi function

2013-09-19 Thread littlesincanada
Hi,
OK further to this I have managed to get the ADF working.
Can someone who knows about Canon pixma printers give me a little 
assistance?

Firstly, the ADF:
In pixma_imageclass.c

I had to modify the has_paper() function to:

static int
has_paper (pixma_t * s)
{
   iclass_t *mf = (iclass_t *) s-subdriver;
   return ((mf-current_status[1] == 0) ||
  ((mf-current_status[1] == 0x10)  (s-cfg-pid == MF4770_PID)));
}

The paper in the status byte alternates between 0x10 for Paper in ADF 
and 0x01 for (No paper in ADF). This is quite a bit different to the 
other printers which are looking for 0 when there is paper. Anyone know 
why this might be?

Secondly, there seems to be a mismatch in the expected image size and 
that received:

[pixma] WARNING:image size mismatches
[pixma] 1683840 expected (877 lines) but 1614720 received (841 lines)
[pixma] pixma_read_image(): completed (underrun detected)

I'm also getting some of these:

[pixma] *sane_read* Warning: padding may cause incomplete scan results

I'm guessing there is a geometry calculation problem somewhere.

The scan received looks fine so it is obviously overcoming whatever 
difficulty is being detected, however I would like to fix this.
Any help with how I might resolve this?

Cheers,
Ralph



 Original Message 
Subject:New scanner Canon MF4770N Multi function
Date:   Mon, 16 Sep 2013 23:11:00 -0700
From:   littlesincanada littlesincan...@yahoo.co.uk
To: sane-devel at lists.alioth.debian.org



Hi,
I got one of these (Canon MF4770N) and managed to get it to pretty much
work with the MF4410 driver.
I rebuilt the pixma backend and substituted the 4770N pid (04A9-2774)
and I can get scanning *mostly* working.

1) Preview/scan in 75/150/300/600 dpi works fine in both colour and b/w.
I do rarely get an error on the printer and I have to switch it on and
off again. This might be a timing issue I guess.
Cancelling scans works OK.

2) xsane will not print using the ADF. xsane generates an error and
reckons that there is nothing in the ADF.

So, looking for a bit of advice. What can I do to track this down? In
particular, I would like to get the ADF working.

Cheers,
Ralph






[sane-devel] New scanner Canon MF4770N Multi function

2013-09-19 Thread Rolf Bensch
Hi Ralph,

Many thanks for your help adding a new scanner to SANE.

It seems that you're using the sources from the stable version. Please
use the daily git snapshot from here:
http://www.sane-project.org/snapshots/ or use git as described here:
http://www.sane-project.org/README.linux. I already fixed the '0x10
paper in ADF' issue before. Maybe the underrun issue has also been fixed
before.

Please check SANE version with 'scanimage -V'. This should report:
scanimage (sane-backends) 1.0.24git; backend version 1.0.24.

For debugging you can activate debug messages on the console with
'export SANE_DEBUG_PIXMA=4'. If you want to see the USB protocols use
'export SANE_DEBUG_PIXMA=11' or 'export SANE_DEBUG_PIXMA=21'. Then start
xsane or scanimage from the console.

Please read the pixma manpage (man sane-pixma) for more infos.

You can send your patch file to the ml or direct to my email address.
Then I can commit it to git.

Cheers,
Rolf



Am 19.09.2013 08:10, schrieb littlesincanada:
 Hi,
 OK further to this I have managed to get the ADF working.
 Can someone who knows about Canon pixma printers give me a little
 assistance?

 Firstly, the ADF:
 In pixma_imageclass.c

 I had to modify the has_paper() function to:

 static int
 has_paper (pixma_t * s)
 {
   iclass_t *mf = (iclass_t *) s-subdriver;
   return ((mf-current_status[1] == 0) ||
  ((mf-current_status[1] == 0x10)  (s-cfg-pid ==
 MF4770_PID)));
 }

 The paper in the status byte alternates between 0x10 for Paper in
 ADF and 0x01 for (No paper in ADF). This is quite a bit different to
 the other printers which are looking for 0 when there is paper. Anyone
 know why this might be?

 Secondly, there seems to be a mismatch in the expected image size and
 that received:

 [pixma] WARNING:image size mismatches
 [pixma] 1683840 expected (877 lines) but 1614720 received (841 lines)
 [pixma] pixma_read_image(): completed (underrun detected)

 I'm also getting some of these:

 [pixma] *sane_read* Warning: padding may cause incomplete scan
 results

 I'm guessing there is a geometry calculation problem somewhere.

 The scan received looks fine so it is obviously overcoming whatever
 difficulty is being detected, however I would like to fix this.
 Any help with how I might resolve this?

 Cheers,
 Ralph



  Original Message 
 Subject: New scanner Canon MF4770N Multi function
 Date: Mon, 16 Sep 2013 23:11:00 -0700
 From: littlesincanada littlesincanada at yahoo.co.uk
 To: sane-devel at lists.alioth.debian.org



 Hi,
 I got one of these (Canon MF4770N) and managed to get it to pretty much
 work with the MF4410 driver.
 I rebuilt the pixma backend and substituted the 4770N pid (04A9-2774)
 and I can get scanning *mostly* working.

 1) Preview/scan in 75/150/300/600 dpi works fine in both colour and b/w.
 I do rarely get an error on the printer and I have to switch it on and
 off again. This might be a timing issue I guess.
 Cancelling scans works OK.

 2) xsane will not print using the ADF. xsane generates an error and
 reckons that there is nothing in the ADF.

 So, looking for a bit of advice. What can I do to track this down? In
 particular, I would like to get the ADF working.

 Cheers,
 Ralph









[sane-devel] New scanner Canon MF4770N Multi function

2013-09-19 Thread Ralph Little
Hi,
Many thanks.
I will try the latest builds tonight.
I am currently runnin on 1.0.23 via Linux Mint (derived from Ubuntu Ringtail).

One other thing which I would like to look into is that if the pixma driver 
misinterprets the ADF paper situation and attempts to perform a scan anyway, it 
gets locked into a loop while conversing with the scanner and getting errors 
which cannot be user terminated with the cancel button. It appears to be asking 
for an ADF scan but the printer is refusing. I will see if I can get to the 
bottom of that.

I will also look into the panel button notifications.

Cheers!
Ralph






 From: Rolf Bensch rolf at bensch-online.de
To: littlesincanada littlesincanada at yahoo.co.uk; sane-devel at 
lists.alioth.debian.org 
Sent: Thursday, September 19, 2013 12:59:34 PM
Subject: Re: [sane-devel] New scanner Canon MF4770N Multi function
 

Hi Ralph,

Many thanks for your help adding a new scanner to SANE.

It seems that you're using the sources from the stable version. Please
use the daily git snapshot from here:
http://www.sane-project.org/snapshots/ or use git as described here:
http://www.sane-project.org/README.linux. I already fixed the '0x10
paper in ADF' issue before. Maybe the underrun issue has also been fixed
before.

Please check SANE version with 'scanimage -V'. This should report:
scanimage (sane-backends) 1.0.24git; backend version 1.0.24.

For debugging you can activate debug messages on the console with
'export SANE_DEBUG_PIXMA=4'. If you want to see the USB protocols use
'export SANE_DEBUG_PIXMA=11' or 'export SANE_DEBUG_PIXMA=21'. Then start
xsane or scanimage from the console.

Please read the pixma manpage (man sane-pixma) for more infos.

You can send your patch file to the ml or direct to my email address.
Then I can commit it to git.

Cheers,
Rolf



Am 19.09.2013 08:10, schrieb littlesincanada:
 Hi,
 OK further to this I have managed to get the ADF working.
 Can someone who knows about Canon pixma printers give me a little
 assistance?

 Firstly, the ADF:
 In pixma_imageclass.c

 I had to modify the has_paper() function to:

 static int
 has_paper (pixma_t * s)
 {
?  iclass_t *mf = (iclass_t *) s-subdriver;
?  return ((mf-current_status[1] == 0) ||
? ? ? ? ? ((mf-current_status[1] == 0x10)  (s-cfg-pid ==
 MF4770_PID)));
 }

 The paper in the status byte alternates between 0x10 for Paper in
 ADF and 0x01 for (No paper in ADF). This is quite a bit different to
 the other printers which are looking for 0 when there is paper. Anyone
 know why this might be?

 Secondly, there seems to be a mismatch in the expected image size and
 that received:

 [pixma] WARNING:image size mismatches
 [pixma]? ?  1683840 expected (877 lines) but 1614720 received (841 lines)
 [pixma] pixma_read_image(): completed (underrun detected)

 I'm also getting some of these:

 [pixma] *sane_read* Warning: padding may cause incomplete scan
 results

 I'm guessing there is a geometry calculation problem somewhere.

 The scan received looks fine so it is obviously overcoming whatever
 difficulty is being detected, however I would like to fix this.
 Any help with how I might resolve this?

 Cheers,
 Ralph



  Original Message 
 Subject:? ?  New scanner Canon MF4770N Multi function
 Date:? ?  Mon, 16 Sep 2013 23:11:00 -0700
 From:? ?  littlesincanada littlesincanada at yahoo.co.uk
 To:? ? sane-devel at lists.alioth.debian.org



 Hi,
 I got one of these (Canon MF4770N) and managed to get it to pretty much
 work with the MF4410 driver.
 I rebuilt the pixma backend and substituted the 4770N pid (04A9-2774)
 and I can get scanning *mostly* working.

 1) Preview/scan in 75/150/300/600 dpi works fine in both colour and b/w.
 I do rarely get an error on the printer and I have to switch it on and
 off again. This might be a timing issue I guess.
 Cancelling scans works OK.

 2) xsane will not print using the ADF. xsane generates an error and
 reckons that there is nothing in the ADF.

 So, looking for a bit of advice. What can I do to track this down? In
 particular, I would like to get the ADF working.

 Cheers,
 Ralph









-- next part --
An HTML attachment was scrubbed...
URL: 
http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20130919/a72f4eb8/attachment.html


[sane-devel] New scanner Canon MF4770N Multi function

2013-09-19 Thread 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).

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.

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.

Everything else seems to work great!

Cheers,
Ralph


On 19/09/13 12:59, Rolf Bensch wrote:
 export SANE_DEBUG_PIXMA=11

-- next part --
--- orig_pixma_imageclass.c 2013-09-18 11:52:34.0 -0700
+++ pixma_imageclass.c  2013-09-19 20:50:28.316508325 -0700
@@ -81,6 +81,7 @@
 #define MF6500_PID 0x2686
 #define MF4410_PID 0x2737
 #define MF3010_PID 0x2759
+#define MF4770_PID 0x2774
 /* the following are all untested */
 #define MF5630_PID 0x264e
 #define MF5650_PID 0x264f
@@ -279,11 +280,15 @@
   const int hlen = 2 + 6;
 
   memset (mf-cb.buf, 0, 11);
-  pixma_set_be16 (((s-cfg-pid == MF3010_PID || s-cfg-pid == MF4410_PID || 
s-cfg-pid == MF4550_PID) ? cmd_read_image2 : cmd_read_image), mf-cb.buf);
+  pixma_set_be16 (((s-cfg-pid == MF3010_PID ||
+s-cfg-pid == MF4410_PID ||
+s-cfg-pid == MF4770_PID ||
+s-cfg-pid == MF4550_PID) ? cmd_read_image2 : 
cmd_read_image), mf-cb.buf);
   mf-cb.buf[8] = flag;
   mf-cb.buf[10] = 0x06;
   expected_len = (s-cfg-pid == MF3010_PID ||
   s-cfg-pid == MF4410_PID ||
+  s-cfg-pid == MF4770_PID ||
   s-cfg-pid == MF4550_PID ||
   s-cfg-pid == MF4600_PID ||
   s-cfg-pid == MF6500_PID ||
@@ -297,6 +302,7 @@
 
   if (s-cfg-pid == MF3010_PID ||
   s-cfg-pid == MF4410_PID ||
+  s-cfg-pid == MF4770_PID ||
   s-cfg-pid == MF4550_PID ||
   s-cfg-pid == MF4600_PID ||
   s-cfg-pid == MF6500_PID ||
@@ -322,6 +328,7 @@
   
   maxchunksize = MAX_CHUNK_SIZE * ((s-cfg-pid == MF3010_PID ||
 s-cfg-pid == MF4410_PID ||
+s-cfg-pid == MF4770_PID ||
 s-cfg-pid == MF4550_PID ||
 s-cfg-pid == MF4600_PID ||
 s-cfg-pid == MF6500_PID ||
@@ -639,6 +646,7 @@
   if (s-param-channels != 1 
   s-cfg-pid != MF3010_PID 
   s-cfg-pid != MF4410_PID 
+  s-cfg-pid != MF4770_PID 
  s-cfg-pid != MF4550_PID 
  s-cfg-pid != MF4600_PID 
  s-cfg-pid != MF6500_PID 
@@ -770,7 +778,8 @@
   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),
-  /* FIXME: the following capabilities all need updating/verifying */
+  DEV (Canon imageCLASS MF4770n, MF4770, MF4770_PID, 600, 640, 877, 
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),
   DEV (Canon imageCLASS MF8170c, MF8170c, MF8100_PID, 600, 640, 877, 
PIXMA_CAP_ADF),


[sane-devel] New scanner Canon MF4770N Multi function

2013-09-17 Thread littlesincanada
Hi,
I got one of these (Canon MF4770N) and managed to get it to pretty much 
work with the MF4410 driver.
I rebuilt the pixma backend and substituted the 4770N pid (04A9-2774) 
and I can get scanning *mostly* working.

1) Preview/scan in 75/150/300/600 dpi works fine in both colour and b/w.
I do rarely get an error on the printer and I have to switch it on and 
off again. This might be a timing issue I guess.
Cancelling scans works OK.

2) xsane will not print using the ADF. xsane generates an error and 
reckons that there is nothing in the ADF.

So, looking for a bit of advice. What can I do to track this down? In 
particular, I would like to get the ADF working.

Cheers,
Ralph