[sane-devel] Pixma problems: 1200dpi Grayscale and batch mode

John Cotter john.cotter at phonecoop.coop
Tue Apr 28 08:05:19 UTC 2009


Hello,

Can you please take me off your distribution list manually? I get about 30
of these per day. The unsubscribe option below does not seem to be working
fully. Regards John

John Cotter

Lowestoft

Suffolk

United Kingdom

 
 
-----Original Message-----
From: sane-devel-bounces+john.cotter=phonecoop.coop at lists.alioth.debian.org
[mailto:sane-devel-bounces+john.cotter=phonecoop.coop at lists.alioth.debian.or
g] On Behalf Of Wade Fitzpatrick
Sent: 26 April 2009 08:19
To: Nicolas Martin
Cc: sane-devel
Subject: Re: [sane-devel] Pixma problems: 1200dpi Grayscale and batch mode



 <http://waddles.org/content/sane-canon-mp730-driver> Things wrong in
pixma_mp730.c:


1.	Protocol error. The scanner did not like having start_session and
select_source commands sent to it when it already had a session open and was
reading from the ADF.


2.	The maximum resolution for the ADF is only 600dpi. 

3.	The maximum bounds should not apply for the ADF. This is still an
issue. I changed the bounds in the pixma_config_t structure to be able to
accept A4 pages, but the ADF can read up to 39 inches according to Canon's
sales flyer. 

The
<http://waddles.org/sites/waddles.org/files/pixma_mp730_batch_fixes.diff_.tx
t> patch containing fixes 1 and 2 is ready to be applied to CVS now. Fix 3
is not ready yet.

I have solved the ECANCELED problem using a different method. Please review
the patch
<http://waddles.org/sites/waddles.org/files/pixma_proper_finish.diff_.txt>
on my website.

The change to pixma.c is still curious even to me. I found that sometimes
when I was stepping through the code in gdb, it would end successfully
without the ECANCELED return code, but every time I just let it run by
itself, it always returned ECANCELED. By experimenting with different
sleeps, from 10000 to 100000, I found that 30000 gives a successful scan
consistently. I don't understand why it works, it just works.

So now I can scan many A4 pages successfully in batch mode through the ADF
at resolutions 75dpi to 600dpi.

When I add your suggestion to change the way the width is calculated, it
goes back to returning ECANCELED. See the
<http://waddles.org/sites/waddles.org/files/pixma_mp730_rounded_width.txt>
log.

The log of a
<http://waddles.org/sites/waddles.org/files/mp730_1200_gray.txt> 1200dpi
grayscale scan is also attached to my site
<http://waddles.org/content/sane-canon-mp730-driver> .

Cheers,
Wade.


2009/4/26 Nicolas Martin <nicolas.martin at freesurf.fr>


Le samedi 25 avril 2009 à 23:43 +1000, Wade Fitzpatrick a écrit :

> I tried moving the MP730_PID and DEV macro from pixma_mp730.c into
> pixma_imageclass.c but the scanner would not operate at all. It
> attached to the endpoints correctly and could read and write URBs but
> when it came to sending the read_image command (0xd420) it responded
> with a cancel command (0x1515).
> The other imageCLASS devices are all limited to 600dpi which fits
> their specifications but the MP730 is capable of 1200x2400dpi optical.
> Maybe the imageclass driver is not the best reference for MP730.
>

That's normal, there are some differences, so MP730 cannot work out of
the box with the imageclass driver. The idea here was to compare both
mp730 and imageclass files to check differences, if you do this, you'll
see they are very similar.

1/ grayscale issue
Could you now just activate only the pixma trace log:
$ export SANE_DEBUG_PIXMA=11
and put the full error trace in a file, zip it and send it back, I would
like to check if the scanner sent the end scan condition, or if
something special happens at the moment it hangs. Also, how much data it
expected to send versus how much is requested.

2/ End condition canceled by software
I have a clue (but it's only a guess) on what happens here, as this
looks same to what happened for devices in the mp150 file.
The "Canceled by software" end condition was raised because the frontend
expected less data than the scanner was requested to send, so the
backend sends an abort command to the scanner when all its expected data
is received.
In fact, all Pixma devices need a rounded up scan width, older devices
had a 4 or 12 pixels alignment, while recent generations currently all
use 32.
For mp150 devices, the fix was simply to modify the scan width area
requested by the frontend, to take this into account (the round up was
only done for scanner parameters).
Could you try the same in the mp730 file:

in function mp730_check_param(), change the current content:

 sp->depth = 8;         /* FIXME: Does MP730 supports other depth? */
 sp->line_size = calc_raw_width (sp) * sp->channels;

with that:

 sp->depth = 8; /* FIXME: Does MP730 supports other depth? */
 sp->w = calc_raw_width (sp);
 sp->line_size = calc_raw_width (sp) * sp->channels;

and give a try ?
Also, could you take a complete [pixma] only log trace and send it
back ?

Nicolas

>
> Back in the pixma_mp730 driver, when I run a test scan at 1200dpi
> Gray, it reads some image data then the scanner just keeps sending OK
> messages forever. It may be a hardware bug. Here is what it looks
> like:
>
>         [sanei_usb] 3DE02A 2C 2A 29 2B 29 2B 29 2A 29 2B 29 2A 2B 2F
>         2E *,*)+)+)*)+)*+/.
>         [sanei_usb] 3DF02C 2A 2D 2B 2C 2C 2D 29 2C 2E 30 31 32 2F 33
>         37 ,*-+,,-),.012/37
>         [sanei_usb] 3E003D 52 60 65 69 69
>         =R`eii
>         [sanei_usb] sanei_usb_read_bulk: wanted 48646 bytes, got 15878
>         bytes
>         [pixma] IN   T=17.283 len=15878
>
>         [pixma]  00003de0:2a 2c 2a 29 2b 29 2b 29  2a 29 2b 29 2a 2b
>         2f 2e
>         [pixma]  00003df0:2c 2a 2d 2b 2c 2c 2d 29  2c 2e 30 31 32 2f
>         33 37
>         [pixma]  00003e00:3d 52 60 65 69 69
>         [pixma]
>         [sanei_usb] sanei_usb_write_bulk: trying to write 10 bytes
>         [sanei_usb] 000 D4 20 00 00 00 00 00 C0 04
>         00                   . ........
>         [sanei_usb] sanei_usb_write_bulk: wanted 10 bytes, wrote 10
>         bytes
>         [pixma] OUT  T=17.341 len=10
>         [pixma]  00000000:d4 20 00 00 00 00 00 c0  04 00
>         [pixma]
>         [sanei_usb] sanei_usb_read_bulk: trying to read 512 bytes
>         [sanei_usb] 000 06 06 00 00 00
>         00                               ......
>         [sanei_usb] sanei_usb_read_bulk: wanted 512 bytes, got 6 bytes
>         [pixma] IN   T=17.344 len=6
>         [pixma]  00000000:06 06 00 00 00 00
>         [pixma]
>         [sanei_usb] sanei_usb_read_int: trying to read 16 bytes
>         [sanei_usb] sanei_usb_read_int: read failed: Resource
>         temporarily unavailable
>         [sanei_usb] sanei_usb_write_bulk: trying to write 10 bytes
>         [sanei_usb] 000 D4 20 00 00 00 00 00 C0 04
>         00                   . ........
>         [sanei_usb] sanei_usb_write_bulk: wanted 10 bytes, wrote 10
>         bytes
>         [pixma] OUT  T=17.448 len=10
>         [pixma]  00000000:d4 20 00 00 00 00 00 c0  04 00
>         [pixma]
>         [sanei_usb] sanei_usb_read_bulk: trying to read 512 bytes
>         [sanei_usb] 000 06 06 00 00 00
>         00                               ......
>         [sanei_usb] sanei_usb_read_bulk: wanted 512 bytes, got 6 bytes
>         [pixma] IN   T=17.451 len=6
>         [pixma]  00000000:06 06 00 00 00 00
>         [pixma]
>         [sanei_usb] sanei_usb_read_int: trying to read 16 bytes
>         [sanei_usb] sanei_usb_read_int: read failed: Resource
>         temporarily unavailable
>         [sanei_usb] sanei_usb_write_bulk: trying to write 10 bytes
>         [sanei_usb] 000 D4 20 00 00 00 00 00 C0 04
>         00                   . ........
>         [sanei_usb] sanei_usb_write_bulk: wanted 10 bytes, wrote 10
>         bytes
>         [pixma] OUT  T=17.556 len=10
>         [pixma]  00000000:d4 20 00 00 00 00 00 c0  04 00
>         [pixma]
>         [sanei_usb] sanei_usb_read_bulk: trying to read 512 bytes
>         [sanei_usb] 000 06 06 00 00 00
>         00                               ......
>         [sanei_usb] sanei_usb_read_bulk: wanted 512 bytes, got 6 bytes
>         [pixma] IN   T=17.559 len=6
>         [pixma]  00000000:06 06 00 00 00 00
>         [pixma]
>         [sanei_usb] sanei_usb_read_int: trying to read 16 bytes
>         [sanei_usb] sanei_usb_read_int: read failed: Resource
>         temporarily unavailable
>         [sanei_usb] sanei_usb_write_bulk: trying to write 10 bytes
>         [sanei_usb] 000 D4 20 00 00 00 00 00 C0 04
>         00                   . ........
>         [sanei_usb] sanei_usb_write_bulk: wanted 10 bytes, wrote 10
>         bytes
>         [pixma] OUT  T=17.663 len=10
>         [pixma]  00000000:d4 20 00 00 00 00 00 c0  04 00
>         [pixma]
>         [sanei_usb] sanei_usb_read_bulk: trying to read 512 bytes
>         [sanei_usb] 000 06 06 00 00 00
>         00                               ......
>         [sanei_usb] sanei_usb_read_bulk: wanted 512 bytes, got 6 bytes
>         [pixma] IN   T=17.666 len=6
>         [pixma]  00000000:06 06 00 00 00 00


> Regarding the ECANCELED error code on completion, this is the end of a
> successful scan. The image data is fine but the driver sends an
> abort_session command on completion
>
>         [sanei_usb] sanei_usb_write_bulk: trying to write 10 bytes
>         [sanei_usb] 000 D4 20 00 00 00 00 00 C0 04
>         00                   . ........
>         [sanei_usb] sanei_usb_write_bulk: wanted 10 bytes, wrote 10
>         bytes
>         [pixma] OUT  T=3.310 len=10
>         [pixma]  00000000:d4 20 00 00 00 00 00 c0  04 00
>         [pixma]
>         [sanei_usb] sanei_usb_read_bulk: trying to read 512 bytes
>         [sanei_usb] 000 06 06 20 00 37 50 55 55 56 55 56 55 58 55 57
>         56 .. .7PUUVUVUXUWV
>         [sanei_usb] 010 55 56 57 55 54 56 56 58 53 57 5A 58 A7 B6 B8
>         B9 UVWUTVVXSWZX....
>
>         [sanei_usb] sanei_usb_read_bulk: wanted 512 bytes, got 512
>         bytes
>         [pixma] IN   T=3.315 len=512
>         [pixma]  00000000:06 06 20 00 37 50 55 55  56 55 56 55 58 55
>         57 56
>         [pixma]  00000010:55 56 57 55 54 56 56 58  53 57 5a 58 a7 b6
>         b8 b9
>
>         [sanei_usb] sanei_usb_read_bulk: trying to read 48646 bytes
>
>
>         [sanei_usb] 353031 2F 34 2C 2A 3D 25 30 37 3E 30 43 2A 32 3B
>         37 1/4,*=%07>0C*2;7
>         [sanei_usb] 35402B 47 37 44 4A 3A 41 5E 80 63 51 51 50 53 51
>         53 +G7DJ:A^.cQQPSQS
>         [sanei_usb] 355051 52 52 51 50 FF
>         QRRQP.
>         [sanei_usb] sanei_usb_read_bulk: wanted 48646 bytes, got 13654
>         bytes
>         [pixma] IN   T=3.389 len=13654
>
>         [pixma]  00003530:31 2f 34 2c 2a 3d 25 30  37 3e 30 43 2a 32
>         3b 37
>         [pixma]  00003540:2b 47 37 44 4a 3a 41 5e  80 63 51 51 50 53
>         51 53
>         [pixma]  00003550:51 52 52 51 50 ff
>         [pixma]
>         [sanei_usb] sanei_usb_write_bulk: trying to write 10 bytes
>         [sanei_usb] 000 EF 20 00 00 00 00 00 00 00
>         00                   . ........
>         [sanei_usb] sanei_usb_write_bulk: wanted 10 bytes, wrote 10
>         bytes
>         [pixma] OUT  T=3.441 len=10
>         [pixma]  00000000:ef 20 00 00 00 00 00 00  00 00
>         [pixma]
>         [sanei_usb] sanei_usb_read_bulk: trying to read 2 bytes
>         [sanei_usb] 000 06
>         06                                           ..
>         [sanei_usb] sanei_usb_read_bulk: wanted 2 bytes, got 2 bytes
>         [pixma] IN   T=3.444 len=2
>         [pixma]  00000000:06 06
>         [pixma]
>         [sanei_usb] sanei_usb_write_bulk: trying to write 10 bytes
>         [sanei_usb] 000 F3 20 00 00 00 00 00 00 0C
>         00                   . ........
>         [sanei_usb] sanei_usb_write_bulk: wanted 10 bytes, wrote 10
>         bytes
>         [pixma] OUT  T=3.444 len=10
>         [pixma]  00000000:f3 20 00 00 00 00 00 00  0c 00
>         [pixma]
>         [sanei_usb] sanei_usb_read_bulk: trying to read 14 bytes
>         [sanei_usb] 000 06 06 03 01 00 02 03 00 02 00 00 00 00
>         F5       ..............
>         [sanei_usb] sanei_usb_read_bulk: wanted 14 bytes, got 14 bytes
>         [pixma] IN   T=3.449 len=14
>         [pixma]  00000000:06 06 03 01 00 02 03 00  02 00 00 00 00 f5
>         [pixma]
>         [pixma] Current status: paper=1 cal=0 lamp=0
>         [sanei_usb] sanei_usb_write_bulk: trying to write 10 bytes
>         [sanei_usb] 000 F3 20 00 00 00 00 00 00 0C
>         00                   . ........
>         [sanei_usb] sanei_usb_write_bulk: wanted 10 bytes, wrote 10
>         bytes
>         [pixma] OUT  T=3.452 len=10
>         [pixma]  00000000:f3 20 00 00 00 00 00 00  0c 00
>         [pixma]
>         [sanei_usb] sanei_usb_read_bulk: trying to read 14 bytes
>         [sanei_usb] 000 06 06 03 01 00 02 03 00 02 00 00 00 00
>         F5       ..............
>         [sanei_usb] sanei_usb_read_bulk: wanted 14 bytes, got 14 bytes
>         [pixma] IN   T=3.452 len=14
>         [pixma]  00000000:06 06 03 01 00 02 03 00  02 00 00 00 00 f5
>         [pixma]
>         [pixma] Current status: paper=1 cal=0 lamp=0
>         [sanei_usb] sanei_usb_write_bulk: trying to write 20 bytes
>         [sanei_usb] 000 CF 60 00 00 00 00 00 00 0A 00 01 00 00 00 00
>         00 .`..............
>         [sanei_usb] 010 00 00 00
>         FF                                     ....
>         [sanei_usb] sanei_usb_write_bulk: wanted 20 bytes, wrote 20
>         bytes
>         [pixma] OUT  T=3.455 len=20
>         [pixma]  00000000:cf 60 00 00 00 00 00 00  0a 00 01 00 00 00
>         00 00
>         [pixma]  00000010:00 00 00 ff
>         [pixma]
>         [sanei_usb] sanei_usb_read_bulk: trying to read 2 bytes
>         [sanei_usb] 000 06
>         06                                           ..
>         [sanei_usb] sanei_usb_read_bulk: wanted 2 bytes, got 2 bytes
>         [pixma] IN   T=3.459 len=2
>         [pixma]  00000000:06 06
>         [pixma]
>         [pixma] pixma_read_image():cancelled by software
>         [pixma] Reader task terminated: ECANCELED
>         [pixma] pixma_close(): Canon MultiPASS MP730
>         [sanei_usb] sanei_usb_close: closing device 0
>
> I have managed to get some success by adding a small sleep to pixma.c
> but I'm still testing that.
>
> Cheers,
> Wade.
>
>
> Moving from the "MP730 driver broken since pixma-0.12.2" thread...
>
> Nicolas Martin wrote:
> Concerning points 1 and 2 you raise, this is interesting:
>
> The pixma_mp730.c file has been left almost untouched for a while (no
> requests or testing ability so far), so it may be in a less "enhanced"
> state than other ones covering more recent Pixma models, that have
> been
> recently updated.
> Dennis Lou wrote a while back the pixma_imageclass.c file, based on
> the
> pixma_mp730.c file, and which covers several Canon ImageClass models
> in
> the pixma backend. The code has been nicely brushed up, and is now in
> a
> better shape than mp730's one.
> So for the 2 issues you raise, I'll take a look and compare the
> pixma_mp730.c code with pixma_imageclass.c and pixma_mp150.c ,
> probably
> will help a lot to solve those issues, thanks to your cooperation for
> testing and feedback.
>
> Nicolas
>
>
> Le vendredi 24 avril 2009 à 01:19 +1000, Wade Fitzpatrick a écrit :
> > The only problems I can find now are:
>
> >      1. Scanning at 1200dpi Grayscale. Sometimes it hangs depending
> on
> >         the x and y values - the larger the values, the sooner it
> >         fails. If it does succeed, the data is always bogus.
>
> >      2. The return code after a successful scan is always ECANCELED
> >         which causes a problem for batch mode as it will only scan
> one
> >         page. It doesn't seem to matter for single scans.





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20090428/2b5755ac/attachment-0001.htm>


More information about the sane-devel mailing list