[sane-devel] Problems with Canon MP990 transparency unit

Guillaume Courtois guigui at gugux.net
Mon Apr 6 15:24:33 UTC 2015


Hi Rolf and the others on the list.

Sorry for not giving back news earlier. I tried to correct the problem 
by myself and it took me some time.
Then I used the corrected version to be sure it was working well, and 
once I had begun, I wanted to finish all the stuff I had to scan.

Well, that is finished now and I can say my patch (which is very simple) 
seem to work quite well, as I was able to scan around 3.000 positives 
with the TPU without issues, at 4.800 DPI. For the record, that is not 
totally true as I have had that greenish color problem a couple of 
times, but I found a not-very-satisfying solution, but an easy one : I 
just scanned one positive from a Windows machine, and then the problem 
was gone and I was able to scan from linux, even when I turned the MP990 
off and on, and let some weeks pass without touching anything. So as it 
was a very-very rare situation, I was not able to find a clean way to 
correct it from linux.

So here is my patch, as It's very short I give it to you here, but I can 
provide a file if needed.

diff --git a/backend/pixma_mp810.c b/backend/pixma_mp810.c
index 59e96eb..5f2588e 100644
--- a/backend/pixma_mp810.c
+++ b/backend/pixma_mp810.c
@@ -657,6 +657,23 @@ static unsigned calc_shifting (pixma_t * s)
        }
        break;

+    case MP990_PID:
+      if (s->param->xdpi == 4800)
+      {
+        if (is_scanning_from_tpu (s))
+        {
+          mp->stripe_shift = 6;
+          mp->stripe_shift2 = 6;
+        }
+        else
+        {
+          mp->stripe_shift = 3;
+          mp->stripe_shift2 = 3;
+        }
+        mp->jumplines = 34; /* better than 32 or 34 : applies to 
flatbed & TPU */
+      }
+      break;
+
      default: /* Default, and all CIS devices */
        break;
    }
@@ -909,7 +927,7 @@ static int send_scan_param (pixma_t * s)
      data[0x24] = 0x01;

      /* MG8200 addition */
-    if (s->cfg->pid == MG8200_PID)
+    if (s->cfg->pid == MG8200_PID || s->cfg->pid == MP990_PID)
      {
        if (is_scanning_from_tpu (s))
        {

And that's all. Please tell me if there's a problem, as I have not 
updated my git repo for quite a long time, I'm not sure the patch will 
apply without errors, if that's the case please tell me.

Well, now that I have finished the positives, I'll try to have the 
negative stuff work with the MP990, as I have quite a large collection 
of pictures to scan, I hope it will not take too long :-) If I have 
something working, I'll send you a patch as well.

Overall, thanks for the nice work guys, SANE is really a nice piece of 
work.

Bye.

Le 15/11/2014 14:16, Rolf Bensch a écrit :
> Hi Guillaume,
> 
> Please set me on CC when you respond to the mailing list. I missed your
> last emails.
> 
> If possible, please fetch the usb traffic on a Windows machine for a 
> tpu
> scan. Then we can investigate the correct settings for the scan
> parameters command.
> 
> On the other hand it seems that your scanner has problems with image
> post processing @ higher resolutions. Please scan a small detail of an
> image for all resolutions and save them as pnm/png or tiff files.
> Please send the files directly to me, the mailig list doesn't accept
> large emails.
> 
> Cheers,
> Rolf
> 
> 
> Am 11.11.2014 um 18:32 schrieb Guillaume Courtois:
>> 
>> Hi,
>> 
>> Progress here ! It turns out MP990 needs Data[0x25]=0x01 like some
>> other scanners.
>> Sadly, I now have a color problem, white is greenish. Is that a gamma
>> table problem ?
>> 
>> Bye.
>> 
>> Le 09/11/2014 21:12, Guillaume Courtois a écrit :
>>> Hi,
>>> 
>>> Worked a few hours again on the problem. It seems like I don't get 
>>> the
>>> correct datas from the scanner (or it's being badly post-processed)
>>> when I'm using bigger resolutions than 300 dpi with TPU unit. Flatbed
>>> seems all ok.
>>> 
>>> 300 dpi scans do not give me underruns, but all the others do, and
>>> with bigger and bigger values. The resulting pictures are bigger and
>>> bigger in size, but the image inside them is worse : it seems like 
>>> the
>>> bigger the resolution I choose, the less I get actual lines of datas.
>>> 
>>> Again, if you have any ideas, that would be cool. I can provide 
>>> datas,
>>> logs, whatever you want.
>>> 
>>> Thanks guys.
>>> 
>>> Bye.
>>> 
>>> Le 02/11/2014 16:47, Guillaume Courtois a écrit :
>>>> Hi Rolf,
>>>> 
>>>> I've just seen I sent my first response to you but not the list, 
>>>> sorry
>>>> about that (but it contained nothing interesting in fact).
>>>> 
>>>> I made some progress today, color shifting seem ok and I don't have
>>>> the white columns anymore.
>>>> I'll have to give a clean patch to the list for that, but first I 
>>>> have
>>>> to solve my last problem, which is underrun.
>>>> 
>>>> I tried to find the source of that problem but with no luck until 
>>>> now.
>>>> It seem to happen only with TPU unit, strange ?
>>>> 
>>>> Here is the result at 1200 dpi :
>>>> 
>>>> pixma] **mp810_fill_buffer***** end of image *****
>>>> [pixma] WARNING:image size mismatches
>>>> [pixma]     859431936 expected (14032 lines) but 222452736 received
>>>> (3632 lines)
>>>> [pixma] pixma_read_image(): completed (underrun detected)
>>>> 
>>>> (in debug :
>>>> [pixma] *mp810_fill_buffer***** moving 504704 bytes into buffer 
>>>> *****
>>>> [pixma] *mp810_fill_buffer***** 507904 bytes received by
>>>> read_image_block *****
>>>> )
>>>> 
>>>> and at 600 dpi :
>>>> 
>>>> [pixma] **mp810_fill_buffer***** end of image *****
>>>> [pixma] WARNING:image size mismatches
>>>> [pixma]     214857984 expected (7016 lines) but 111226368 received
>>>> (3632 lines)
>>>> [pixma] pixma_read_image(): completed (underrun detected)
>>>> 
>>>> (in debug :
>>>> [pixma] *mp810_fill_buffer***** moving 260096 bytes into buffer 
>>>> *****
>>>> [pixma] *mp810_fill_buffer***** 245760 bytes received by
>>>> read_image_block *****
>>>> )
>>>> 
>>>> Buffer size seem to be twice the size when raising the resolution.
>>>> Shouldn't it be 4 times bigger ?
>>>> 
>>>> I hope you have an idea here because my head is exploding...
>>>> 
>>>> Thanks !
>>>> 
>>>> Bye.
>>>> 
>>>> Le 27/10/2014 16:57, Rolf Bensch a écrit :
>>>>> Hi Guillaume,
>>>>> 
>>>>> If you want to dig into the source code, you can look here:
>>>>> 
>>>>> file: pixma_mp810.c
>>>>> function: post_process_image_data()
>>>>> 
>>>>> It's possible that post processing image data is broken. Please 
>>>>> check
>>>>> these git commits:
>>>>> b4bb0062c5cbb77c895b439b5f47e70b506305b1 (2013-01-11 16:37:00) and
>>>>> 1da5bcc2aa16a6382e5bd78a47cb3ec222a9aafc (2012-01-15 03:48:19)
>>>>> 
>>>>> Many thanks for your help.
>>>>> 
>>>>> Cheers,
>>>>> Rolf
>>>>> 
>>>>> 
>>>>> Am 19.10.2014 um 15:20 schrieb Guillaume Courtois:
>>>>>> 
>>>>>> Hi guys,
>>>>>> 
>>>>>> I'm currently trying to make the TPU correctly work on my MP990
>>>>>> scanner. It seems like there are shifting problems both in datas 
>>>>>> and
>>>>>> in the 3 colors (which seem to be 2 separate issues, but not 
>>>>>> sure).
>>>>>> 
>>>>>> I'm currently testing on my debian SID with sane GIT version, but 
>>>>>> I
>>>>>> have tested packages from SID and made tests on a Mint 17 netbook
>>>>>> also. All seem to give the same results.
>>>>>> 
>>>>>> It seems like datas are not shifted in 300 dpi but are more and 
>>>>>> more
>>>>>> shifted when you choose higher resolutions (600, 1200, 2400 dpi).
>>>>>> 
>>>>>> I'm happy to provide pictures if you want to see what it gives, 
>>>>>> but
>>>>>> that gives vertical black stripes on the captured picture.
>>>>>> 
>>>>>> Here is the output of xscanimage with some debug activated :
>>>>>> 
>>>>>> Here is the 300 dpi correct scan :
>>>>>> 
>>>>>> [pixma] pixma_scan(): start
>>>>>> [pixma]   line_size=3378 image_size=9674592 channels=3 depth=16
>>>>>> [pixma] Reader task id=140539733346048 (threaded)
>>>>>> [pixma]   dpi=300x300 offset=(780,88) dimension=563x2864
>>>>>> [pixma]   gamma_table=0xd939e0 source=2
>>>>>> [pixma]   threshold=127 threshold_curve=0
>>>>>> [pixma]   ADF page count: 0
>>>>>> [pixma] Setting non-blocking mode
>>>>>> [pixma] Current status: paper=0 cal=0 lamp=2 busy=0
>>>>>> [pixma] Current status: paper=0 cal=0 lamp=2 busy=0
>>>>>> [pixma] Current status: paper=0 cal=0 lamp=2 busy=0
>>>>>> [pixma] Lamp status: 3 , timeout in: 19
>>>>>> [pixma] pixma_read_image():completed
>>>>>> [pixma] Reader task terminated
>>>>>> [pixma] Reader task started
>>>>>> [pixma] Reader task id=140539733346048 (threaded)
>>>>>> 
>>>>>> Here is the not-so-correct 1200 dpi scan :
>>>>>> 
>>>>>> [pixma] pixma_scan(): start
>>>>>> [pixma]   line_size=13938 image_size=67376292 channels=3 depth=16
>>>>>> [pixma]   dpi=1200x1200 offset=(282,446) dimension=2323x4834
>>>>>> [pixma]   gamma_table=0xd939e0 source=2
>>>>>> [pixma]   threshold=127 threshold_curve=0
>>>>>> [pixma]   ADF page count: 0
>>>>>> [pixma] Setting non-blocking mode
>>>>>> [pixma] Current status: paper=0 cal=0 lamp=2 busy=0
>>>>>> [pixma] Current status: paper=0 cal=0 lamp=2 busy=0
>>>>>> [pixma] Current status: paper=0 cal=0 lamp=2 busy=0
>>>>>> [pixma] Lamp status: 3 , timeout in: 19
>>>>>> [pixma] WARNING:image size mismatches
>>>>>> [pixma]     67376292 expected (4834 lines) but 44044080 received
>>>>>> (3160
>>>>>> lines)
>>>>>> [pixma] pixma_read_image(): completed (underrun detected)
>>>>>> 
>>>>>> As you can see, mismatch and underrun tells me I have to dig
>>>>>> around that.
>>>>>> 
>>>>>> Also, it seems like data coming from the preview window is
>>>>>> mis-interpreted : I have to pick a smaller and decaled window in
>>>>>> order
>>>>>> to get the actual correct part of the scan I want to have (I don't
>>>>>> know if I'm pretty clear on that one ?).
>>>>>> 
>>>>>> I'm still digging into the code to see if I can correct that but 
>>>>>> if
>>>>>> you guys could point me to the right direction, that would save me
>>>>>> lots of time.
>>>>>> 
>>>>>> Thanks for your attention, keep up the nice work on sane !
>>>>>> 
>>>>>> Bye.
>>>>>> 
>>>>>> 
>> 
>> 



More information about the sane-devel mailing list