[sane-devel] "sane_read: Device busy" with Canon PIXMA MX310 and sane 1.0.20-4ubuntu3

Rogier Eggers rogiereggers at gmail.com
Wed Dec 2 23:37:01 UTC 2009


Hi Nicolas,

Ok, so indeed, the git version without pthtread works flawlessy (see
attached log). However, I so far didn't manage to build sane-backends with
pthread. After exactly following your instructions, I get the message below.
This is with no ubuntu sane packages installed. Can anybody tell me which
dev package I miss to build sane with pthread?

Regards,

Rogier


Error message during build process:

[snip]

rm -fr  .libs/libsanei.a .libs/libsanei.la
ar cru .libs/libsanei.a .libs/sanei_ab306.o .libs/sanei_constrain_value.o
.libs/sanei_init_debug.o .libs/sanei_net.o .libs/sanei_wire.o
.libs/sanei_codec_ascii.o .libs/sanei_codec_bin.o .libs/sanei_scsi.o
.libs/sanei_config.o .libs/sanei_config2.o .libs/sanei_pio.o
.libs/sanei_pa4s2.o .libs/sanei_auth.o .libs/sanei_usb.o
.libs/sanei_thread.o .libs/sanei_pv8630.o .libs/sanei_pp.o
.libs/sanei_lm983x.o .libs/sanei_access.o .libs/sanei_tcp.o
.libs/sanei_udp.o .libs/sanei_magic.o .libs/sanei_jpeg.o
ranlib .libs/libsanei.a
creating libsanei.la
(cd .libs && rm -f libsanei.la && ln -s ../libsanei.la libsanei.la)
make[1]: Leaving directory
`/home/rogier/Software/Src/sane-backends-git20091201/sanei'
Making all in backend
make[1]: Entering directory
`/home/rogier/Software/Src/sane-backends-git20091201/backend'
make  all-am
make[2]: Entering directory
`/home/rogier/Software/Src/sane-backends-git20091201/backend'
/bin/bash ../libtool --silent  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H
-I. -I../include/sane -I/usr/local/include -I. -I. -I../include -I../include
-DLIBDIR="/usr/lib/sane" -DBACKEND_NAME=dll
-DPATH_SANE_CONFIG_DIR=/etc/sane.d       -DPATH_SANE_DATA_DIR=/usr/share
  -DPATH_SANE_LOCK_DIR=/var/lock/sane       -DV_MAJOR=1 -DV_MINOR=0
-DUSE_PTHREAD -W -Wall -Wcast-align -Wcast-qual -Wmissing-declarations
-Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wstrict-prototypes
-pedantic -ansi -MT libdll_la-dll.lo -MD -MP -MF .deps/libdll_la-dll.Tpo -c
-o libdll_la-dll.lo `test -f 'dll.c' || echo './'`dll.c
dll.c: In function ‘load’:
dll.c:535: warning: ISO C forbids conversion of object pointer to function
pointer type
dll.c:560: warning: ISO C forbids conversion of object pointer to function
pointer type
mv -f .deps/libdll_la-dll.Tpo .deps/libdll_la-dll.Plo
/bin/bash ../libtool --silent --tag=CC   --mode=link gcc  -DUSE_PTHREAD -W
-Wall -Wcast-align -Wcast-qual -Wmissing-declarations -Wmissing-prototypes
-Wpointer-arith -Wreturn-type -Wstrict-prototypes -pedantic -ansi
-Wl,-z,defs  -o libdll.la  libdll_la-dll.lo
/bin/bash ../libtool --silent --tag=CC   --mode=link gcc  -DUSE_PTHREAD -W
-Wall -Wcast-align -Wcast-qual -Wmissing-declarations -Wmissing-prototypes
-Wpointer-arith -Wreturn-type -Wstrict-prototypes -pedantic -ansi
-Wl,-z,defs -rpath '/usr/lib' -version-number 1:0:21  -o libsane.la -rpath
/usr/lib libsane_la-dll-s.lo ../lib/liblib.la  libdll.la sane_strstatus.lo
../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo
../sanei/sanei_config.lo ../sanei/sanei_config2.lo ../sanei/sanei_usb.lo
../sanei/sanei_scsi.lo ../sanei/sanei_pv8630.lo ../sanei/sanei_pp.lo
../sanei/sanei_thread.lo  ../sanei/sanei_lm983x.lo ../sanei/sanei_access.lo
../sanei/sanei_net.lo ../sanei/sanei_wire.lo ../sanei/sanei_codec_bin.lo
../sanei/sanei_pa4s2.lo ../sanei/sanei_ab306.lo ../sanei/sanei_pio.lo
../sanei/sanei_tcp.lo ../sanei/sanei_udp.lo -ldl   -lm  -lieee1284  -ltiff
-ljpeg  -lgphoto2 -lgphoto2_port -lexif -lm -lusb  -lusb
../sanei/.libs/sanei_thread.o: In function `sanei_thread_kill':
sanei_thread.c:(.text+0xe5): undefined reference to `pthread_cancel'
../sanei/.libs/sanei_thread.o: In function `sanei_thread_begin':
sanei_thread.c:(.text+0x302): undefined reference to `pthread_create'
../sanei/.libs/sanei_thread.o: In function `sanei_thread_sendsig':
sanei_thread.c:(.text+0x3ac): undefined reference to `pthread_kill'
../sanei/.libs/sanei_thread.o: In function `sanei_thread_waitpid':
sanei_thread.c:(.text+0x3fa): undefined reference to `pthread_join'
sanei_thread.c:(.text+0x484): undefined reference to `pthread_detach'
collect2: ld returned 1 exit status
make[2]: *** [libsane.la] Error 1
make[2]: Leaving directory
`/home/rogier/Software/Src/sane-backends-git20091201/backend'
make[1]: *** [all] Error 2
make[1]: Leaving directory
`/home/rogier/Software/Src/sane-backends-git20091201/backend'
make: *** [all-recursive] Error 1








On Sat, Nov 28, 2009 at 3:32 PM, Nicolas Martin <nicolas0martin at gmail.com>wrote:

> After analysis: your log trace shows that Sane is compiled in Ubuntu
> Karmic with the USE_PTHREAD/-lpthread support, which revealed a bug at
> end of scan (not produced when pthread support is not activated).
>
> Just committed a fix, so could you please give a try with git Sane, and
> test both compilations options, with and without pthread support.
>
> You can follow the guidelines here to compile and install Sane:
> http://mp610.blogspot.com/2008/04/give-your-scanner-new-freshly-sane.html
>
> - To compile without pthread support, set firstly 2 export lines this:
>
> make distclean
> export CFLAGS=""
> export LIBS=""
>
> Then go on from the ./configure steps
>
> When you run a scan after activating the log trace (as explained in a
> previous mail), you should get in the log trace, a line like this near
> the beginning:
>
> [pixma] Reader task id=xxxx (forked)
>
> - To compile with pthread support (this is the Ubuntu/Karmic way), set
> first 2 export lines this:
>
> make distclean
> export CFLAGS="-DUSE_PTHREAD"
> export LIBS="-lpthread"
>
> Then go on from the ./configure steps
>
> When you run a scan after activating the log trace, you should get in
> the log trace, a line like this near the beginning:
>
> [pixma] Reader task id=-xxxxxxxxxx (threaded)
>
> In both cases, hopefully, the multi-page ADF scan should work correctly
> now ;-)
>
> Let us know.
> Nicolas
>
> Le mercredi 25 novembre 2009 à 21:44 +0100, Nicolas Martin a écrit :
> > I'll take a look to the log trace and compare it to some others I have
> > for multi-page ADF.
> > There's something abnormal at the end of the first scan page, which
> > leads to the "Canceled by Software" condition after the first scanned
> > page. Never saw it before, so will try to understand what produces that,
> > and will keep you posted.
> >
> > Probably will require a small change to the backend, so in the meantime,
> > could you download, recompile and install the git Sane version, as I'll
> > send you some patched file to be recompiled with the git version.
> >
> > Nicolas
> >
> > Le mardi 24 novembre 2009 à 23:55 +0100, Rogier Eggers a écrit :
> > > Hi Nicolas,
> > >
> > > Thanks for replying. Your debug instructions produced the attached log
> > > file. I hope you can make something of it.
> > >
> > > Regards,
> > >
> > > Rogier Eggers
> > >
> > >
> > > On Tue, 2009-11-24 at 08:15 +0100, Nicolas Martin wrote:
> > > > Hi Rogier,
> > > >
> > > > We would need first a log trace to see what's going on here, don't
> know
> > > > what could have changed with Karmic. Could you run the scanimage
> batch
> > > > command like this:
> > > >
> > > > $ export SANE_DEBUG_PIXMA=11
> > > > $ scanimage --batch --source="Automatic Document Feeder" -v -d
> > > > "pixma:04A91728_1163AA" -v 1> test.tiff  2> scanimage.log
> > > >
> > > > and send me back the scanimage.log file you'll get.
> > > >
> > > > Nicolas
> > > >
> > > > Le lundi 23 novembre 2009 à 23:40 +0100, Rogier Eggers a écrit :
> > > > > Hello,
> > > > >
> > > > > My scanner has trouble scanning multiple pages with the ADF. The
> > > > > second consecutive page with scanimage always gives me the
> following
> > > > > error:
> > > > >
> > > > > scanimage: sane_read: Device busy
> > > > > Scanned page 2. (scanner status = 3)
> > > > >
> > > > > This happens with all sane interfaces/programs that I have
> installed
> > > > > (xsane, scanimage from command line and gscn2pdf with all included
> > > > > frontends). Interestingly, there is no problem with scanning one
> page
> > > > > at a time (or scanning with the Flatbed). Documents do not get
> stuck
> > > > > in the scanner as I can issue the exact same command again and the
> > > > > next page (first page of that batch) will scan properly again.
> > > > >
> > > > > It used to work several months ago. Help very much appreciated!
> > > > >
> > > > > Earlier, I had a conversation on the gscan2pdf-help mailing list as
> I
> > > > > first experienced the problem with that program, but understandably
> I
> > > > > was referred to this list. See thread here:
> > > > >
> http://sourceforge.net/mailarchive/forum.php?thread_name=20091030150312.GB4933%40eeepc&forum_name=gscan2pdf-help
> > > > >
> > > > > Detail information:
> > > > >
> > > > > Canon PIXMA MX310 (usb connected multi-functional device)
> > > > > Ubuntu 9.10 Karmic
> > > > > libsane 1.0.20-4ubuntu3
> > > > > sane 1.0.14-7
> > > > > sane-utils 1.0.20-4ubuntu3
> > > > >
> > > > > Command and full output:
> > > > >
> > > > > rogier at rogier-desktop:~$ scanimage --batch --source="Automatic
> > > > > Document Feeder" -v -d "pixma:04A91728_1163AA" -v > test.tiff
> > > > > Scanning -1 pages, incrementing by 1, numbering from 1
> > > > > Scanning page 1
> > > > > scanimage: scanning image of size 640x877 pixels at 24 bits/pixel
> > > > > scanimage: acquiring RGB frame
> > > > > scanimage: min/max graylevel value = 22/255
> > > > > scanimage: read 1683840 bytes in total
> > > > > Scanned page 1. (scanner status = 5)
> > > > > Scanning page 2
> > > > > scanimage: scanning image of size 640x877 pixels at 24 bits/pixel
> > > > > scanimage: acquiring RGB frame
> > > > > scanimage: min/max graylevel value = 255/0
> > > > > scanimage: sane_read: Device busy
> > > > > Scanned page 2. (scanner status = 3)
> > > > > Closing device
> > > > > Calling sane_exit
> > > > > scanimage: finished
> > > > > rogier at rogier-desktop:~$
> > > > >
> > > > >
> > > > > Thanks & Regards,
> > > > >
> > > > > Rogier Eggers
> > > > > --
> > > > > 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"
> > > > >              to sane-devel-request at lists.alioth.debian.org
> > > >
> > >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20091203/28419d20/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scanimage_git_without_pthread.log
Type: text/x-log
Size: 2699 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20091203/28419d20/attachment-0001.bin>


More information about the sane-devel mailing list