Matteo Gasparin | 4 Sep 17:33 2012
Picon

sane under windows XP / 7

I'm trying to write a multi platform scanning utility using SANE but, while everything with linux is fine, opening the device and all, I find issues with windows, both xp 32 and 7 64 bit. I downloaded the source and compiled it using cygwin and the libusb-win32 library and everything went fine; some of the backends didn't build:

*** canon_pp backend requires libieee1284 library - disabling
*** gphoto2 backend requires gphoto2 and JPEG libraries - disabling
*** hpsj5s backend requires libieee1284 library - disabling
*** mustek_pp backend requires libieee1284 and paraport-directio libraries - disabling
*** mustek_usb2 backend requires pthread library - disabling
*** pint backend requires sys/scanio.h - disabling
*** qcam backend requires ioperm and portaccess functions - disabling
*** v4l backend requires v4l libraries - disabling
*** pnm backend not manually selected - disabling

which is ok for me, since the scanner I'm trying to reach is a HP Scanjet 5300C, which should use the avisio backend. I thought it could be a USB driver issue so I used libwdi's zadig program to switch the normal xp driver with the libusb-win32 one. After that sane-find-scanner could correctly recognize the scanner but no luck using scanimage.

Did I do something wrong? Did I miss something?

On top of that I'm using Java and JNA to interface with SANE; again everything using linux is fine, while with windows it correctly loads the library and then hangs at the first call of sane_init(null, null) . Someone got an idea about that?

--

-- 
sane-devel mailing list: sane-devel <at> lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to sane-devel-request <at> lists.alioth.debian.org
Chris Bagwell | 5 Sep 03:13 2012

Re: sane under windows XP / 7

On Tue, Sep 4, 2012 at 10:33 AM, Matteo Gasparin
<email.diversa <at> gmail.com> wrote:
> I'm trying to write a multi platform scanning utility using SANE but, while
> everything with linux is fine, opening the device and all, I find issues
> with windows, both xp 32 and 7 64 bit. I downloaded the source and compiled
> it using cygwin and the libusb-win32 library and everything went fine; some
> of the backends didn't build:
>
> *** canon_pp backend requires libieee1284 library - disabling
> *** gphoto2 backend requires gphoto2 and JPEG libraries - disabling
> *** hpsj5s backend requires libieee1284 library - disabling
> *** mustek_pp backend requires libieee1284 and paraport-directio libraries -
> disabling
> *** mustek_usb2 backend requires pthread library - disabling
> *** pint backend requires sys/scanio.h - disabling
> *** qcam backend requires ioperm and portaccess functions - disabling
> *** v4l backend requires v4l libraries - disabling
> *** pnm backend not manually selected - disabling
>
> which is ok for me, since the scanner I'm trying to reach is a HP Scanjet
> 5300C, which should use the avisio backend. I thought it could be a USB
> driver issue so I used libwdi's zadig program to switch the normal xp driver
> with the libusb-win32 one. After that sane-find-scanner could correctly
> recognize the scanner but no luck using scanimage.
>
> Did I do something wrong? Did I miss something?

Hopefully, others with mingw32 experience will jump in as well.  But
to start, what version of sane-backends are you testing with?

I occasionally test cross compiling sane-backends on Fedora using
ming32 cross compiler and then I test the executable using wine with a
networked Epson scanner.  I compile with "configure BACKENDS=epson2"
so I don't get much visibility into other backends.  I have no
experience testing USB support under mingw32 though.

I believe avision is the only other backend that has much mingw32
testing by other users.  I thought there has been successful USB
access using libusb-win32 though.

Your probably going to have to start debugging to get much further.
You can try the SANE_DEBUG_SANEI_USB and SANEI_DEBUG_AVISION
environment variables and see if you can spot were things are going
wrong between Linux and Windows.

> On top of that I'm using Java and JNA to interface with SANE; again
> everything using linux is fine, while with windows it correctly loads the
> library and then hangs at the first call of sane_init(null, null) . Someone
> got an idea about that?

Hmm, not sure. I recall having some odd issues with finding config
files on windows.  I think you may have to change into scanimage
install directory before running your app or set the SANE_CONFIG_DIR
environment variable.

That type of failures shouldn't cause hang ups but you never know.

Chris

--

-- 
sane-devel mailing list: sane-devel <at> lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to sane-devel-request <at> lists.alioth.debian.org

Matteo Gasparin | 5 Sep 12:36 2012
Picon

Re: sane under windows XP / 7



2012/9/5 Chris Bagwell <chris <at> cnpbagwell.com>
On Tue, Sep 4, 2012 at 10:33 AM, Matteo Gasparin
<email.diversa <at> gmail.com> wrote:
> I'm trying to write a multi platform scanning utility using SANE but, while
> everything with linux is fine, opening the device and all, I find issues
> with windows, both xp 32 and 7 64 bit. I downloaded the source and compiled
> it using cygwin and the libusb-win32 library and everything went fine; some
> of the backends didn't build:
>
> *** canon_pp backend requires libieee1284 library - disabling
> *** gphoto2 backend requires gphoto2 and JPEG libraries - disabling
> *** hpsj5s backend requires libieee1284 library - disabling
> *** mustek_pp backend requires libieee1284 and paraport-directio libraries -
> disabling
> *** mustek_usb2 backend requires pthread library - disabling
> *** pint backend requires sys/scanio.h - disabling
> *** qcam backend requires ioperm and portaccess functions - disabling
> *** v4l backend requires v4l libraries - disabling
> *** pnm backend not manually selected - disabling
>
> which is ok for me, since the scanner I'm trying to reach is a HP Scanjet
> 5300C, which should use the avisio backend. I thought it could be a USB
> driver issue so I used libwdi's zadig program to switch the normal xp driver
> with the libusb-win32 one. After that sane-find-scanner could correctly
> recognize the scanner but no luck using scanimage.
>
> Did I do something wrong? Did I miss something?

Hopefully, others with mingw32 experience will jump in as well.  But
to start, what version of sane-backends are you testing with?

I occasionally test cross compiling sane-backends on Fedora using
ming32 cross compiler and then I test the executable using wine with a
networked Epson scanner.  I compile with "configure BACKENDS=epson2"
so I don't get much visibility into other backends.  I have no
experience testing USB support under mingw32 though.

I believe avision is the only other backend that has much mingw32
testing by other users.  I thought there has been successful USB
access using libusb-win32 though.

Your probably going to have to start debugging to get much further.
You can try the SANE_DEBUG_SANEI_USB and SANEI_DEBUG_AVISION
environment variables and see if you can spot were things are going
wrong between Linux and Windows.

> On top of that I'm using Java and JNA to interface with SANE; again
> everything using linux is fine, while with windows it correctly loads the
> library and then hangs at the first call of sane_init(null, null) . Someone
> got an idea about that?

Hmm, not sure. I recall having some odd issues with finding config
files on windows.  I think you may have to change into scanimage
install directory before running your app or set the SANE_CONFIG_DIR
environment variable.

That type of failures shouldn't cause hang ups but you never know.

Chris
I'm using the 1.0.22 tarball downloaded from https://alioth.debian.org/frs/?group_id=30186
For the environment variables, do I just need to set them and they will be picked by the dll?
Is the use of libdwi the only way to see the usb devices from Windows? Seems kind of a complicated and hackish way to get it work...

Thanks for the advice about the working directory, I'll try to verify that

Also, sorry for the double post
--

-- 
sane-devel mailing list: sane-devel <at> lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to sane-devel-request <at> lists.alioth.debian.org
Matteo Gasparin | 5 Sep 12:12 2012
Picon

Re: sane under windows XP / 7

I'm using the 1.0.22 tarball downloaded from https://alioth.debian.org/frs/?group_id=30186
For the environment variables, do I just need to set them and they will be picked by the dll?
Is the use of libdwi the only way to see the usb devices from Windows? Seems kind of a complicated and hackish way to get it work...

Thanks for the advice about the working directory, I'll try to verify that

--

-- 
sane-devel mailing list: sane-devel <at> lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to sane-devel-request <at> lists.alioth.debian.org
Chris Bagwell | 5 Sep 16:23 2012

Re: sane under windows XP / 7

On Wed, Sep 5, 2012 at 5:12 AM, Matteo Gasparin <email.diversa <at> gmail.com> wrote:
> I'm using the 1.0.22 tarball downloaded from
> https://alioth.debian.org/frs/?group_id=30186

You'll want to download the just released 1.0.23 or grab from git.  It
has several mingw32 bugfixes.

> For the environment variables, do I just need to set them and they will be
> picked by the dll?

yes.  See 'man sane-usb' and 'man sane-avision' for examples.

> Is the use of libdwi the only way to see the usb devices from Windows? Seems
> kind of a complicated and hackish way to get it work...

What is libdwi?  libusb-win32 is needed and I hear windows support has
been integrated into libusb-1.x library directory but requires minor
header file fixes in sane to use them.

Chris

--

-- 
sane-devel mailing list: sane-devel <at> lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to sane-devel-request <at> lists.alioth.debian.org

Matteo Gasparin | 7 Sep 14:40 2012
Picon

Re: sane under windows XP / 7

2012/9/5 Chris Bagwell <chris <at> cnpbagwell.com>
On Wed, Sep 5, 2012 at 5:12 AM, Matteo Gasparin <email.diversa <at> gmail.com> wrote:
> I'm using the 1.0.22 tarball downloaded from
> https://alioth.debian.org/frs/?group_id=30186

You'll want to download the just released 1.0.23 or grab from git.  It
has several mingw32 bugfixes.

> For the environment variables, do I just need to set them and they will be
> picked by the dll?

yes.  See 'man sane-usb' and 'man sane-avision' for examples.

> Is the use of libdwi the only way to see the usb devices from Windows? Seems
> kind of a complicated and hackish way to get it work...

What is libdwi?  libusb-win32 is needed and I hear windows support has
been integrated into libusb-1.x library directory but requires minor
header file fixes in sane to use them.

Chris

That was a typo, it's libwdi, not libdwi. Located here: http://sourceforge.net/apps/mediawiki/libwdi/index.php?title=Main_Page. I tried the 1.0.23 version, and maybe I'll try git, but still no luck. Using a utility (zadig) in the libwdi package you can substitute the native windows usb driver with a libusb-win32 compatible one (I guess?). Doing that sane-find-scanner is able to detect the scanner but scanimage -L says "no scanners identified". Without the intervention of libwdi not even sane-find-scanner finds the device. I also tried with a Kodak i2600 scanner, same results. The windows driver for the devices are not installed (and in fact seems that for the hp 5300C they don't exist anymore). Now I'm using windows 7 32 bit.

Thanks for the answers
--

-- 
sane-devel mailing list: sane-devel <at> lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to sane-devel-request <at> lists.alioth.debian.org

Gmane