[sane-devel] Canon pixma MP160

David Nicklay david at nicklay.com
Wed Jan 10 16:06:25 CET 2007


Hi,

I got offsets working.  I had to align the x and y values to 32 pixel 
boundaries.  Now I can pass any parameter I can think of on the command 
line to pixmascan and it works.  The graphical scanners are still quite 
unstable for me.  The ubuntu/debian packages for xsane and the like 
don't have debugging symbols, so I have to go rebuild those before I can 
do more.  Attached is a patch that combines the experimental mp600 patch 
with the alignments I had to add.




Marcus Käll wrote:
> Hi,
>
> Thank you!
>
> The driver now works as long as I scan the whole image. If I set an
> offset it fails. Below is the output from xsane when the scanning fails.
> Maybe this can help you to debug.
>
> Best Regards Marcus
>
> output:
> [pixma-0.12.2] pixma version 0.12.2
> [pixma-0.12.2] Scanning devices under /dev/bus/usb
> [pixma-0.12.2] Scanning devices under /dev/bus/usb
> [pixma-0.12.2] pixma_open(): Canon PIXMA MP160
> [pixma-0.12.2] Set interface 0,0
> [pixma-0.12.2] Found endpoints: 7 (OUT), 88 (IN), 89 (INTR,64)
> [pixma-0.12.2] OUT  T=0.755 len=16
> [pixma-0.12.2]  00000000:f3 20 00 00 00 00 00 00  00 00 00 00 00 00 00
> 10 
> [pixma-0.12.2] 
> [pixma-0.12.2] IN   T=0.757 len=24
> [pixma-0.12.2]  00000000:06 06 00 00 00 00 00 00  01 00 00 00 00 03 00
> 02 
> [pixma-0.12.2]  00000010:00 00 00 00 00 00 00 fa  
> [pixma-0.12.2] 
> [pixma-0.12.2] Current status: paper=0 cal=0 lamp=2 busy=0
> [pixma-0.12.2] Reader task started
> [pixma-0.12.2] 
> [pixma-0.12.2] pixma_scan(): start
> [pixma-0.12.2]   line_size=1908 image_size=1667592 channels=3 depth=8
> [pixma-0.12.2]   dpi=75x75 offset=(1,1) dimension=636x874
> [pixma-0.12.2]   gamma_table=0x8262168 source=0
> [pixma-0.12.2] Reader task id=5444 (forked)
> [pixma-0.12.2] Setting non-blocking mode
> [pixma-0.12.2] OUT  T=34.676 len=16
> [pixma-0.12.2]  00000000:db 20 00 00 00 00 00 00  00 00 00 00 00 00 00
> 00 
> [pixma-0.12.2] 
> [pixma-0.12.2] IN   T=34.677 len=8
> [pixma-0.12.2]  00000000:06 06 00 00 00 00 00 00  
> [pixma-0.12.2] 
> [pixma-0.12.2] OUT  T=34.678 len=28
> [pixma-0.12.2]  00000000:dd 20 00 00 00 00 00 00  00 00 00 00 00 00 00
> 0c 
> [pixma-0.12.2]  00000010:01 01 00 00 00 01 00 00  00 00 00 fd 
> [pixma-0.12.2] 
> [pixma-0.12.2] IN   T=34.679 len=8
> [pixma-0.12.2]  00000000:06 06 00 00 00 00 00 00  
> [pixma-0.12.2] 
> [pixma-0.12.2] OUT  T=34.693 len=2072
> [pixma-0.12.2]  00000000:ee 20 00 00 00 00 00 00  00 00 00 00 00 00 08
> 08 
> [pixma-0.12.2]  00000010:10 00 08 04 00 00 00 00  00 00 00 00 00 00 00
> 00 
> [pixma-0.12.2]  00000020:00 00 00 00 00 00 00 00  00 01 00 01 00 02 00
> 02 
> [pixma-0.12.2]  00000030:00 03 00 03 00 04 00 04  00 04 00 05 00 05 00
> 06 
> [pixma-0.12.2]  00000040:00 06 00 06 00 07 00 07  00 08 00 08 00 08 00
> 09 
> [pixma-0.12.2]  00000050:00 09 00 0a 00 0a 00 0a  00 0b 00 0b 00 0b 00
> 0c 
> [pixma-0.12.2]  00000060:00 0c 00 0c 00 0d 00 0d  00 0e 00 0e 00 0e 00
> 0f 
> [pixma-0.12.2]  00000070:00 0f 00 0f 00 10 00 10  00 10 00 11 00 11 00
> 11 
> [pixma-0.12.2]  ...
> [pixma-0.12.2] 
> [pixma-0.12.2] IN   T=34.694 len=8
> [pixma-0.12.2]  00000000:06 06 00 00 00 00 00 00  
> [pixma-0.12.2] 
> [pixma-0.12.2] OUT  T=34.695 len=64
> [pixma-0.12.2]  00000000:de 20 00 00 00 00 00 00  00 00 00 00 00 00 00
> 30 
> [pixma-0.12.2]  00000010:00 00 00 00 80 4b 80 4b  00 00 00 01 00 00 00
> 01 
> [pixma-0.12.2]  00000020:00 00 02 7c 00 00 03 6a  08 18 00 00 00 00 00
> 00 
> [pixma-0.12.2]  00000030:ff 00 00 81 00 00 02 01  00 00 00 00 00 00 00
> da 
> [pixma-0.12.2] 
> [pixma-0.12.2] IN   T=34.697 len=8
> [pixma-0.12.2]  00000000:15 15 00 00 00 00 00 00  
> [pixma-0.12.2] 
> [pixma-0.12.2] OUT  T=34.698 len=16
> [pixma-0.12.2]  00000000:ef 20 00 00 00 00 00 00  00 00 00 00 00 00 00
> 00 
> [pixma-0.12.2] 
> [pixma-0.12.2] IN   T=34.699 len=8
> [pixma-0.12.2]  00000000:06 06 00 00 00 00 00 00  
> [pixma-0.12.2] 
> [pixma-0.12.2] pixma_scan() failed ECANCELED
> [pixma-0.12.2] read_image():reader task closed the pipe:0 bytes
> received, 1667592 bytes expected
> [pixma-0.12.2] Reader task terminated: ECANCELED
> [pixma-0.12.2] pixma_close(): Canon PIXMA MP160
>
>
>
>   
>> Hi,
>>
>> All of the generation 2: CIS Canon Pixma printers seem to suffer from 
>> the same issue which seems to be a problem with the parameters passed to 
>> the printer.  aligning the pixels for the raw width to 16 for both gray 
>> and color seems to fix part of the problem, but I still cannot pass an 
>> arbirtrary offset x,y value.  This site has a patch for an MP600, which 
>> you need to use before anything will work:
>>
>> http://pixma-mp600.sourceforge.jp/
>>
>>  From the patch:
>>     /* Generation 2: CIS */
>>     DEVICE("Canon PIXMA MP160", MP160_PID, 600, PIXMA_CAP_EXPERIMENT),
>>     DEVICE("Canon PIXMA MP180", UNKNOWN_PID, 1200, PIXMA_CAP_EXPERIMENT),
>>     DEVICE("Canon PIXMA MP460", MP460_PID, 1200, 0),
>>     DEVICE("Canon PIXMA MP510", UNKNOWN_PID, 1200, PIXMA_CAP_EXPERIMENT),
>>     DEVICE("Canon PIXMA MP600", MP600_PID, 2400, 0),
>>     DEVICE("Canon PIXMA MP600R", UNKNOWN_PID, 2400, PIXMA_CAP_EXPERIMENT),
>>
>> Any of these printers are probably affected.....
>>
>>
>> Marcus Käll wrote:
>>     
>>> Hi!
>>>
>>> I have a Canon pixma MP160 which is not supported by sane. MP150 and
>>> MP170 are supported.
>>>
>>> I have no idea how the MP160 interface works, but I guess it is quite
>>> similar to MP150 and MP170, so I modified the driver for MP150 and MP170
>>> from SANE-backends-1.0.18.
>>>
>>> So, I added the line:
>>>   DEVICE ("Canon PIXMA MP160", 0x1714, 1200, 0),
>>> to the file pixma_mp150.c. This line is almost the same as the lines for
>>> MP150 and MP170, but I changed the name and vendor id. I found the
>>> vendor id from sane-find-scanner utility. 
>>>
>>> After that I compiled it for ubuntu 6.06. The default SANE-backend
>>> version for ubuntu 6.06 is 1.0.17 but the compiling process did not
>>> complain. 
>>>  
>>> With those modifications xsane finds my scanner, but when I try to scan
>>> xsane tells me that there was an error and aborts the scan.
>>>
>>> The following lines contains the output from the pixma driver with
>>> highest debugging enabled. 
>>>
>>> [sanei_debug] Setting debug level of pixma to 10.
>>> [pixma] pixma version 0.11.3
>>> [pixma] pixma_open(): Canon PIXMA MP160
>>> [pixma] Reader task started
>>> [pixma] 
>>> [pixma] pixma_scan(): start
>>> [pixma]   line_size=1920 image_size=1683840 channels=3 depth=8
>>> [pixma]   dpi=75x75 offset=(0,0) dimension=638x877
>>> [pixma]   gamma_table=0x8262270 source=0
>>> [pixma] Reader task id=6387 (forked)
>>> [pixma] Setting non-blocking mode
>>> [pixma] OUT  T=52.746 len=16
>>> [pixma]  00000000:db 20 00 00 00 00 00 00  00 00 00 00 00 00 00 00 
>>> [pixma] 
>>> [pixma] IN   T=52.753 len=8
>>> [pixma]  00000000:06 06 00 00 00 00 00 00  
>>> [pixma] 
>>> [pixma] OUT  T=52.797 len=28
>>> [pixma]  00000000:dd 20 00 00 00 00 00 00  00 00 00 00 00 00 00 0c 
>>> [pixma]  00000010:01 01 00 00 00 00 00 00  00 00 00 fe 
>>> [pixma] 
>>> [pixma] IN   T=52.831 len=8
>>> [pixma]  00000000:15 15 00 00 00 00 00 00  
>>> [pixma] 
>>> [pixma] OUT  T=52.832 len=16
>>> [pixma]  00000000:ef 20 00 00 00 00 00 00  00 00 00 00 00 00 00 00 
>>> [pixma] 
>>> [pixma] IN   T=52.833 len=8
>>> [pixma]  00000000:06 06 00 00 00 00 00 00  
>>> [pixma] 
>>> [pixma] pixma_scan() failed:Operationen avbruten
>>> [pixma] Reader task terminated: Operationen avbruten
>>> [pixma] read_image():reader task closed the pipe:0 bytes received,
>>> 1683840 bytes expected
>>> [pixma] pixma_close(): Canon PIXMA MP160
>>>
>>> Can anyone help me with this driver?
>>>
>>> Best Regards Marcus
>>>
>>>
>>>   
>>>       
>>     


-- 
David Nicklay     O-
Location: CNN Center - SE0811A
Office: 404-827-2698	Cell: 404-545-6218

-------------- next part --------------
A non-text attachment was scrubbed...
Name: generation2.patch
Type: text/x-patch
Size: 7199 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20070110/dc11e034/generation2.bin


More information about the sane-devel mailing list