Discussion:
Mac OS X: make errors
(too old to reply)
Peter Schoenrank
2009-03-24 17:21:39 UTC
Permalink
I am running Mac OS X 10.5.6 on an Intel iMac. I did

$ mkdir ~/Desktop/scanning_from_the_command_line
$ cd ~/Desktop/scanning_from_the_command_line
$ curl 'http://alioth.debian.org/snapshots.php?group_id=30186' > sane-
scm-latest.tar.gz
$ open sane-scm-latest.tar.gz
$ cd sane-scm-2009-03-24/sane-backends
$ export BACKENDS="pixma canon"
$ ./configure --build=x86-apple-osx &> configure.log
$ make check &> makecheck.log
$ make &> make.log

Obviously I don’t know what I am doing, because make.log ends with

make[1]: *** [scanimage] Error 1
make: *** [all-recursive] Error 1

For those who care,
config.log
configure.log
makecheck.log
make.log

are available at
http://members.shaw.ca/schoenrank.ca/sane-scm-2009-03-24/

Any help would be appreciated.


Peter
-----
Peter Schoenrank
mailto: ***@schoenrank.ca
phone: 250-655-6753
Chris Bagwell
2009-03-24 18:22:07 UTC
Permalink
It looks like its related to your usage of "--build" option. The configure
scripts expect host_os field to be set to "darwin" and not "osx" for OS X.
Your option seems to confuse it and its not adding some link options to
resolve the undefined symbols.

You should be able to run without the --build option. Does it work without
it or is there a problem your trying to work around with it?

Chris
Post by Peter Schoenrank
I am running Mac OS X 10.5.6 on an Intel iMac. I did
$ mkdir ~/Desktop/scanning_from_the_command_line
$ cd ~/Desktop/scanning_from_the_command_line
$ curl 'http://alioth.debian.org/snapshots.php?group_id=30186' > sane-
scm-latest.tar.gz
$ open sane-scm-latest.tar.gz
$ cd sane-scm-2009-03-24/sane-backends
$ export BACKENDS="pixma canon"
$ ./configure --build=x86-apple-osx &> configure.log
$ make check &> makecheck.log
$ make &> make.log
Obviously I don’t know what I am doing, because make.log ends with
make[1]: *** [scanimage] Error 1
make: *** [all-recursive] Error 1
For those who care,
config.log
configure.log
makecheck.log
make.log
are available at
http://members.shaw.ca/schoenrank.ca/sane-scm-2009-03-24/
Any help would be appreciated.
Peter
-----
Peter Schoenrank
phone: 250-655-6753
--
http://lists.alioth.debian.org/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
Peter Schoenrank
2009-03-24 21:24:11 UTC
Permalink
Post by Chris Bagwell
You should be able to run without the --build option. Does it work
without it or is there a problem your trying to work around with it?
No, I’m just a noob who scratched his head while trying to read
through the documentation. I am not a developer, I am a Mac OS X end
user who wants to be able to scan from the command line so that I can
automate some repetitive scanning tasks.

Following Chris’s suggestion, I did

$ cd ~/Desktop/scanning_from_the_command_line/sane-scm-2009-03-24/sane-
backends/
$ make distclean
$ export BACKENDS="pixma canon"
$ ./configure &> configure.log

This still results in the warnings about IOKit/scsi/SCSITaskLib.h that
I previously posted, but as Chris suggested, I ignored those because
my scanner is USB not SCSI.

$ make check &> makecheck.log
$ make &> make.log
$ sudo make install &> makeinstall.log
$ sane-find-scanner &> sane-find-scanner.log

found USB scanner (vendor=0x04a9 [Canon], product=0x172c [MX850
series]) at libusb:007:002-04a9-172c-00-00

$ scanimage -L &> scanimage-L.log

device `pixma:04A9172C_21B0DA' is a CANON Canon PIXMA MX850 multi-
function peripheral

$ export SANE_DEBUG_SANEI_USB=255
$ export SANE_DEBUG=255
$ export SANE_DEBUG_PIXMA=20
$ scanimage -d pixma:04A9172C_21B0DA -T &> scanimage.log

And now I am back to where I was on Saturday: scanimage hangs.

For those who care,

config.log
configure.log
makecheck.log
make.log
makeinstall.log
sane-find-scanner.log
scanimage-L.log
scanimage.log

are available at
http://members.shaw.ca/schoenrank.ca/sane-scm-2009-03-24.2/


Peter
-----
Peter Schoenrank
mailto: ***@schoenrank.ca
phone: 250-655-6753
Chris Bagwell
2009-03-24 21:37:40 UTC
Permalink
OK, I have to stick with build issue myself... Sorry, can't help with USB
issues. I have only 1 addition suggestion. Try running configure with
"--prefix=/usr/local/testsane" to have it installed in a custom location.

I've not fully followed in the other threads if you've ever install a
previous copy of sane into the prefix /usr/local... but perhaps libsane is
loading some older version of your backend that has these USB issues.

Anyways, the --prefix idea can only help I think... but likely is not your
issue.

Chris
This still results in the warnings about IOKit/scsi/SCSITaskLib.h that I
previously posted, but as Chris suggested, I ignored those because my
scanner is USB not SCSI.
$ make check &> makecheck.log
$ make &> make.log
$ sudo make install &> makeinstall.log
$ sane-find-scanner &> sane-find-scanner.log
found USB scanner (vendor=0x04a9 [Canon], product=0x172c [MX850 series]) at
libusb:007:002-04a9-172c-00-00
$ scanimage -L &> scanimage-L.log
device `pixma:04A9172C_21B0DA' is a CANON Canon PIXMA MX850 multi-function
peripheral
$ export SANE_DEBUG_SANEI_USB=255
$ export SANE_DEBUG=255
$ export SANE_DEBUG_PIXMA=20
$ scanimage -d pixma:04A9172C_21B0DA -T &> scanimage.log
And now I am back to where I was on Saturday: scanimage hangs.
For those who care,
config.log
configure.log
makecheck.log
make.log
makeinstall.log
sane-find-scanner.log
scanimage-L.log
scanimage.log
are available at
http://members.shaw.ca/schoenrank.ca/sane-scm-2009-03-24.2/
Peter
-----
Peter Schoenrank
phone: 250-655-6753
Peter Schoenrank
2009-03-26 20:58:49 UTC
Permalink
I did an archive & install of Mac OS X 10.5. I updated to Mac OS X
10.5.6.

I did not install the software that comes with the Canon PIXMA MX850.
I did not install Parallels Desktop, or anything else.

I installed gettext 0.17, libusb 0.1.13 beta 2009-02-22 and sane-
backends 1.1.0-cvs 2009-02-20 as packaged for Mac OS X 10.5 by Mattias
Ellert. And then I

$ cd ~/Desktop/scanning_from_the_command_line
$ mkdir 2009-03-26.testing
$ cd 2009-03-26.testing
$ export SANE_DEBUG_SANEI_USB=255
$ export SANE_DEBUG=255
$ export SANE_DEBUG_PIXMA=20
$ sane-find-scanner &> sane-find-scanner.log

found USB scanner (vendor=0x04a9 [Canon], product=0x172c [MX850
series]) at libusb:007:002-04a9-172c-00-00

$ scanimage -L &> scanimage-L.log

device `pixma:04A9172C_21B0DA' is a CANON Canon PIXMA MX850 multi-
function peripheral

$ scanimage -d pixma:04A9172C_21B0DA -T &> scanimage.log

scanimage hangs as before, at the same place as before. This time at
least kill -9 managed to kill it.
Post by Nicolas Martin
If you run the scanimage -T command without sending the output to a
log
file, does it hang at the same place ?
As far as I can tell, yes. This time, kill -9 &c did not work and I
had to restart.
Post by Nicolas Martin
Could you please check the system log WHILE starting the scan? I would
guess that we are hanging in the kernel space
So after the restart, I did all the command lines again. The
system.log shows

Mar 26 13:42:35 Peter login[148]: USER_PROCESS: 148 ttys000
Mar 26 13:43:39 Peter kernel[0]: USBF: 568.261
AppleUSBEHCI[0x6a52800]::Found a transaction past the completion
deadline on bus 0xfd, timing out! (Addr: 2, EP: 0)
Mar 26 13:43:41 Peter kernel[0]: USBF: 570.261
AppleUSBEHCI[0x6a52800]::Found a transaction past the completion
deadline on bus 0xfd, timing out! (Addr: 2, EP: 0)


For those who care,
sane-find-scanner.log
scanimage-L.log
scanimage.log
system.log

are available at
http://members.shaw.ca/schoenrank.ca/2009-03-06_sane_testing/


Peter

-----
Peter Schoenrank
mailto: ***@schoenrank.ca
phone: 250-655-6753
Post by Nicolas Martin
OK, I have to stick with build issue myself... Sorry, can't help
with USB issues. I have only 1 addition suggestion. Try running
configure with "--prefix=/usr/local/testsane" to have it installed
in a custom location.
I've not fully followed in the other threads if you've ever install
a previous copy of sane into the prefix /usr/local... but perhaps
libsane is loading some older version of your backend that has these
USB issues.
Anyways, the --prefix idea can only help I think... but likely is
not your issue.
Chris
On Tue, Mar 24, 2009 at 4:24 PM, Peter Schoenrank
This still results in the warnings about IOKit/scsi/SCSITaskLib.h
that I previously posted, but as Chris suggested, I ignored those
because my scanner is USB not SCSI.
$ make check &> makecheck.log
$ make &> make.log
$ sudo make install &> makeinstall.log
$ sane-find-scanner &> sane-find-scanner.log
found USB scanner (vendor=0x04a9 [Canon], product=0x172c [MX850
series]) at libusb:007:002-04a9-172c-00-00
$ scanimage -L &> scanimage-L.log
device `pixma:04A9172C_21B0DA' is a CANON Canon PIXMA MX850 multi-
function peripheral
$ export SANE_DEBUG_SANEI_USB=255
$ export SANE_DEBUG=255
$ export SANE_DEBUG_PIXMA=20
$ scanimage -d pixma:04A9172C_21B0DA -T &> scanimage.log
And now I am back to where I was on Saturday: scanimage hangs.
For those who care,
config.log
configure.log
makecheck.log
make.log
makeinstall.log
sane-find-scanner.log
scanimage-L.log
scanimage.log
are available at
http://members.shaw.ca/schoenrank.ca/sane-scm-2009-03-24.2/
Peter
-----
Peter Schoenrank
phone: 250-655-6753
Nicolas Martin
2009-03-26 22:33:26 UTC
Permalink
Here, the log file you sent contains some more data exchanges with the
scanner (all correct, no error), before it hangs.

Dunno yet why it gets to hang, this needs some deeper look.
Here are the exchanges viewed from the pixma backend.
One point bothers me here is the read thread task id: 4297592832
Maybe this is due to MAC OS, needs some analysis here.


[pixma] pixma version 0.15.0
[pixma] pixma_collect_devices() found Canon PIXMA MX850 at
libusb:007:002-04a9-172c-00-00
[pixma] sanei_bjnp_find_devices:
[pixma] lo0 is not a valid IPv4 interface, skipping...
[pixma] lo0 is not a valid IPv4 interface, skipping...
[pixma] lo0 is not a valid IPv4 interface, skipping...
[pixma] lo0 is not a valid IPv4 interface, skipping...
[pixma] gif0 is not a valid IPv4 interface, skipping...
[pixma] stf0 is not a valid IPv4 interface, skipping...
[pixma] en0 is not a valid IPv4 interface, skipping...
[pixma] en0 is not a valid IPv4 interface, skipping...
[pixma] en0 is IPv4 capable, sending broadcast..
[pixma] fw0 is not a valid IPv4 interface, skipping...
[pixma] en1 is not a valid IPv4 interface, skipping...
[pixma] scanner discovery finished...
[pixma] pixma_open(): Canon PIXMA MX850
[pixma] OUT T=2.227 len=16
[pixma] 00000000:f3 20 00 00 00 00 00 00 00 00 00 00 00 00 00 10
[pixma]
[pixma] IN T=2.228 len=24
[pixma] 00000000:06 06 00 00 00 00 00 00 03 01 01 00 41 03 00 41
[pixma] 00000010:00 00 00 00 00 00 00 76
[pixma]
[pixma] Current status: paper=1 cal=0 lamp=65 busy=0
[pixma] INTR T=2.506 len=16
[pixma] 00000000:00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00
[pixma]
[pixma] Sending time: '09/03/26 12:40'
[pixma] OUT T=2.507 len=36
[pixma] 00000000:eb 80 00 00 00 00 00 00 00 00 00 00 00 00 00 14
[pixma] 00000010:30 39 2f 30 33 2f 32 36 20 31 32 3a 34 30 00 00
[pixma] 00000020:00 00 00 4d
[pixma]
[pixma] IN T=2.508 len=8
[pixma] 00000000:06 06 00 00 00 00 00 00
[pixma]
[pixma] Reader task id=4297592832 (threaded)
scanimage: reading one scanline, 1920 bytes... [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=640x877
[pixma] gamma_table=0x100812a50 source=0
[pixma] INTR T=2.781 len=16
[pixma] 00000000:00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00
[pixma]
[pixma] Sending time: '09/03/26 12:40'
[pixma] OUT T=2.781 len=36
[pixma] 00000000:eb 80 00 00 00 00 00 00 00 00 00 00 00 00 00 14
[pixma] 00000010:30 39 2f 30 33 2f 32 36 20 31 32 3a 34 30 00 00
[pixma] 00000020:00 00 00 4d
[pixma]
[pixma] IN T=2.782 len=8
[pixma] 00000000:06 06 00 00 00 00 00 00
[pixma]
Post by Peter Schoenrank
I did an archive & install of Mac OS X 10.5. I updated to Mac OS X
10.5.6.
I did not install the software that comes with the Canon PIXMA MX850.
I did not install Parallels Desktop, or anything else.
I installed gettext 0.17, libusb 0.1.13 beta 2009-02-22 and
sane-backends 1.1.0-cvs 2009-02-20 as packaged for Mac OS X 10.5 by
Mattias Ellert. And then I
$ cd ~/Desktop/scanning_from_the_command_line
$ mkdir 2009-03-26.testing
$ cd 2009-03-26.testing
$ export SANE_DEBUG_SANEI_USB=255
$ export SANE_DEBUG=255
$ export SANE_DEBUG_PIXMA=20
$ sane-find-scanner &> sane-find-scanner.log
found USB scanner (vendor=0x04a9 [Canon], product=0x172c [MX850
series]) at libusb:007:002-04a9-172c-00-00
$ scanimage -L &> scanimage-L.log
device `pixma:04A9172C_21B0DA' is a CANON Canon PIXMA MX850
multi-function peripheral
$ scanimage -d pixma:04A9172C_21B0DA -T &> scanimage.log
scanimage hangs as before, at the same place as before. This time at
least kill -9 managed to kill it.
Post by Nicolas Martin
If you run the scanimage -T command without sending the output to a
log
file, does it hang at the same place ?
As far as I can tell, yes. This time, kill -9 &c did not work and I
had to restart.
Post by Nicolas Martin
Could you please check the system log WHILE starting the scan? I would
guess that we are hanging in the kernel space
So after the restart, I did all the command lines again. The
system.log shows
Mar 26 13:42:35 Peter login[148]: USER_PROCESS: 148 ttys000
Mar 26 13:43:39 Peter kernel[0]: USBF: 568.261
AppleUSBEHCI[0x6a52800]::Found a transaction past the completion
deadline on bus 0xfd, timing out! (Addr: 2, EP: 0)
Mar 26 13:43:41 Peter kernel[0]: USBF: 570.261
AppleUSBEHCI[0x6a52800]::Found a transaction past the completion
deadline on bus 0xfd, timing out! (Addr: 2, EP: 0)
For those who care,
sane-find-scanner.log
scanimage-L.log
scanimage.log
system.log
are available at
http://members.shaw.ca/schoenrank.ca/2009-03-06_sane_testing/
Peter
-----
Peter Schoenrank
phone: 250-655-6753
Post by Nicolas Martin
OK, I have to stick with build issue myself... Sorry, can't help
with USB issues. I have only 1 addition suggestion. Try running
configure with "--prefix=/usr/local/testsane" to have it installed
in a custom location.
I've not fully followed in the other threads if you've ever install
a previous copy of sane into the prefix /usr/local... but perhaps
libsane is loading some older version of your backend that has these
USB issues.
Anyways, the --prefix idea can only help I think... but likely is
not your issue.
Chris
On Tue, Mar 24, 2009 at 4:24 PM, Peter Schoenrank
This still results in the warnings about IOKit/scsi/SCSITaskLib.h
that I previously posted, but as Chris suggested, I ignored those
because my scanner is USB not SCSI.
$ make check &> makecheck.log
$ make &> make.log
$ sudo make install &> makeinstall.log
$ sane-find-scanner &> sane-find-scanner.log
found USB scanner (vendor=0x04a9 [Canon], product=0x172c [MX850
series]) at libusb:007:002-04a9-172c-00-00
$ scanimage -L &> scanimage-L.log
device `pixma:04A9172C_21B0DA' is a CANON Canon PIXMA MX850
multi-function peripheral
$ export SANE_DEBUG_SANEI_USB=255
$ export SANE_DEBUG=255
$ export SANE_DEBUG_PIXMA=20
$ scanimage -d pixma:04A9172C_21B0DA -T &> scanimage.log
And now I am back to where I was on Saturday: scanimage hangs.
For those who care,
config.log
configure.log
makecheck.log
make.log
makeinstall.log
sane-find-scanner.log
scanimage-L.log
scanimage.log
are available at
http://members.shaw.ca/schoenrank.ca/sane-scm-2009-03-24.2/
Peter
-----
Peter Schoenrank
phone: 250-655-6753
--
http://lists.alioth.debian.org/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
Peter Schoenrank
2009-03-27 18:43:58 UTC
Permalink
Post by Nicolas Martin
Maybe this is due to MAC OS, needs some analysis here.
I agree, but as an end user, I am near the limit of my testing
abilities. I am willing to try a more recent version of libusb (if one
exists for Mac OS X) and to try a more recent version of sane-
backends, but as my first messages to this list about my problems with
configure and make show, I will need some help with applying patches
and building.

I am pretty good at following directions, and am willing to try
anything anyone has to suggest.


Peter
-----
Peter Schoenrank
mailto: ***@schoenrank.ca
phone: 250-655-6753
Nicolas Martin
2009-03-27 21:58:38 UTC
Permalink
Of course, when I said: "needs some analysis here", I was talking about
me ;-)
Post by Peter Schoenrank
Post by Nicolas Martin
Maybe this is due to MAC OS, needs some analysis here.
I agree, but as an end user, I am near the limit of my testing
abilities. I am willing to try a more recent version of libusb (if one
exists for Mac OS X) and to try a more recent version of sane-
backends, but as my first messages to this list about my problems with
configure and make show, I will need some help with applying patches
and building.
I am pretty good at following directions, and am willing to try
anything anyone has to suggest.
Peter
-----
Peter Schoenrank
phone: 250-655-6753
Louis Lagendijk
2009-03-26 22:35:36 UTC
Permalink
My guess that something in the kernel is causing the problems seems to
be right. Look at the system.log. It has a number of entries like:
Mar 26 13:34:19 localhost kernel[0]: USBF:6.248
AppleUSBEHCI[0x6a52800]::Found a transaction which hasn't moved in 5
seconds on bus 0xfd, timing out! (Addr: 2, EP: 0)

Some googling on "Found a transaction...." results in a number of
entries on USB errors.
Are there more devices on the USB? If so, try removing them. Try another
USB cable, try the device on another (non Mac) computer if possible. I
saw an answer from a guy at Apple that seems to suggest that this is a
pretty low level USB issue. Maybe try another USB port. see for
example:
http://lists.apple.com/archives/usb/2007/Feb/msg00001.html
http://www.insanelymac.com/forum/index.php?showtopic=18405 and
http://macosx.com/forums/mac-os-x-system-mac-software/303503-usb-ports-now-not-working-mbp-10-5-5-a.html


Louis
Post by Peter Schoenrank
I did an archive & install of Mac OS X 10.5. I updated to Mac OS X
10.5.6.
I did not install the software that comes with the Canon PIXMA MX850.
I did not install Parallels Desktop, or anything else.
I installed gettext 0.17, libusb 0.1.13 beta 2009-02-22 and
sane-backends 1.1.0-cvs 2009-02-20 as packaged for Mac OS X 10.5 by
Mattias Ellert. And then I
$ cd ~/Desktop/scanning_from_the_command_line
$ mkdir 2009-03-26.testing
$ cd 2009-03-26.testing
$ export SANE_DEBUG_SANEI_USB=255
$ export SANE_DEBUG=255
$ export SANE_DEBUG_PIXMA=20
$ sane-find-scanner &> sane-find-scanner.log
found USB scanner (vendor=0x04a9 [Canon], product=0x172c [MX850
series]) at libusb:007:002-04a9-172c-00-00
$ scanimage -L &> scanimage-L.log
device `pixma:04A9172C_21B0DA' is a CANON Canon PIXMA MX850
multi-function peripheral
$ scanimage -d pixma:04A9172C_21B0DA -T &> scanimage.log
scanimage hangs as before, at the same place as before. This time at
least kill -9 managed to kill it.
Post by Nicolas Martin
If you run the scanimage -T command without sending the output to a
log
file, does it hang at the same place ?
As far as I can tell, yes. This time, kill -9 &c did not work and I
had to restart.
Post by Nicolas Martin
Could you please check the system log WHILE starting the scan? I would
guess that we are hanging in the kernel space
So after the restart, I did all the command lines again. The
system.log shows
Mar 26 13:42:35 Peter login[148]: USER_PROCESS: 148 ttys000
Mar 26 13:43:39 Peter kernel[0]: USBF: 568.261
AppleUSBEHCI[0x6a52800]::Found a transaction past the completion
deadline on bus 0xfd, timing out! (Addr: 2, EP: 0)
Mar 26 13:43:41 Peter kernel[0]: USBF: 570.261
AppleUSBEHCI[0x6a52800]::Found a transaction past the completion
deadline on bus 0xfd, timing out! (Addr: 2, EP: 0)
For those who care,
sane-find-scanner.log
scanimage-L.log
scanimage.log
system.log
are available at
http://members.shaw.ca/schoenrank.ca/2009-03-06_sane_testing/
Peter
-----
Peter Schoenrank
phone: 250-655-6753
Post by Nicolas Martin
OK, I have to stick with build issue myself... Sorry, can't help
with USB issues. I have only 1 addition suggestion. Try running
configure with "--prefix=/usr/local/testsane" to have it installed
in a custom location.
I've not fully followed in the other threads if you've ever install
a previous copy of sane into the prefix /usr/local... but perhaps
libsane is loading some older version of your backend that has these
USB issues.
Anyways, the --prefix idea can only help I think... but likely is
not your issue.
Chris
On Tue, Mar 24, 2009 at 4:24 PM, Peter Schoenrank
This still results in the warnings about IOKit/scsi/SCSITaskLib.h
that I previously posted, but as Chris suggested, I ignored those
because my scanner is USB not SCSI.
$ make check &> makecheck.log
$ make &> make.log
$ sudo make install &> makeinstall.log
$ sane-find-scanner &> sane-find-scanner.log
found USB scanner (vendor=0x04a9 [Canon], product=0x172c [MX850
series]) at libusb:007:002-04a9-172c-00-00
$ scanimage -L &> scanimage-L.log
device `pixma:04A9172C_21B0DA' is a CANON Canon PIXMA MX850
multi-function peripheral
$ export SANE_DEBUG_SANEI_USB=255
$ export SANE_DEBUG=255
$ export SANE_DEBUG_PIXMA=20
$ scanimage -d pixma:04A9172C_21B0DA -T &> scanimage.log
And now I am back to where I was on Saturday: scanimage hangs.
For those who care,
config.log
configure.log
makecheck.log
make.log
makeinstall.log
sane-find-scanner.log
scanimage-L.log
scanimage.log
are available at
http://members.shaw.ca/schoenrank.ca/sane-scm-2009-03-24.2/
Peter
-----
Peter Schoenrank
phone: 250-655-6753
--
http://lists.alioth.debian.org/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
Peter Schoenrank
2009-03-27 02:37:03 UTC
Permalink
Post by Louis Lagendijk
Some googling on "Found a transaction...." results in a number of
entries on USB errors.
Are there more devices on the USB?
Yes.
Post by Louis Lagendijk
If so, try removing them.
According to System Profiler, this 24" Intel iMac has seven USB buses
(why so many?). Five appear to be strictly internal. One internal USB
bus (is that like an ATM machine?) has the Bluetooth USB host
controller on it. Another internal USB bus has the infrared receiver
on it. From the logs I have already posted, it seems at least some of
the other three internal buses have something on them, but nothing
else is shown in System Profiler.

One external bus has my keyboard and mouse on it. The MX850 is
connected to the other external bus, which has nothing else on it.

I can’t remove any of the internal stuff, and I need my keyboard and
mouse connected.
Post by Louis Lagendijk
Try another USB cable,
On Sunday, I had the Canon software installed, and I was able to
successfully scan using both the Canon software and Image Capture,
using the MX850 connected via this USB cable to this USB port.
Post by Louis Lagendijk
try the device on another (non Mac) computer if possible.
Sorry, this is an all Mac household.
Post by Louis Lagendijk
I saw an answer from a guy at Apple that seems to suggest that this
is a
pretty low level USB issue. Maybe try another USB port.
Tried that: no change.


Peter
-----
Peter Schoenrank
mailto: ***@schoenrank.ca
phone: 250-655-6753
Peter Schoenrank
2009-03-27 16:13:41 UTC
Permalink
Try another USB cable, try the device on another (non Mac) computer
if possible.
I connected the MX850 to a 17" flat-panel iMac running Mac OS X
10.4.11, using a different USB cable.

I installed gettext 0.17, libusb 0.1.13 beta 2009-02-22 and sane-
backends 1.1.0-cvs 2009-02-20 as packaged for Mac OS X 10.4 by Mattias
Ellert. And then I restarted the iMac. Then

$ cd ~/Desktop
$ mkdir scanning_from_the_command_line
$ cd scanning_from_the_command_line
$ mkdir 2009-03-26.testing
$ cd 2009-03-26.testing
$ export PATH=/usr/local/bin:$PATH
$ export SANE_DEBUG_SANEI_USB=255
$ export SANE_DEBUG=255
$ export SANE_DEBUG_PIXMA=20
$ sane-find-scanner &> sane-find-scanner.log

found USB scanner (vendor=0x04a9 [Canon], product=0x172c [MX850
series]) at libusb:007:002-04a9-172c-00-00

$ scanimage -L &> scanimage-L.log

device `pixma:04A9172C_21B0DA' is a CANON Canon PIXMA MX850 multi-
function peripheral

$ scanimage -d pixma:04A9172C_21B0DA -T &> scanimage.log

scanimage hangs as on the OS 10.5 iMac, seemingly at the same place as
on the OS 10.5 iMac. This time at least kill -9 managed to kill it.
system.log shows

KernelEventAgent[34]: tid 00000000 received unknown event (12)

Interestingly, closing the Terminal window (since it seems to be
irretrievably hung despite having killed scanimage), opening a new
Terminal window, and doing the above all over again results in
scanimage hanging seemingly at the same place, but this time the
scanimage process is not killable, and the system.log shows

kernel[0]: USBF: 952.776 AppleUSBOHCI[0x1a30800]::DoIOTransfer - error
0xe00002eb queueing request

This is repeatable on the 10.4 iMac: the first attempt at scanimage -T
immediately after restarting results in the KernelEventAgent message
and the scanimage process is killable. The second scanimage -T results
in the kernel USBF message and the scanimage process is not killable.

The complete logs for the first and second runs are available at
http://members.shaw.ca/schoenrank.ca/2009-03-27_sane_testing/
and
http://members.shaw.ca/schoenrank.ca/2009-03-27_sane_testing.2/


Peter
-----
Peter Schoenrank
mailto: ***@schoenrank.ca
phone: 250-655-6753
Peter Schoenrank
2009-03-28 05:00:23 UTC
Permalink
Post by Louis Lagendijk
http://lists.apple.com/archives/usb/2007/Feb/msg00001.html
http://www.insanelymac.com/forum/index.php?showtopic=18405 and
http://macosx.com/forums/mac-os-x-system-mac-software/303503-usb-ports-now-not-working-mbp-10-5-5-a.html
So I read some of what Louis linked to, and then I downloaded the Mac
OS X USB Debug Kit for 10.5.6 and installed it on the iMac running
10.5.6.
http://developer.apple.com/hardwaredrivers/download/usbdebug.html

I disconnected the MX850 from the network and connected it to my
10.5.6 iMac (which has the seemingly successful build and install of
the sane-scm-2009-03-27 nightly snapshot). I started USB Prober and
looked at the USB devices. Then

$ export SANE_DEBUG_SANEI_USB=255
$ export SANE_DEBUG=255
$ export SANE_DEBUG_PIXMA=20

Then I started USB Prober logging and

$ scanimage -T &> scanimage-T.log

scanimage hung, apparently where it always has for me. I can see that
some of the Prober log relates to scanimage; other than that it is all
meaningless to me. I hope it is meaningful to some of you.

The logs are available at
http://members.shaw.ca/schoenrank.ca/2009-03-27_sane_testing.5/

(USB_Prober.log is about 9.4 MB)


Peter
-----
Peter Schoenrank
mailto: ***@schoenrank.ca
phone: 250-655-6753
Mattias Ellert
2009-03-25 05:07:51 UTC
Permalink
Post by Chris Bagwell
You should be able to run without the --build option. Does it work
without it or is there a problem your trying to work around with it?
No, I’m just a noob who scratched his head while trying to read
through the documentation. I am not a developer, I am a Mac OS X end
user who wants to be able to scan from the command line so that I can
automate some repetitive scanning tasks.
If you are not really interested in building SANE from sources, but want
to use it - did you try the MacOS X binary installer packages at:

http://www.ellert.se/twain-sane/

Mattias
Peter Schoenrank
2009-03-25 17:59:21 UTC
Permalink
Firstly Mattias, I want to thank you for all the effort you have put
into creating the packages for TWAIN SANE Interface for Mac OS X. I
hadn’t realized just how much effort you had put into these packages
until I looked at your development directories.

I did try TWAIN SANE first, before embarking on this journey into
compiling sources for myself. It did not work with my newly acquired
Canon PIXMA MX850. At that time, I had convinced myself that the
problem seemed to be with the pixma backend rather than any of your
work. Hence I thought to grab the latest pixma backend and compile it
myself.

Now, I am not sure where the problem lies. Being a noob, I have
managed to confuse myself. Following on what Chris Bagwell has
suggested, I suspect that I have also managed to confuse my
installation of Mac OS X.

I am going to take some time to clear my mind, order my thoughts, and
start again from the beginning.

Many thanks to all who have tried to help me, and thank you to all who
have put so much effort into open source software.


Peter
Post by Mattias Ellert
If you are not really interested in building SANE from sources, but want
http://www.ellert.se/twain-sane/
Mattias
-----
Peter Schoenrank
mailto: ***@schoenrank.ca
phone: 250-655-6753
Nicolas Martin
2009-03-25 21:00:52 UTC
Permalink
Are you sure you got all the log trace in the scanimage.log file after
the scanimage -T command ?

Looks like it suddenly hangs (in libusb), but no error is output.

Do you get a core dump in /var/log/syslog or in /var/log/messages ?

If you run the scanimage -T command without sending the output to a log
file, does it hang at the same place ?

However, we can see for the moment, just before the log stops, that a
first pixma message is successfully exchanged with the scanner.

Nicolas
Post by Peter Schoenrank
$ export SANE_DEBUG_SANEI_USB=255
$ export SANE_DEBUG=255
$ export SANE_DEBUG_PIXMA=20
$ scanimage -d pixma:04A9172C_21B0DA -T &> scanimage.log
And now I am back to where I was on Saturday: scanimage hangs.
For those who care,
config.log
configure.log
makecheck.log
make.log
makeinstall.log
sane-find-scanner.log
scanimage-L.log
scanimage.log
are available at
http://members.shaw.ca/schoenrank.ca/sane-scm-2009-03-24.2/
Peter
-----
Peter Schoenrank
phone: 250-655-6753
Peter Schoenrank
2009-03-26 19:16:55 UTC
Permalink
My apologies for my tardy reply. I recently upgraded from Mac OS X
10.3 to 10.5, and I have been busy learning about the (sometimes
idiotic) differences.
Post by Nicolas Martin
Are you sure you got all the log trace in the scanimage.log file after
the scanimage -T command ?
No.

I am sure that Activity Monitor showed scanimage using 0.0 CPU for a
very long time before I restarted my Mac.

I had to restart: nothing else I tried would stop the scanimage
process. kill -9 and sudo killall didn’t work. Quit and Force Quit in
Activity Monitor did not work. Closing the Terminal window didn’t
work. Logging out and back in didn’t work.
Post by Nicolas Martin
Looks like it suddenly hangs (in libusb), but no error is output.
Do you get a core dump in /var/log/syslog or in /var/log/messages ?
No. I do not have a /var/log/syslog or a /var/log/messages.

/var/log/system.log does not go back that far and I don’t seem to have
any old system.logs. Mac OS X 10.3 kept old logs around; why 10.5
doesn’t seem to is yet another 10.5 peculiarity for me to investigate,
later.
Post by Nicolas Martin
If you run the scanimage -T command without sending the output to a log
file, does it hang at the same place ?
That is my recollection, though I am not 100% certain. I will try
again in the near future.


Peter
-----
Peter Schoenrank
mailto: ***@schoenrank.ca
phone: 250-655-6753
Louis Lagendijk
2009-03-26 20:13:31 UTC
Permalink
Post by Peter Schoenrank
My apologies for my tardy reply. I recently upgraded from Mac OS X
10.3 to 10.5, and I have been busy learning about the (sometimes
idiotic) differences.
Post by Nicolas Martin
Are you sure you got all the log trace in the scanimage.log file after
the scanimage -T command ?
No.
I am sure that Activity Monitor showed scanimage using 0.0 CPU for a
very long time before I restarted my Mac.
I had to restart: nothing else I tried would stop the scanimage
process. kill -9 and sudo killall didn’t work. Quit and Force Quit in
Activity Monitor did not work. Closing the Terminal window didn’t
work. Logging out and back in didn’t work.
This makes it sound like a case where libusb hangs somewhere in a
OS-call where the OS crashes/hangs.
Peter Schoenrank
2009-03-27 02:13:53 UTC
Permalink
[...] This could be because the MX850 is not connected on that Lan
(duh)
Yes, the MX850 was connected via USB.
[...] Peter is using an older version of
the pixma code [...].
Yes, because I couldn’t successfully build the 2009-03-24 nightly
snapshot.
[...] Peter could try the ethernet interface on his MX850 instead.
Is the
MX850 connected to the network?
It was connected by USB. I have tried it connected directly via
Ethernet cable (i.e. no hub or switch). I will give the details in a
future e-mail.
One last question: is any of the Canon Scangear stuff (see Canon
website) installed? Does that work?
The Canon Scangear stuff was installed when I did the testing two days
ago:
http://members.shaw.ca/schoenrank.ca/sane-scm-2009-03-24/
http://members.shaw.ca/schoenrank.ca/sane-scm-2009-03-24.2/

The Canon Scangear software does work. Of course, the Scangear
software doesn’t allow for scanning from the command line, which I
would like to be able to do.

The Canon Scangear software is not currently installed, and was not
installed when I tested earlier today:
http://members.shaw.ca/schoenrank.ca/2009-03-26_sane_testing/
One more note: the logfile seems to suggest that opening the device
failed. Was this the case where the process hung and could not be
killed?
scanimage -L &> scanimage-L.log
always seems to succeed, and finds
device `pixma:04A9172C_21B0DA' is a CANON Canon PIXMA MX850 multi-
function peripheral

scanimage -d pixma:04A9172C_21B0DA -T &> scanimage.log
always hangs, always seemingly at the same place, and only rarely can
the process be killed.


Peter
-----
Peter Schoenrank
mailto: ***@schoenrank.ca
phone: 250-655-6753
Peter Schoenrank
2009-03-27 18:27:16 UTC
Permalink
This could be because the MX850 is not connected on that Lan (duh)
So, I disconnected the USB cable and connected the MX850 to my D-Link
switch.

Then, from the 10.5 iMac (which currently has gettext 0.17, libusb
0.1.13 beta 2009-02-22 and sane-backends 1.1.0-cvs 2009-02-20 as
packaged for Mac OS X 10.5 by Mattias Ellert, and which does not
currently have the Canon software installed),

$ cd ~/Desktop/scanning_from_the_command_line
$ mkdir 2009-03-27_sane_testing.3
$ cd 2009-03-27_sane_testing.3
$ export SANE_DEBUG_SANEI_USB=255
$ export SANE_DEBUG=255
$ export SANE_DEBUG_PIXMA=20
$ sane-find-scanner &> sane-find-scanner.log
$ scanimage -L &> scanimage-L.log

device `pixma:04a9172c_d1da4f' is a CANON Canon PIXMA MX850 multi-
function peripheral

$ scanimage -d pixma:04a9172c_d1da4f -T &> scanimage-T.log

FAIL Error: Error during device I/O
[pixma] pixma_close(): Canon PIXMA MX850
[pixma] sanei_bjnp_close(1):


The scanimage process doesn’t hang, but the MX850 is left showing the
message "scanner is warming up" on its front panel. The message never
clears; pressing the Cancel button on the front panel results in
beeping; the MX850 must be power-cycled.

The system log shows
kernel[0]: USBF: 116.185 AppleUSBEHCI[0x6a52800]::Found a transaction
past the completion deadline on bus 0xfd, timing out! (Addr: 2, EP: 0)
kernel[0]: USBF: 118.186 AppleUSBEHCI[0x6a52800]::Found a transaction
past the completion deadline on bus 0xfd, timing out! (Addr: 2, EP: 0)

but that appears to be a result of the sane-find-scanner command.

The complete logs are available at
http://members.shaw.ca/schoenrank.ca/2009-03-27_sane_testing.3/


Peter
-----
Peter Schoenrank
mailto: ***@schoenrank.ca
phone: 250-655-6753
Louis Lagendijk
2009-03-27 21:01:25 UTC
Permalink
Hi Peter
Thanks for your patience. Here is some more input....
Louis
Post by Peter Schoenrank
This could be because the MX850 is not connected on that Lan (duh)
So, I disconnected the USB cable and connected the MX850 to my D-Link
switch.
Then, from the 10.5 iMac (which currently has gettext 0.17, libusb
0.1.13 beta 2009-02-22 and sane-backends 1.1.0-cvs 2009-02-20 as
packaged for Mac OS X 10.5 by Mattias Ellert, and which does not
currently have the Canon software installed),
$ cd ~/Desktop/scanning_from_the_command_line
$ mkdir 2009-03-27_sane_testing.3
$ cd 2009-03-27_sane_testing.3
$ export SANE_DEBUG_SANEI_USB=255
$ export SANE_DEBUG=255
$ export SANE_DEBUG_PIXMA=20
$ sane-find-scanner &> sane-find-scanner.log
$ scanimage -L &> scanimage-L.log
device `pixma:04a9172c_d1da4f' is a CANON Canon PIXMA MX850 multi-
function peripheral
great, very well documented!!!
Post by Peter Schoenrank
$ scanimage -d pixma:04a9172c_d1da4f -T &> scanimage-T.log
If scanimage finds only one scanner you can leave the -d parameter off
as it will pick the last auto-detected scanner.
Post by Peter Schoenrank
FAIL Error: Error during device I/O
[pixma] pixma_close(): Canon PIXMA MX850
The scanimage process doesn’t hang, but the MX850 is left showing the
message "scanner is warming up" on its front panel. The message never
clears; pressing the Cancel button on the front panel results in
beeping; the MX850 must be power-cycled.
Ok, scanning starts, but apparently you may be running into a bug I
fixed recently. You are not blocked by the firewall. I unfortunately
deleted your old mails to the list, so I could not check whether you
could compile the sane code yourself. Could you compile a recent CVS
version? I hate having to ask this. Fortunately you are not dependent on
libusb anymore. otherwise we may have to ask Mathias if he could kindly
compile a recent CVS version?
Nicolas, could it be an issue that even over USB, there is a problem
with the button scanning code? I completely disabled that in the bjnp
code after Raoul problems. It may be a long shot, but so far we seem to
have no real clue as to what is happening.Could this be causing the
problems for Peter? In the logs that Peter included now, my code is
loosing contact with the scanner after an interrupt read. Anyhow, using
a recent CVS should solve that issue for the bjnp interface.....
Post by Peter Schoenrank
The system log shows
kernel[0]: USBF: 116.185 AppleUSBEHCI[0x6a52800]::Found a transaction
past the completion deadline on bus 0xfd, timing out! (Addr: 2, EP: 0)
kernel[0]: USBF: 118.186 AppleUSBEHCI[0x6a52800]::Found a transaction
past the completion deadline on bus 0xfd, timing out! (Addr: 2, EP: 0)
but that appears to be a result of the sane-find-scanner command.
Right, this is caused by the "old" USB based scan. The BJNP code
emulates USB over IP, so it bypasses the kernel USB code as well as
libusb. So we should not run into the problems you were having over USB
if the error is in the kernel or libusb.
Post by Peter Schoenrank
The complete logs are available at
http://members.shaw.ca/schoenrank.ca/2009-03-27_sane_testing.3/
which show that the bjnp code looses the connection to the scanner (see
scanimage-T.log showing bjnp_recv_header: could not read response header
(select): Resource temporarily unavailable!).
I wish I could get my hands on a Mac to test myself.....
Post by Peter Schoenrank
Peter
-----
Peter Schoenrank
phone: 250-655-6753
Nicolas Martin
2009-03-27 21:57:04 UTC
Permalink
Hi all
Post by Louis Lagendijk
Hi Peter
Thanks for your patience. Here is some more input....
Louis
Post by Peter Schoenrank
This could be because the MX850 is not connected on that Lan (duh)
So, I disconnected the USB cable and connected the MX850 to my D-Link
switch.
Then, from the 10.5 iMac (which currently has gettext 0.17, libusb
0.1.13 beta 2009-02-22 and sane-backends 1.1.0-cvs 2009-02-20 as
packaged for Mac OS X 10.5 by Mattias Ellert, and which does not
currently have the Canon software installed),
$ cd ~/Desktop/scanning_from_the_command_line
$ mkdir 2009-03-27_sane_testing.3
$ cd 2009-03-27_sane_testing.3
$ export SANE_DEBUG_SANEI_USB=255
$ export SANE_DEBUG=255
$ export SANE_DEBUG_PIXMA=20
$ sane-find-scanner &> sane-find-scanner.log
$ scanimage -L &> scanimage-L.log
device `pixma:04a9172c_d1da4f' is a CANON Canon PIXMA MX850 multi-
function peripheral
great, very well documented!!!
Post by Peter Schoenrank
$ scanimage -d pixma:04a9172c_d1da4f -T &> scanimage-T.log
If scanimage finds only one scanner you can leave the -d parameter off
as it will pick the last auto-detected scanner.
Post by Peter Schoenrank
FAIL Error: Error during device I/O
[pixma] pixma_close(): Canon PIXMA MX850
The scanimage process doesn’t hang, but the MX850 is left showing the
message "scanner is warming up" on its front panel. The message never
clears; pressing the Cancel button on the front panel results in
beeping; the MX850 must be power-cycled.
Ok, scanning starts, but apparently you may be running into a bug I
fixed recently. You are not blocked by the firewall. I unfortunately
deleted your old mails to the list, so I could not check whether you
could compile the sane code yourself. Could you compile a recent CVS
version? I hate having to ask this. Fortunately you are not dependent on
libusb anymore. otherwise we may have to ask Mathias if he could kindly
compile a recent CVS version?
Nicolas, could it be an issue that even over USB, there is a problem
with the button scanning code? I completely disabled that in the bjnp
code after Raoul problems. It may be a long shot, but so far we seem to
have no real clue as to what is happening.Could this be causing the
problems for Peter? In the logs that Peter included now, my code is
loosing contact with the scanner after an interrupt read. Anyhow, using
a recent CVS should solve that issue for the bjnp interface.....
The button code is enable by an option in the Standard Options.
By default, this code is not enabled. So unless this options is
selected, the button code should not be runned.
Other kind of interrupts requested in usb are:
- send time: the scanner requests the date/time
- query status: the scanner request a query status message.
These are all the usb interrupt events that can be handled by the
backend.
What bothers me is that MX850 is reported to work fine on both usb and
bjnp, so I think we need to understand what is different here for MAC
OS.
Post by Louis Lagendijk
Post by Peter Schoenrank
The system log shows
kernel[0]: USBF: 116.185 AppleUSBEHCI[0x6a52800]::Found a transaction
past the completion deadline on bus 0xfd, timing out! (Addr: 2, EP: 0)
kernel[0]: USBF: 118.186 AppleUSBEHCI[0x6a52800]::Found a transaction
past the completion deadline on bus 0xfd, timing out! (Addr: 2, EP: 0)
but that appears to be a result of the sane-find-scanner command.
Right, this is caused by the "old" USB based scan. The BJNP code
emulates USB over IP, so it bypasses the kernel USB code as well as
libusb. So we should not run into the problems you were having over USB
if the error is in the kernel or libusb.
Post by Peter Schoenrank
The complete logs are available at
http://members.shaw.ca/schoenrank.ca/2009-03-27_sane_testing.3/
which show that the bjnp code looses the connection to the scanner (see
scanimage-T.log showing bjnp_recv_header: could not read response header
(select): Resource temporarily unavailable!).
I wish I could get my hands on a Mac to test myself.....
Post by Peter Schoenrank
Peter
-----
Peter Schoenrank
phone: 250-655-6753
--
http://lists.alioth.debian.org/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
Peter Schoenrank
2009-03-27 23:05:26 UTC
Permalink
Could you compile a recent CVS version?
On my OS X 10.5 iMac, I re-installed Xcode 3.1. I downloaded the
nightly CVS tree snapshot
http://alioth.debian.org/snapshots.php?group_id=30186

Then

$ cd ~/Desktop/scanning_from_the_command_line/sane-scm-2009-03-27
$ cd sane-backends/
$ export BACKENDS="pixma canon"
$ ./configure &> configure.log
$ make &> make.log

Then I removed all the things installed by the SANE backends 1.1.0-cvs
2009-02-20 package for Mac OS X 10.5 from Mattias Ellert. Then

$ sudo make install &> sudo_make_install.log

Then I restarted the iMac (mostly to make it easier for me to look
back through system.log). And with the MX850 still on the network, I

$ export SANE_DEBUG_SANEI_USB=255
$ export SANE_DEBUG=255
$ export SANE_DEBUG_PIXMA=20
$ scanimage -T &> scanimage-T.log

FAIL Error: Error during device I/O
[pixma] pixma_close(): Canon PIXMA MX850
[pixma] sanei_bjnp_close(0):

scanimage -T doesn’t hang, but the MX850 shows “Scanner is warming
up...” on its front panel, and the MX850 requires power-cycling.
system.log shows apparently nothing.

The logs are available at
http://members.shaw.ca/schoenrank.ca/2009-03-27_sane_testing.4/


Peter
-----
Peter Schoenrank
mailto: ***@schoenrank.ca
phone: 250-655-6753
Louis Lagendijk
2009-03-31 18:54:38 UTC
Permalink
hi Peter
finally some good news then! This proves that the backend basically
works on the Mac as well. I an only suprised to see that I had to
increase timeouts from the 10 seconds I used after Raoul had problems on
his mp620.
It would be good to see the logfiles of the failing attempts again. I
would like to check if there is a similarity in the places where the
failures occur. It may be a case that a timeout on USB is set too short
as well. Nicolas, could that be possible? On bjnp a read_bulk apparently
took more than 10 seconds to return. If something similar happens on
USB, would it be possible for the backend to loose synchronization with
the scanner?

Peter, can you check a normal scan without -T:
scanimage --resolution=300 --format=tiff> test.tiff and confirm that
this works ok too?

I will anyhow commit the changes to the pixma_bjnp.c

best regards,
Louis
Post by Nicolas Martin
Could you please
replace the pixma_bjnp.c in the backend directory with the attached
one,
recompile and try again over the network?
Note: since my last posting, I have installed the ScanGear software. I
did, after all, buy this MX850 because I need to scan and print. If
this is a problem, let me know and I can remove the Canon software
temporarily for testing.
I saved the attached pixma_bjnp.c to
~/Desktop/scanning_from_the_command_line/sane-scm-2009-03-27/sane-
backends/backend/pixma_bjnp.c
then
$ cd ~/Desktop/scanning_from_the_command_line/sane-scm-2009-03-27/sane-
backends/
$ sudo make uninstall
$ make distclean
$ export BACKENDS="canon pixma"
$ ./configure
$ make
$ sudo make install
Disconnected MX850 from USB; connected to Ethernet; confirmed self-
assigned IP.
$ export SANE_DEBUG_SANEI_USB=255
$ export SANE_DEBUG_PIXMA=20
$ export SANE_DEBUG=255
$ scanimage -T &> scanimage-T.log
That was so successful, that I tried
$ scanimage --format=tiff > image.tiff 2> scanimage.log
and ended up with an actual scan in image.tiff.
The logs are in
http://members.shaw.ca/schoenrank.ca/2009-03-27_sane_testing.6/
Many thanks to you, Louis.
Peter
-----
Peter Schoenrank
phone: 250-655-6753
Nicolas Martin
2009-03-31 19:13:54 UTC
Permalink
Hi,

Yes, We can try to change the USB timeout used in the usb read/write
statements.

It is currently set to 1s, a default standard value that probably never
got tuned.

I can change it to 10s at least for Peter to give a try.
Will look at this and propose a test file to Peter.

Nicolas
Post by Louis Lagendijk
hi Peter
finally some good news then! This proves that the backend basically
works on the Mac as well. I an only suprised to see that I had to
increase timeouts from the 10 seconds I used after Raoul had problems on
his mp620.
It would be good to see the logfiles of the failing attempts again. I
would like to check if there is a similarity in the places where the
failures occur. It may be a case that a timeout on USB is set too short
as well. Nicolas, could that be possible? On bjnp a read_bulk apparently
took more than 10 seconds to return. If something similar happens on
USB, would it be possible for the backend to loose synchronization with
the scanner?
scanimage --resolution=300 --format=tiff> test.tiff and confirm that
this works ok too?
I will anyhow commit the changes to the pixma_bjnp.c
best regards,
Louis
Post by Nicolas Martin
Could you please
replace the pixma_bjnp.c in the backend directory with the attached
one,
recompile and try again over the network?
Note: since my last posting, I have installed the ScanGear software. I
did, after all, buy this MX850 because I need to scan and print. If
this is a problem, let me know and I can remove the Canon software
temporarily for testing.
I saved the attached pixma_bjnp.c to
~/Desktop/scanning_from_the_command_line/sane-scm-2009-03-27/sane-
backends/backend/pixma_bjnp.c
then
$ cd ~/Desktop/scanning_from_the_command_line/sane-scm-2009-03-27/sane-
backends/
$ sudo make uninstall
$ make distclean
$ export BACKENDS="canon pixma"
$ ./configure
$ make
$ sudo make install
Disconnected MX850 from USB; connected to Ethernet; confirmed self-
assigned IP.
$ export SANE_DEBUG_SANEI_USB=255
$ export SANE_DEBUG_PIXMA=20
$ export SANE_DEBUG=255
$ scanimage -T &> scanimage-T.log
That was so successful, that I tried
$ scanimage --format=tiff > image.tiff 2> scanimage.log
and ended up with an actual scan in image.tiff.
The logs are in
http://members.shaw.ca/schoenrank.ca/2009-03-27_sane_testing.6/
Many thanks to you, Louis.
Peter
-----
Peter Schoenrank
phone: 250-655-6753
m. allan noah
2009-03-31 19:18:25 UTC
Permalink
FYI- most other backends seem to have usb timeouts on the order of 30
seconds, unless it is a command that routinely fails, in which case it
is often set quite short.

allan

On Tue, Mar 31, 2009 at 3:13 PM, Nicolas Martin
Post by Nicolas Martin
Hi,
Yes, We can try to change the USB timeout used in the usb read/write
statements.
It is currently set to 1s, a default standard value that probably never
got tuned.
I can change it to 10s at least for Peter to give a try.
Will look at this and propose a test file to Peter.
Nicolas
Post by Louis Lagendijk
hi Peter
finally some good news then! This proves that the backend basically
works on the Mac as well. I an only suprised to see that I had to
increase timeouts from the 10 seconds I used after Raoul had problems on
his mp620.
It would be good to see the logfiles of the failing attempts again. I
would like to check if there is a similarity in the places where the
failures occur. It may be a case that a timeout on USB is set too short
as well. Nicolas, could that be possible? On bjnp a read_bulk apparently
took more than 10 seconds to return. If something similar happens on
USB, would it be possible for the backend to loose synchronization with
the scanner?
scanimage --resolution=300 --format=tiff> test.tiff and confirm that
this works ok too?
I  will anyhow commit the changes to the pixma_bjnp.c
best regards,
Louis
Post by Nicolas Martin
Could you please
replace the pixma_bjnp.c in the backend directory with the attached
one,
recompile  and try again over the network?
Note: since my last posting, I have installed the ScanGear software. I
did, after all, buy this MX850 because I need to scan and print. If
this is a problem, let me know and I can remove the Canon software
temporarily for testing.
I saved the attached pixma_bjnp.c to
~/Desktop/scanning_from_the_command_line/sane-scm-2009-03-27/sane-
backends/backend/pixma_bjnp.c
then
$ cd ~/Desktop/scanning_from_the_command_line/sane-scm-2009-03-27/sane-
backends/
$ sudo make uninstall
$ make distclean
$ export BACKENDS="canon pixma"
$ ./configure
$ make
$ sudo make install
Disconnected MX850 from USB; connected to Ethernet; confirmed self-
assigned IP.
$ export SANE_DEBUG_SANEI_USB=255
$ export SANE_DEBUG_PIXMA=20
$ export SANE_DEBUG=255
$ scanimage -T &> scanimage-T.log
That was so successful, that I tried
$ scanimage --format=tiff > image.tiff 2> scanimage.log
and ended up with an actual scan in image.tiff.
The logs are in
http://members.shaw.ca/schoenrank.ca/2009-03-27_sane_testing.6/
Many thanks to you, Louis.
Peter
-----
Peter Schoenrank
phone: 250-655-6753
--
http://lists.alioth.debian.org/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
--
"The truth is an offense, but not a sin"
Peter Schoenrank
2009-04-01 16:36:43 UTC
Permalink
Following Louis idea, I tried to change some timing constants around
usb
timeouts.
Could you give a try to it, just replace the 2 place files to replace
the existing ones in your Sane CVS directory (subdir backend) and
recompile/reinstall, then try it with the same command as you did
before.
Saved pixma_io_sanei.c and pixma_io.h to
~/Desktop/scanning_from_the_command_line/sane-scm-2009-03-27/sane-
backends/backend/

then

$ cd ~/Desktop/scanning_from_the_command_line/sane-scm-2009-03-27/sane-
backends/
$ sudo make uninstall
$ make distclean
$ export BACKENDS="canon pixma"
$ ./configure
$ make
$ sudo make install
$ cd ~/Desktop/scanning_from_the_command_line/2009-03-27_sane_testing.8/
$ export SANE_DEBUG_SANEI_USB=255
$ export SANE_DEBUG=255
$ export SANE_DEBUG_PIXMA=20
$ scanimage -T &> scanimage-T.log

scanimage hangs, apparently in the same place as before. The log is
available as
http://members.shaw.ca/schoenrank.ca/2009-03-27_sane_testing.8/scanimage-T.log

Would you like me to try again after first turning on USB Probe?



Peter
-----
Peter Schoenrank
mailto: ***@schoenrank.ca
phone: 250-655-6753
Nicolas Martin
2009-04-01 20:11:20 UTC
Permalink
Have taken a look at the libusb/darwin.c code, and as far as I can see,
usb _interrupt_ read sequences do not support a timeout. Timeouts are
only used for normal read or write operations.
Now I understand the meaning of the last message that appears in your
logs:

"USB pipe is an interrupt pipe. Timeouts will not be used."

In the pixma backend, usb interrupt reads are regularly performed to
check for presence of an interrupt message provided by the scanner, for
status report, scan button state report, or time request.

A normal behavior of the libusb is to use the timeout, and if no such
interrupt message is sent by the scanner, backend processing goes on.

But with the MAC OS X libusb (darwin.c), this timeout, as not used,
makes the interrupt read statement to never end, that's why the backend
seems to get stuck there.
It is waiting indefinitely in read mode for an interrupt message, that
never comes as the scanner doesn't have anyone to send.

The question now is: why libusb on MAC OS X does not use timeouts for
interrupt reads, like libusb on Linux ?

Don't know the reason yet.

Nicolas
Post by Peter Schoenrank
Following Louis idea, I tried to change some timing constants around
usb
timeouts.
Could you give a try to it, just replace the 2 place files to replace
the existing ones in your Sane CVS directory (subdir backend) and
recompile/reinstall, then try it with the same command as you did
before.
Saved pixma_io_sanei.c and pixma_io.h to
~/Desktop/scanning_from_the_command_line/sane-scm-2009-03-27/sane-
backends/backend/
then
$ cd ~/Desktop/scanning_from_the_command_line/sane-scm-2009-03-27/sane-
backends/
$ sudo make uninstall
$ make distclean
$ export BACKENDS="canon pixma"
$ ./configure
$ make
$ sudo make install
$ cd ~/Desktop/scanning_from_the_command_line/2009-03-27_sane_testing.8/
$ export SANE_DEBUG_SANEI_USB=255
$ export SANE_DEBUG=255
$ export SANE_DEBUG_PIXMA=20
$ scanimage -T &> scanimage-T.log
scanimage hangs, apparently in the same place as before. The log is
available as
http://members.shaw.ca/schoenrank.ca/2009-03-27_sane_testing.8/scanimage-T.log
Would you like me to try again after first turning on USB Probe?
Peter
-----
Peter Schoenrank
phone: 250-655-6753
Peter Schoenrank
2009-04-03 17:12:27 UTC
Permalink
Could you give a try with this file attached, as before, replace CVS
one
in bakend sub directory with this one.
Saved pixma_io_sanei.c to
~/Desktop/scanning_from_the_command_line/sane-scm-2009-03-27/sane-
backends/backend/

then

$ cd ~/Desktop/scanning_from_the_command_line/sane-scm-2009-03-27/sane-
backends/
$ sudo make uninstall
$ make distclean
$ export BACKENDS="canon pixma"
$ ./configure
$ make
$ sudo make install
$ cd ~/Desktop/scanning_from_the_command_line/2009-03-27_sane_testing.8/
$ export SANE_DEBUG_SANEI_USB=255
$ export SANE_DEBUG=255
$ export SANE_DEBUG_PIXMA=20
$ scanimage -T &> scanimage-T.log

[pixma] pixma_read_image():cancelled by software
[pixma] Reader task terminated: ECANCELED
[pixma] pixma_close(): Canon PIXMA MX850
[sanei_usb] sanei_usb_close: closing device 0
usb_os_close: 04a9:172c

$ scanimage --format=tiff > test.tiff 2> scanimage.log

[pixma] pixma_read_image():completed
[pixma] Reader task terminated
[pixma] pixma_close(): Canon PIXMA MX850
[sanei_usb] sanei_usb_close: closing device 0
usb_os_close: 04a9:172c

and test.tiff is the scanned image as expected. Thank you Nicolas.

The logs are available at
http://members.shaw.ca/schoenrank.ca/2009-03-27_sane_testing.9/

and at
http://schoenrank.ca/scanning_from_the_command_line/2009-03-27_sane_testing.9/

The first will be much faster and more reliably available. The second
site contains older logs as well if you need them.



Peter
-----
Peter Schoenrank
mailto: ***@schoenrank.ca
phone: 250-655-6753
Nicolas Martin
2009-04-03 18:57:43 UTC
Permalink
Hi Peter,

Ok, this is a first step, it confirms the behavior of libusb interrupts
reads with darwin / MAC OS X, and that it does not handle timeouts.

In fact, the small change brought here (using a bulk read instead of
interrupt) leads to disabling the scan button features, as button events
are reported by usb interrupt messages.

So for now, I propose to add in the pixma code, a MAC OS X compilation
condition with this code. The pixma backend used under MACOS X will then
behave like this, all scanning feature are OK, but button scan will be
ineffective.

Nicolas
Post by Peter Schoenrank
Could you give a try with this file attached, as before, replace CVS
one
in bakend sub directory with this one.
Saved pixma_io_sanei.c to
~/Desktop/scanning_from_the_command_line/sane-scm-2009-03-27/sane-
backends/backend/
then
$ cd ~/Desktop/scanning_from_the_command_line/sane-scm-2009-03-27/sane-
backends/
$ sudo make uninstall
$ make distclean
$ export BACKENDS="canon pixma"
$ ./configure
$ make
$ sudo make install
$ cd ~/Desktop/scanning_from_the_command_line/2009-03-27_sane_testing.8/
$ export SANE_DEBUG_SANEI_USB=255
$ export SANE_DEBUG=255
$ export SANE_DEBUG_PIXMA=20
$ scanimage -T &> scanimage-T.log
[pixma] pixma_read_image():cancelled by software
[pixma] Reader task terminated: ECANCELED
[pixma] pixma_close(): Canon PIXMA MX850
[sanei_usb] sanei_usb_close: closing device 0
usb_os_close: 04a9:172c
$ scanimage --format=tiff > test.tiff 2> scanimage.log
[pixma] pixma_read_image():completed
[pixma] Reader task terminated
[pixma] pixma_close(): Canon PIXMA MX850
[sanei_usb] sanei_usb_close: closing device 0
usb_os_close: 04a9:172c
and test.tiff is the scanned image as expected. Thank you Nicolas.
The logs are available at
http://members.shaw.ca/schoenrank.ca/2009-03-27_sane_testing.9/
and at
http://schoenrank.ca/scanning_from_the_command_line/2009-03-27_sane_testing.9/
The first will be much faster and more reliably available. The second
site contains older logs as well if you need them.
Peter
-----
Peter Schoenrank
phone: 250-655-6753
Peter Schoenrank
2009-04-01 15:55:26 UTC
Permalink
Post by Louis Lagendijk
It would be good to see the logfiles of the failing attempts again.
I am limited by my ISP to 20 MB of web space. I can put the old logs
back up, but that means having to take down the most recent ones.
Post by Louis Lagendijk
scanimage --resolution=300 --format=tiff> test.tiff and confirm that
this works ok too?
It does indeed work. Also, scanimage --resolution=1200 --format=tiff
works as well.



Peter
-----
Peter Schoenrank
mailto: ***@schoenrank.ca
phone: 250-655-6753
Peter Schoenrank
2009-04-01 18:10:58 UTC
Permalink
Post by Louis Lagendijk
It would be good to see the logfiles of the failing attempts again.
I am limited by my ISP to 20 MB of web space. I can put the old logs
back up, but that means having to take down the most recent ones.
OK, after wrapping my head around Apache configuration files, and
beating my head against the way that Mac OS X configures Apache, and
beating my head against my D-Link NAT/router, all the logs should now
available at

http://96.54.44.192/scanning_from_the_command_line/

Let me know if you _can’t_ see them.

Be patient, it will be very slow; this is my home iMac, and my ISP
limits my uplink to 512 Kbps.

Now I am off to wrap my head around DynDNS, since 96.54.44.192 isn’t
guaranteed to remain constant.


Peter
-----
Peter Schoenrank
mailto: ***@schoenrank.ca
phone: 250-655-6753
Peter Schoenrank
2009-03-31 18:08:23 UTC
Permalink
Post by Nicolas Martin
Could you please
replace the pixma_bjnp.c in the backend directory with the attached
one,
recompile and try again over the network?
Note: since my last posting, I have installed the ScanGear software. I
did, after all, buy this MX850 because I need to scan and print. If
this is a problem, let me know and I can remove the Canon software
temporarily for testing.

I saved the attached pixma_bjnp.c to
~/Desktop/scanning_from_the_command_line/sane-scm-2009-03-27/sane-
backends/backend/pixma_bjnp.c

then

$ cd ~/Desktop/scanning_from_the_command_line/sane-scm-2009-03-27/sane-
backends/
$ sudo make uninstall
$ make distclean
$ export BACKENDS="canon pixma"
$ ./configure
$ make
$ sudo make install

Disconnected MX850 from USB; connected to Ethernet; confirmed self-
assigned IP.

$ export SANE_DEBUG_SANEI_USB=255
$ export SANE_DEBUG_PIXMA=20
$ export SANE_DEBUG=255
$ scanimage -T &> scanimage-T.log

That was so successful, that I tried

$ scanimage --format=tiff > image.tiff 2> scanimage.log

and ended up with an actual scan in image.tiff.

The logs are in
http://members.shaw.ca/schoenrank.ca/2009-03-27_sane_testing.6/

Many thanks to you, Louis.


Peter
-----
Peter Schoenrank
mailto: ***@schoenrank.ca
phone: 250-655-6753
Continue reading on narkive:
Loading...