[sane-devel] MP730 driver broken since pixma-0.12.2

Wade Fitzpatrick wade.fitzpatrick at gmail.com
Fri Mar 20 06:55:22 UTC 2009


Thanks for the responses. I thought 0.13.1 was the latest as there is 
nothing on the website that mentions later drivers in CVS.

Even with the CVS version, it still does not work, but note now the EIO 
occurs when attempting to send the time.

helot sane-backends_cvs # export LD_LIBRARY_PATH=$(pwd)/backend/.libs/
helot sane-backends_cvs # ldd frontend/.libs/scanimage
         libsane.so.1 => 
/home/wturland/download/sane-backends_cvs/backend/.libs/libsane.so.1 
(0x00002b54911e5000)
         libieee1284.so.3 => /usr/lib/libieee1284.so.3 (0x00000035cf600000)
         libtiff.so.3 => /usr/lib/libtiff.so.3 (0x00000035d9a00000)
         libz.so.1 => /lib/libz.so.1 (0x00000035cba00000)
         libc.so.6 => /lib/libc.so.6 (0x00000035caa00000)
         libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x00000035d0800000)
         libgphoto2.so.2 => /usr/lib/libgphoto2.so.2 (0x0000003ee8400000)
         libgphoto2_port.so.0 => /usr/lib/libgphoto2_port.so.0 
(0x0000003ee6c00000)
         libltdl.so.3 => /usr/lib/libltdl.so.3 (0x0000003ee7000000)
         libdl.so.2 => /lib/libdl.so.2 (0x00000035cb200000)
         libexif.so.12 => /usr/lib/libexif.so.12 (0x0000003ee7c00000)
         libm.so.6 => /lib/libm.so.6 (0x00000035cae00000)
         libusb-0.1.so.4 => /lib/libusb-0.1.so.4 (0x00000035d6600000)
         libpthread.so.0 => /lib/libpthread.so.0 (0x00000035cb600000)
         /lib64/ld-linux-x86-64.so.2 (0x00000035c9200000)

helot sane-backends_cvs # frontend/.libs/scanimage -L
device `pixma:04A9262F_00000000F972' is a CANON Canon MultiPASS MP730 
multi-function peripheral

helot sane-backends_cvs # PIXMA_EXPERIMENT=1 SANE_DEBUG_PIXMA=11 
frontend/.libs/scanimage -d pixma:04A9262F_00000000F972 --resolution 150 
--mode Color --format pnm -x 10 -y 20 -T
[sanei_debug] Setting debug level of pixma to 11.
[pixma] Could not read pixma configuration file: pixma.conf
[pixma] pixma version 0.15.0
[pixma] pixma_collect_devices() found Canon MultiPASS MP730 at 
libusb:002:004
[pixma] sanei_bjnp_find_devices:
[pixma] Added all configured scanners, now do auto detection...
[pixma] lo is not a valid IPv4 interface, skipping...
[pixma] eth0 is not a valid IPv4 interface, skipping...
[pixma] scanner discovery finished...
[pixma] pixma_open(): Canon MultiPASS MP730
[pixma] Trying to clear the interrupt buffer...
[pixma] INTR T=1.071 len=8
[pixma]  00000000:00 00 00 00 00 08 00 00
[pixma]
[pixma] Sending time: '09/03/20 15:26'
[pixma] WARNING:pixma_write(): count(0) != len(30)
[pixma] OUT  T=1.072 len=-1
[pixma]  00000000:eb 80 00 00 00 00 00 00  14 00 30 39 2f 30 33 2f
[pixma]  00000010:32 30 20 31 35 3a 32 36  00 00 00 00 00 4c
[pixma]   ERROR: EIO
[pixma]
[pixma] Reader task id=28851 (forked)
scanimage: scanning image of size 59x118 pixels at 24 bits/pixel
scanimage: acquiring RGB frame, 8 bits/sample
scanimage: reading one scanline, 177 bytes...   [pixma] Reader task started
[pixma]
[pixma] pixma_scan(): start
[pixma]   line_size=180 image_size=21240 channels=3 depth=8
[pixma]   dpi=150x150 offset=(0,0) dimension=59x118
[pixma]   gamma_table=0x61b370 source=0
[pixma] raw_width = 60
[pixma] WARNING:pixma_write(): count(0) != len(10)
[pixma] OUT  T=1.149 len=-1
[pixma]  00000000:f3 20 00 00 00 00 00 00  0c 00
[pixma]   ERROR: EIO
[pixma]
[pixma] pixma_scan() failed EIO
[pixma] read_image():reader task closed the pipe:0 bytes received, 21240 
bytes expected
[pixma] Reader task terminated: EIO
FAIL Error: Error during device I/O
[pixma] pixma_close(): Canon MultiPASS MP730



So if I then comment the call to send_time() in 
backend/pixma_mp730.c:314, we should be seeing the same opcodes being 
sent to the scanner as we were with pixma-0.13.1. I also compiled it 
with -lpthreads to make it easier to debug.

(gdb) set environment PIXMA_EXPERIMENT 1
(gdb) set environment SANE_DEBUG_PIXMA 100
(gdb) file frontend/.libs/scanimage
Reading symbols from 
/home/wturland/download/sane-backends_cvs/frontend/.libs/scanimage...done.
(gdb) break sanei_pixma_write
Function "sanei_pixma_write" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (sanei_pixma_write) pending.
(gdb) run -d pixma:04A9262F_00000000F972 --resolution 150 --mode Color 
--format pnm -x 10 -y 20 -T
Starting program: 
/home/wturland/download/sane-backends_cvs/frontend/.libs/scanimage -d 
pixma:04A9262F_00000000F972 --resolution 150 --mode Color --format pnm 
-x 10 -y 20 -T
[Thread debugging using libthread_db enabled]
[New Thread 0x2b5798e497c0 (LWP 26625)]
[sanei_debug] Setting debug level of pixma to 100.
[pixma] Could not read pixma configuration file: pixma.conf
[pixma] pixma version 0.15.0
[pixma] pixma_collect_devices() found Canon MultiPASS MP730 at 
libusb:002:004
[pixma] sanei_bjnp_find_devices:
[pixma] Added all configured scanners, now do auto detection...
[pixma] lo is not a valid IPv4 interface, skipping...
[pixma] eth0 is not a valid IPv4 interface, skipping...
[pixma] sit0 is not a valid IPv4 interface, skipping...
[pixma] tun0 is not a valid IPv4 interface, skipping...
[pixma] lo is not a valid IPv4 interface, skipping...
[pixma] eth0 is IPv4 capable, sending broadcast..
[pixma] tun0 is IPv4 capable, sending broadcast..
[pixma] lo is not a valid IPv4 interface, skipping...
[pixma] eth0 is not a valid IPv4 interface, skipping...
[pixma] lo is not a valid IPv4 interface, skipping...
[pixma] eth0 is not a valid IPv4 interface, skipping...
[pixma] sit0 is not a valid IPv4 interface, skipping...
[pixma] tun0 is not a valid IPv4 interface, skipping...
[pixma] lo is not a valid IPv4 interface, skipping...
[pixma] eth0 is IPv4 capable, sending broadcast..
[pixma] tun0 is IPv4 capable, sending broadcast..
[pixma] lo is not a valid IPv4 interface, skipping...
[pixma] eth0 is not a valid IPv4 interface, skipping...
[pixma] lo is not a valid IPv4 interface, skipping...
[pixma] eth0 is not a valid IPv4 interface, skipping...
[pixma] sit0 is not a valid IPv4 interface, skipping...
[pixma] tun0 is not a valid IPv4 interface, skipping...
[pixma] lo is not a valid IPv4 interface, skipping...
[pixma] eth0 is IPv4 capable, sending broadcast..
[pixma] tun0 is IPv4 capable, sending broadcast..
[pixma] lo is not a valid IPv4 interface, skipping...
[pixma] eth0 is not a valid IPv4 interface, skipping...
[pixma] lo is not a valid IPv4 interface, skipping...
[pixma] eth0 is not a valid IPv4 interface, skipping...
[pixma] sit0 is not a valid IPv4 interface, skipping...
[pixma] tun0 is not a valid IPv4 interface, skipping...
[pixma] lo is not a valid IPv4 interface, skipping...
[pixma] eth0 is IPv4 capable, sending broadcast..
[pixma] tun0 is IPv4 capable, sending broadcast..
[pixma] lo is not a valid IPv4 interface, skipping...
[pixma] eth0 is not a valid IPv4 interface, skipping...
[pixma] lo is not a valid IPv4 interface, skipping...
[pixma] eth0 is not a valid IPv4 interface, skipping...
[pixma] sit0 is not a valid IPv4 interface, skipping...
[pixma] tun0 is not a valid IPv4 interface, skipping...
[pixma] lo is not a valid IPv4 interface, skipping...
[pixma] eth0 is IPv4 capable, sending broadcast..
[pixma] tun0 is IPv4 capable, sending broadcast..
[pixma] lo is not a valid IPv4 interface, skipping...
[pixma] eth0 is not a valid IPv4 interface, skipping...
[pixma] scanner discovery finished...
[pixma] pixma_open(): Canon MultiPASS MP730
[pixma] Trying to clear the interrupt buffer...
[pixma] INTR T=1.069 len=8
[pixma]  00000000:00 00 00 00 00 08 00 00
[pixma]
[New Thread 0x40800950 (LWP 26634)]
[pixma] Reader task started
[pixma]
[pixma] pixma_scan(): start
[pixma] Reader task id=1082132816 (threaded)
scanimage: scanning image of size 59x118 pixels at 24 bits/pixel
scanimage: acquiring RGB frame, 8 bits/sample
scanimage: reading one scanline, 177 bytes...   [pixma]   line_size=180 
image_size=21240 channels=3 depth=8
[pixma]   dpi=150x150 offset=(0,0) dimension=59x118
[pixma]   gamma_table=0x61e390 source=0
[pixma] raw_width = 60
[Switching to Thread 0x40800950 (LWP 26634)]

Breakpoint 1, sanei_pixma_write (io=0x6118b0, cmd=0x611940, len=10) at 
pixma_io_sanei.c:477
477       size_t count = len;
(gdb) break sanei_usb_write_bulk
Breakpoint 2 at 0x2b5798be950d: file sanei_usb.c, line 2142. (2 locations)
(gdb) c

sanei_usb_write_bulk (dn=0, buffer=0x60e940 "ó ", size=0x407fff10) at 
sanei_usb.c:2157
2157      if (debug_level > 10)
(gdb)
2160      if (devices[dn].method == sanei_usb_method_scanner_driver)
(gdb)
2168      else if (devices[dn].method == sanei_usb_method_libusb)
(gdb)
2171          if (devices[dn].bulk_out_ep)
(gdb)
2173              write_size = usb_bulk_write (devices[dn].libusb_handle,
(gdb)
2177              if (write_size < 0)
(gdb)
2178                DBG (1, "sanei_usb_write_bulk: write failed: %s\n",
(gdb) p write_size
$1 = -16



Suggestions on where to go from here?

Thanks,
Wade.

On 20/03/09 07:51, Nicolas Martin wrote:
> Hi Wade,
>
> Well, I've done some work on the pixma backend those last months,
> currently all latest work is now incorporated into the Sane CVS version,
> the standalone driver (the one you are using), is not maintained
> anymore, only CVS one is maintained for easiness.
> The biggest difference between standalone and CVS pixma drivers is the
> usb part. Standalone uses its own usb code, whereas CVS uses the
> standard libusb, much more robust to my opinion.
>
> I took a look at the information you sent:
>
> - patch between 0.12.1 and 0.12.2
> It does only concern button scan code, so this is a bit weird if it
> affects normal scan. But this may be a place to dig.
>
> - scanimage fail:
> I don't have the complete log, but as far as I can see, the fail looks
> to appear after the send date request, not implemented in those old
> versions of the backend (pixma scanners request the date and time).
> I've implemented a while back this date/time message for MP710 (which
> shares the same code as MP730), so it is now present in Sane CVS code.
>
> To dig further for MP730, my advice would be:
>
> - Install Sane CVS
> - Get a trace log as you did, zip it and send it back:
>
> SANE_DEBUG_PIXMA=11 scanimage -d pixma:04A9262F_00000000F972 -T
> 2>  /tmp/logfile
>
>
> Nicolas
>
> Le vendredi 20 mars 2009 à 06:17 +1100, Wade Fitzpatrick a écrit :
>    
>> Hi all
>>
>> I spent some time in 2006 working with Wittawat Yamwong to get the
>> Canon MultiPASS MP730 (US branding) or Canon imageCLASS MP730
>> (Asia-Pacific branding) supported in the pixma driver. Sadly, I had to
>> move house at the time, the project also moved to a new mailing list
>> and then life got in the way and I never had time to get back onto it
>> until now.
>>
>> The driver worked for about 90% of functionality up until pixma-0.12.1
>> but something broke in 0.12.2. I managed to track it down to this
>> diff:
>>
>> --- pixma_mp730.c.orig  2006-08-27 07:37:16.000000000 +1000
>> +++ pixma_mp730.c       2009-03-20 03:28:16.000000000 +1100
>> @@ -533,7 +533,7 @@
>>          &pixma_mp730_ops,  /* ops */            \
>>          dpi, dpi,          /* xdpi, ydpi */     \
>>          w, h,              /* width, height */  \
>> -        PIXMA_CAP_GRAY|PIXMA_CAP_EVENTS|cap                      \
>> +        PIXMA_CAP_GRAY|/*PIXMA_CAP_EVENTS|*/cap
>> \
>>   }
>>   const pixma_config_t pixma_mp730_devices[] = {
>>   /* TODO: check area limits */
>>
>>
>> Applying the same patch to pixma-0.13.1 also makes it work using the
>> pixma test utility 'scan', but not when using the sane backend as a
>> library. The error message is coming out of pixma_io_sanei.c:330 which
>> only gets rolled into the libsane-pixma.so.1.0.19 library. I have
>> tried using gdb to set a breakpoint and get a backtrace but gdb makes
>> baby jesus cry.
>>
>> Can anyone help by explaining how to debug a shared lib and/or tell me
>> why the pixma_write() function gets a count of 0?
>>
>> Thanks,
>> Wade.
>>
>>
>> helot mp150-0.12.1 # ./scan -d 100 -r 150 -m color -x 0 -y 0 -w 10 -h
>> 20 -W -F experiment /tmp/foo.pnm
>> [pixma-0.12.1] Scanning devices
>> under /dev/bus/usb
>> Connected
>> scanner(s):
>> 1: Canon MultiPASS MP730
>> (SN:04A9262F_00000000F972)
>> [pixma-0.12.1] pixma_open(): Canon MultiPASS
>> MP730
>> [pixma-0.12.1] Set interface
>> 1,0
>> [pixma-0.12.1] Found endpoints: 3 (OUT), 84 (IN), 85
>> (INTR,64)
>> Scan mode:
>> color
>> DPI:
>> 150x150
>> Offset:    (0,0) = (0.00cm,
>> 0.00cm)
>> Dimension: 59x118 = 1.00cm x
>> 2.00cm
>> Size:      21 kiB (uncompressed,
>> raw)
>> Source:
>> Flatbed
>> Scanning...
>> [pixma-0.12.1]
>> [pixma-0.12.1] pixma_scan():
>> start
>> [pixma-0.12.1]   line_size=180 image_size=21240 channels=3
>> depth=8
>> [pixma-0.12.1]   dpi=150x150 offset=(0,0)
>> dimension=59x118
>> [pixma-0.12.1]   gamma_table=0x60d318
>> source=0
>> [pixma-0.12.1] raw_width =
>> 60
>> [pixma-0.12.1] OUT  T=0.266
>> len=10
>> [pixma-0.12.1]  00000000:f3 20 00 00 00 00 00 00  0c
>> 00
>> [pixma-0.12.1]
>> [pixma-0.12.1] IN   T=0.269
>> len=14
>> [pixma-0.12.1]  00000000:06 06 03 01 00 02 03 00  02 00 00 00 00
>> f5
>> [pixma-0.12.1]
>> [pixma-0.12.1] Current status: paper=1 cal=0
>> lamp=0
>> [pixma-0.12.1] OUT  T=0.270
>> len=20
>> [pixma-0.12.1]  00000000:cf 60 00 00 00 00 00 00  0a 00 01 00 00 00 00
>> 00
>> [pixma-0.12.1]  00000010:00 00 00
>> ff
>> [----------snipped-------------]
>> [pixma-0.12.1] Current status: paper=1 cal=0
>> lamp=0
>> [pixma-0.12.1] OUT  T=2.337
>> len=20
>> [pixma-0.12.1]  00000000:cf 60 00 00 00 00 00 00  0a 00 01 00 00 00 00
>> 00
>> [pixma-0.12.1]  00000010:00 00 00
>> ff
>> [pixma-0.12.1]
>> [pixma-0.12.1] IN   T=2.341
>> len=2
>> [pixma-0.12.1]  00000000:06
>> 06
>> [pixma-0.12.1]
>> [pixma-0.12.1]
>> pixma_read_image():completed
>> 100% done (21240 bytes
>> written)
>> [pixma-0.12.1] pixma_close(): Canon MultiPASS
>> MP730
>>
>>
>> helot mp150-0.12.2 # ./scan -d 100 -r 150 -m color -x 0 -y 0 -w 10 -h
>> 20 -W -F experiment /tmp/foo.pnm
>> [pixma-0.12.2] Scanning devices under /dev/bus/usb
>> Connected scanner(s):
>> 1: Canon MultiPASS MP730 (SN:04A9262F_00000000F972)
>> [pixma-0.12.2] pixma_open(): Canon MultiPASS MP730
>> [pixma-0.12.2] Set interface 1,0
>> [pixma-0.12.2] Found endpoints: 3 (OUT), 84 (IN), 85 (INTR,64)
>>
>> ########## Page 1 ###########
>> Scan mode: color
>> DPI:       150x150
>> Offset:    (0,0) = (0.00cm, 0.00cm)
>> Dimension: 59x118 = 1.00cm x 2.00cm
>> Size:      21 kiB (uncompressed, raw)
>> Source:    Flatbed
>> Press scan button to begin or Ctrl-C when finished!
>> [pixma-0.12.2] INTR T=0.336 len=8
>> [pixma-0.12.2]  00000000:00 00 00 00 00 08 00 00
>> [pixma-0.12.2]
>> [pixma-0.12.2] send_time() is not yet implemented.
>> [pixma-0.12.2] INTR T=9.332 len=8
>> [pixma-0.12.2]  00000000:00 00 00 00 00 08 00 00
>> [pixma-0.12.2]
>> [pixma-0.12.2] send_time() is not yet implemented.
>> [pixma-0.12.2] pixma_close(): Canon MultiPASS MP730
>>
>>
>> helot testsuite # PIXMA_EXPERIMENT=1 SANE_DEBUG_PIXMA=10 scanimage -d
>> pixma:04A9262F_00000000F972 --resolution 150 --mode Color --format pnm
>> -x 10 -y 20>  /tmp/foo.pnm
>> [sanei_debug] Setting debug level of pixma to 10.
>> [pixma] pixma version 0.13.1
>> [pixma] pixma_collect_devices() found Canon MultiPASS MP730 at
>> libusb:002:004
>> [pixma] pixma_open(): Canon MultiPASS MP730
>> [pixma] Trying to clear the interrupt buffer...
>> [pixma]   no packets in buffer
>> [pixma] Reader task id=3979 (forked)
>> [pixma] Reader task started
>> [pixma]
>> [pixma] pixma_scan(): start
>> [pixma]   line_size=180 image_size=21240 channels=3 depth=8
>> [pixma]   dpi=150x150 offset=(0,0) dimension=59x118
>> [pixma]   gamma_table=0x61b3d0 source=0
>> [pixma] INTR T=0.286 len=8
>> [pixma]  00000000:00 00 00 00 00 08 00 00
>> [pixma]
>> [pixma] send_time() is not yet implemented.
>> [pixma] raw_width = 60
>> [pixma] WARNING:pixma_write(): count(0) != len(10)
>> [pixma] OUT  T=0.307 len=-1
>> [pixma]  00000000:f3 20 00 00 00 00 00 00  0c 00
>> [pixma]   ERROR: EIO
>> [pixma]
>> [pixma] pixma_scan() failed EIO
>> [pixma] Reader task terminated: EIO
>> [pixma] read_image():reader task closed the pipe:0 bytes received,
>> 21240 bytes expected
>> scanimage: sane_read: Error during device I/O
>> [pixma] pixma_close(): Canon MultiPASS MP730
>>
>> -- 
>> sane-devel mailing list:sane-devel at lists.alioth.debian.org
>> http://lists.alioth.debian.org/mailman/listinfo/sane-devel
>> Unsubscribe: Send mail with subject "unsubscribe your_password"
>>               tosane-devel-request at lists.alioth.debian.org
>>      
>
>
>
>    
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20090320/6263a600/attachment-0001.htm 


More information about the sane-devel mailing list