<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  <title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
<font face="sans-serif">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.<br>
<br>
Even with the CVS version, it still does not work, but note now the EIO
occurs when attempting to send the time.<br>
<br>
</font><tt>helot sane-backends_cvs # export
LD_LIBRARY_PATH=$(pwd)/backend/.libs/<br>
helot sane-backends_cvs # ldd frontend/.libs/scanimage<br>
        libsane.so.1 =&gt;
/home/wturland/download/sane-backends_cvs/backend/.libs/libsane.so.1
(0x00002b54911e5000)<br>
        libieee1284.so.3 =&gt; /usr/lib/libieee1284.so.3
(0x00000035cf600000)                                       <br>
        libtiff.so.3 =&gt; /usr/lib/libtiff.so.3
(0x00000035d9a00000)                                               <br>
        libz.so.1 =&gt; /lib/libz.so.1
(0x00000035cba00000)                                                        
<br>
        libc.so.6 =&gt; /lib/libc.so.6
(0x00000035caa00000)                                                        
<br>
        libjpeg.so.62 =&gt; /usr/lib/libjpeg.so.62
(0x00000035d0800000)                                             <br>
        libgphoto2.so.2 =&gt; /usr/lib/libgphoto2.so.2
(0x0000003ee8400000)                                         <br>
        libgphoto2_port.so.0 =&gt; /usr/lib/libgphoto2_port.so.0
(0x0000003ee6c00000)                               <br>
        libltdl.so.3 =&gt; /usr/lib/libltdl.so.3
(0x0000003ee7000000)                                               <br>
        libdl.so.2 =&gt; /lib/libdl.so.2
(0x00000035cb200000)                                                      
<br>
        libexif.so.12 =&gt; /usr/lib/libexif.so.12
(0x0000003ee7c00000)                                             <br>
        libm.so.6 =&gt; /lib/libm.so.6
(0x00000035cae00000)                                                        
<br>
        libusb-0.1.so.4 =&gt; /lib/libusb-0.1.so.4
(0x00000035d6600000)                                             <br>
        libpthread.so.0 =&gt; /lib/libpthread.so.0
(0x00000035cb600000)                                             <br>
        /lib64/ld-linux-x86-64.so.2
(0x00000035c9200000)                                                        
<br>
<br>
helot sane-backends_cvs # frontend/.libs/scanimage -L<br>
device `pixma:04A9262F_00000000F972' is a CANON Canon MultiPASS MP730
multi-function peripheral<br>
<br>
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                                                                                     
<br>
[sanei_debug] Setting debug level of pixma to
11.                                                                                  
<br>
[pixma] Could not read pixma configuration file:
pixma.conf                                                                        
<br>
[pixma] pixma version
0.15.0                                                                                                       
<br>
[pixma] pixma_collect_devices() found Canon MultiPASS MP730 at
libusb:002:004                                                       <br>
[pixma]
sanei_bjnp_find_devices:                                                                                                   
<br>
[pixma] Added all configured scanners, now do auto
detection...                                                                    
<br>
[pixma] lo is not a valid IPv4 interface,
skipping...                                                                              
<br>
[pixma] eth0 is not a valid IPv4 interface,
skipping...                                                                            
<br>
[pixma] scanner discovery finished...<br>
[pixma] pixma_open(): Canon MultiPASS MP730<br>
[pixma] Trying to clear the interrupt buffer...<br>
[pixma] INTR T=1.071 len=8<br>
[pixma]  00000000:00 00 00 00 00 08 00 00<br>
[pixma]<br>
[pixma] Sending time: '09/03/20 15:26'<br>
[pixma] WARNING:pixma_write(): count(0) != len(30)<br>
[pixma] OUT  T=1.072 len=-1<br>
[pixma]  00000000:eb 80 00 00 00 00 00 00  14 00 30 39 2f 30 33 2f<br>
[pixma]  00000010:32 30 20 31 35 3a 32 36  00 00 00 00 00 4c<br>
[pixma]   ERROR: EIO<br>
[pixma]<br>
[pixma] Reader task id=28851 (forked)<br>
scanimage: scanning image of size 59x118 pixels at 24 bits/pixel<br>
scanimage: acquiring RGB frame, 8 bits/sample<br>
scanimage: reading one scanline, 177 bytes...   [pixma] Reader task
started<br>
[pixma]<br>
[pixma] pixma_scan(): start<br>
[pixma]   line_size=180 image_size=21240 channels=3 depth=8<br>
[pixma]   dpi=150x150 offset=(0,0) dimension=59x118<br>
[pixma]   gamma_table=0x61b370 source=0<br>
[pixma] raw_width = 60<br>
[pixma] WARNING:pixma_write(): count(0) != len(10)<br>
[pixma] OUT  T=1.149 len=-1<br>
[pixma]  00000000:f3 20 00 00 00 00 00 00  0c 00<br>
[pixma]   ERROR: EIO<br>
[pixma]<br>
[pixma] pixma_scan() failed EIO<br>
[pixma] read_image():reader task closed the pipe:0 bytes received,
21240 bytes expected<br>
[pixma] Reader task terminated: EIO<br>
FAIL Error: Error during device I/O<br>
[pixma] pixma_close(): Canon MultiPASS MP730<br>
<br>
<br>
<br>
</tt><font face="sans-serif">So if I then comment the call to
send_time()</font> 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.<br>
<tt><br>
(gdb) set environment PIXMA_EXPERIMENT
1                                     <br>
(gdb) set environment SANE_DEBUG_PIXMA
100                                   <br>
(gdb) file
frontend/.libs/scanimage                                          <br>
Reading symbols from
/home/wturland/download/sane-backends_cvs/frontend/.libs/scanimage...done.<br>
(gdb) break
sanei_pixma_write                                                                 
<br>
Function "sanei_pixma_write" not
defined.                                                      <br>
Make breakpoint pending on future shared library load? (y or [n])
y                            <br>
Breakpoint 1 (sanei_pixma_write)
pending.                                                      <br>
(gdb) run -d pixma:04A9262F_00000000F972 --resolution 150 --mode Color
--format pnm -x 10 -y 20 -T<br>
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                                                                                          
<br>
[Thread debugging using libthread_db
enabled]                                                                                      
<br>
[New Thread 0x2b5798e497c0 (LWP
26625)]                                                                                            
<br>
[sanei_debug] Setting debug level of pixma to
100.                                                                                 
<br>
[pixma] Could not read pixma configuration file:
pixma.conf                                                                        
<br>
[pixma] pixma version
0.15.0                                                                                                       
<br>
[pixma] pixma_collect_devices() found Canon MultiPASS MP730 at
libusb:002:004                                                       <br>
[pixma]
sanei_bjnp_find_devices:                                                                                                   
<br>
[pixma] Added all configured scanners, now do auto
detection...                                                                    
<br>
[pixma] lo is not a valid IPv4 interface,
skipping...                                                                              
<br>
[pixma] eth0 is not a valid IPv4 interface,
skipping...                                                                            
<br>
[pixma] sit0 is not a valid IPv4 interface,
skipping...                                                                            
<br>
[pixma] tun0 is not a valid IPv4 interface,
skipping...                                                                            
<br>
[pixma] lo is not a valid IPv4 interface,
skipping...                                                                              
<br>
[pixma] eth0 is IPv4 capable, sending
broadcast..                                                                                  
<br>
[pixma] tun0 is IPv4 capable, sending
broadcast..                                                                                  
<br>
[pixma] lo is not a valid IPv4 interface,
skipping...                                                                              
<br>
[pixma] eth0 is not a valid IPv4 interface,
skipping...                                                                            
<br>
[pixma] lo is not a valid IPv4 interface,
skipping...                                                                              
<br>
[pixma] eth0 is not a valid IPv4 interface,
skipping...                                                                            
<br>
[pixma] sit0 is not a valid IPv4 interface,
skipping...                                                                            
<br>
[pixma] tun0 is not a valid IPv4 interface,
skipping...                                                                            
<br>
[pixma] lo is not a valid IPv4 interface,
skipping...                                                                              
<br>
[pixma] eth0 is IPv4 capable, sending
broadcast..                                                                                  
<br>
[pixma] tun0 is IPv4 capable, sending
broadcast..                                                                                  
<br>
[pixma] lo is not a valid IPv4 interface,
skipping...                                                                              
<br>
[pixma] eth0 is not a valid IPv4 interface,
skipping...                                                                            
<br>
[pixma] lo is not a valid IPv4 interface,
skipping...                                                                              
<br>
[pixma] eth0 is not a valid IPv4 interface,
skipping...                                                                            
<br>
[pixma] sit0 is not a valid IPv4 interface,
skipping...                                                                            
<br>
[pixma] tun0 is not a valid IPv4 interface,
skipping...                                                                            
<br>
[pixma] lo is not a valid IPv4 interface,
skipping...                                                                              
<br>
[pixma] eth0 is IPv4 capable, sending
broadcast..                                                                                  
<br>
[pixma] tun0 is IPv4 capable, sending
broadcast..                                                                                  
<br>
[pixma] lo is not a valid IPv4 interface,
skipping...                                                                              
<br>
[pixma] eth0 is not a valid IPv4 interface,
skipping...                                                                            
<br>
[pixma] lo is not a valid IPv4 interface,
skipping...                                                                              
<br>
[pixma] eth0 is not a valid IPv4 interface,
skipping...                                                                            
<br>
[pixma] sit0 is not a valid IPv4 interface,
skipping...                                                                            
<br>
[pixma] tun0 is not a valid IPv4 interface,
skipping...                                                                            
<br>
[pixma] lo is not a valid IPv4 interface,
skipping...                                                                              
<br>
[pixma] eth0 is IPv4 capable, sending
broadcast..                                                                                  
<br>
[pixma] tun0 is IPv4 capable, sending
broadcast..                                                                                  
<br>
[pixma] lo is not a valid IPv4 interface,
skipping...                                                                              
<br>
[pixma] eth0 is not a valid IPv4 interface,
skipping...                                                                            
<br>
[pixma] lo is not a valid IPv4 interface,
skipping...                                                                              
<br>
[pixma] eth0 is not a valid IPv4 interface,
skipping...                                                                            
<br>
[pixma] sit0 is not a valid IPv4 interface,
skipping...                                                                            
<br>
[pixma] tun0 is not a valid IPv4 interface,
skipping...                                                                            
<br>
[pixma] lo is not a valid IPv4 interface,
skipping...                                                                              
<br>
[pixma] eth0 is IPv4 capable, sending
broadcast..                                                                                  
<br>
[pixma] tun0 is IPv4 capable, sending
broadcast..                                                                                  
<br>
[pixma] lo is not a valid IPv4 interface,
skipping...                                                                              
<br>
[pixma] eth0 is not a valid IPv4 interface,
skipping...                                                                            
<br>
[pixma] scanner discovery
finished...                                                                                              
<br>
[pixma] pixma_open(): Canon MultiPASS
MP730                                                                                        
<br>
[pixma] Trying to clear the interrupt
buffer...                                                                                    
<br>
[pixma] INTR T=1.069
len=8                                                                                                         
<br>
[pixma]  00000000:00 00 00 00 00 08 00
00                                                                                          
<br>
[pixma]                                                                                                                            
<br>
[New Thread 0x40800950 (LWP
26634)]                                                                                                
<br>
[pixma] Reader task
started                                                                                                        
<br>
[pixma]                                                                                                                            
<br>
[pixma] pixma_scan():
start                                                                                                        
<br>
[pixma] Reader task id=1082132816
(threaded)                                                                                       
<br>
scanimage: scanning image of size 59x118 pixels at 24
bits/pixel                                                                   
<br>
scanimage: acquiring RGB frame, 8
bits/sample                                                                                      
<br>
scanimage: reading one scanline, 177 bytes...   [pixma]   line_size=180
image_size=21240 channels=3 depth=8                         <br>
[pixma]   dpi=150x150 offset=(0,0)
dimension=59x118                                                                                
<br>
[pixma]   gamma_table=0x61e390
source=0                                                                                            
<br>
[pixma] raw_width =
60                                                                                                             
<br>
[Switching to Thread 0x40800950 (LWP
26634)]                                                                                       
<br>
<br>
Breakpoint 1, sanei_pixma_write (io=0x6118b0, cmd=0x611940, len=10) at
pixma_io_sanei.c:477<br>
477       size_t count =
len;                                                              <br>
(gdb) break
sanei_usb_write_bulk                                                          
<br>
Breakpoint 2 at 0x2b5798be950d: file sanei_usb.c, line 2142. (2
locations)                 <br>
(gdb)
c                                                                                   
<br>
<br>
sanei_usb_write_bulk (dn=0, buffer=0x60e940 "ó ", size=0x407fff10) at
sanei_usb.c:2157                                  <br>
2157      if (debug_level &gt;
10)                                                                                        
<br>
(gdb)                                                                                                                  
<br>
2160      if (devices[dn].method ==
sanei_usb_method_scanner_driver)                                                   
<br>
(gdb)                                                                                                                  
<br>
2168      else if (devices[dn].method ==
sanei_usb_method_libusb)                                                      
<br>
(gdb)                                                                                                                  
<br>
2171          if
(devices[dn].bulk_out_ep)                                                                             
<br>
(gdb)                                                                                                                  
<br>
2173              write_size = usb_bulk_write
(devices[dn].libusb_handle,                                              
<br>
(gdb)                                                                                                                  
<br>
2177              if (write_size &lt;
0)                                                                                  
<br>
(gdb)                                                                                                                  
<br>
2178                DBG (1, "sanei_usb_write_bulk: write failed:
%s\n",                                                 <br>
(gdb) p
write_size                                                                                                     
<br>
$1 =
-16                                                                                                              
<br>
<br>
</tt><font face="sans-serif"><br>
<br>
Suggestions on where to go from here?<br>
<br>
Thanks,<br>
Wade.<br>
</font><font face="sans-serif"><br>
</font>On 20/03/09 07:51, Nicolas Martin wrote:
<blockquote cite="mid:1237495901.6277.24.camel@nico" type="cite">
  <pre wrap="">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&gt; /tmp/logfile


Nicolas

Le vendredi 20 mars 2009 à 06:17 +1100, Wade Fitzpatrick a écrit :
  </pre>
  <blockquote type="cite">
    <pre wrap="">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 @@
        &amp;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 &gt; /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: <a class="moz-txt-link-abbreviated"
 href="mailto:sane-devel@lists.alioth.debian.org">sane-devel@lists.alioth.debian.org</a>
<a class="moz-txt-link-freetext"
 href="http://lists.alioth.debian.org/mailman/listinfo/sane-devel">http://lists.alioth.debian.org/mailman/listinfo/sane-devel</a>
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to <a class="moz-txt-link-abbreviated"
 href="mailto:sane-devel-request@lists.alioth.debian.org">sane-devel-request@lists.alioth.debian.org</a>
    </pre>
  </blockquote>
  <pre wrap=""><!---->


  </pre>
</blockquote>
</body>
</html>