OS2 World Community Forum

OS/2, eCS & ArcaOS - Technical => Applications => Topic started by: Paul Smedley on April 26, 2013, 01:24:47 pm

Title: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on April 26, 2013, 01:24:47 pm
Hi All,

Some would be aware that I have been working on porting libusb 1.0 to OS/2.  The previous OS/2 port is at version 0.1.x level, which is not used anymore by many current applications.

I have managed to successfully scan some files using Sane built with libusb 1.0, and I have also ported lsusb, a linux application to view attached USB devices.

I would be very appreciative if people could help by testing these applications on their systems.

For Sane - I'm really interested in users who are currently successfully scanning via *usb* with older versions/builds of Sane. I need to know if the libusb backend is performing as well as the previous backend that directly called usbcalls. The test Sane build is available from https://dl.dropboxusercontent.com/u/76425158/sane-1.0.23-os2-20130426.zip

For lsusb - I'm wanting to ensure all devices that show in something like usbdock, are shown by lsusb. Additionally, I want to ensure the information presented by 'lsusb -v' (ie a detailed device report) matches the device reports from usbdock (formatting differences aside). lsusb can be downloaded from https://dl.dropboxusercontent.com/u/76425158/lsusb.zip

See the readme.os2 in each package for details on how to capture the logging information from libusb.

Thanks in advance,

Paul
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Alex Taylor on April 26, 2013, 03:13:56 pm
Tried lsusb here on my TP500.  It detects exactly the same devices as USBDock: fingerprint reader, webcam, mouse, bluetooth, and keypad.  I assume you don't want the debug output if it worked properly. :)

I'll try sane on my other PC later today.
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Wim Brul on April 26, 2013, 06:24:54 pm
Nice work. I tried lsusb on eComStation 2.0 with the following results:

1. Yes, the devices that show up in UsbDock are shown by lsusb.

2. Yes, the information presented by 'lsusb -v' matches the device reports from  UsbDock.

3. No, the file /extras/share/usb.ids was not found.

I created d:\extras\share and copied usb.ids used by usbres.exe and that worked.
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Doug Bissett on April 26, 2013, 06:47:30 pm
7 systems. LSUSB works as described on all of them.

Sorry, no USB scanner to work with.
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on April 26, 2013, 11:06:31 pm
Nice work. I tried lsusb on eComStation 2.0 with the following results:

1. Yes, the devices that show up in UsbDock are shown by lsusb.

2. Yes, the information presented by 'lsusb -v' matches the device reports from  UsbDock.

3. No, the file /extras/share/usb.ids was not found.

I created d:\extras\share and copied usb.ids used by usbres.exe and that worked.

Thanks - I wonder if usb.ids is included in eCS.  If it is, I could try and change the code in lsusb to look in that location...
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: ivan on April 26, 2013, 11:52:54 pm
Hi Paul,

Where do you want us to send the debug information?

My report for Lsusb is about the same as Wim's except I have WSeB and am using Usbres (no eCS hence no UsbDock) for usb information

While Lsusb finds and identifies my Epson Perfection 640U scanner the version of Sane you want testing does not.  I have created a debug log file using the test.cmd you supplied in the zip hence my question about where you want that information sent.

Re. usb.ids just remember that not all of us are using eCS - mine is in the same dir as Usbres (\tools\usb).
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Gregg Young on April 27, 2013, 12:27:52 am
Thanks - I wonder if usb.ids is included in eCS.  If it is, I could try and change the code in lsusb to look in that location...

It is in eCS\bin
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on April 27, 2013, 03:37:48 am
Please send logs for things that are not working to Paul at Smedley dot id dot au

What would be really useful for sane is a debug log of a working scanimage -L

Hi Paul,

Where do you want us to send the debug information?

My report for Lsusb is about the same as Wim's except I have WSeB and am using Usbres (no eCS hence no UsbDock) for usb information

While Lsusb finds and identifies my Epson Perfection 640U scanner the version of Sane you want testing does not.  I have created a debug log file using the test.cmd you supplied in the zip hence my question about where you want that information sent.

Re. usb.ids just remember that not all of us are using eCS - mine is in the same dir as Usbres (\tools\usb).
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on April 27, 2013, 08:06:25 am
To be clearer (now that I'm home):

What I'd like is a scan using an older sane version using something like the following test.cmd
set SANE_DEBUG_EPSON2=255
set SANE_DEBUG_SANEI_USB=255
scanimage -v  >output.pnm 2>debugoutput.txt

with both a working Sane build - and also with the test build.

This will hopefully help me see where the problem in libusb lies.

Send both debugoutput.txt to me
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on April 27, 2013, 08:57:45 am
Please hold off testing USB scanners - I found some issues.

Turns out my 'successful' scans used the wrong build of scanimage :(

Now that I'm using the correct build I have some issues here too.

I fixed one already, but now I need to find an implementation for clock_gettime()
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Dave Yeo on April 27, 2013, 05:17:51 pm
Thanks - I wonder if usb.ids is included in eCS.  If it is, I could try and change the code in lsusb to look in that location...

It is in eCS\bin

Also a slightly older copy in amouse, they're both from 2007, at least in eCS 2.1
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on April 28, 2013, 02:21:39 am
Hi All,

Updated lsusb now available.

 https://dl.dropboxusercontent.com/u/76425158/lsusb-os2-20130428.zip Only significant change is that the max size for report from UsbQueryDeviceReport is now 2048 vs 1024 previously.

Interestingly, I had used 2048 in Sane, whereas Rich used 1024 for libusb 0.1 - guess where I stole the code from :)

Two builds included - one in logging, one in nonlogging.

This change hopefully fixes a problem Wim reported with DeviceReports failing on a Logitech webcam

Cheers,

Paul
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Barbara on April 28, 2013, 07:43:57 am
All versions work well and report the same devices identification of usbdock, but I have a scanner Mustek 1200 USB that when connected is attached and detached in an infinite loop, so, the report is right but sane/tame can't use it. I also disabled the usb widget (eCS 2.2 beta) but the scanner does not work (0kb output), indeed even before (tame included in eCS, the same problem).
Regards.
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on April 28, 2013, 11:49:14 am
Hi Barbara,

Please let me knwo thedevice id of he Mustek 1200 scanner.  Once I fix the remaining known issues I have here with libusb1.0 I'd like to try and fix the issues with your device.
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Barbara on April 28, 2013, 01:11:56 pm
Hi, Paul
lsusb report
Bus 001 Device 001: ID 055f:0006 Mustek Systems, Inc. ScanExpress 1200 UB
Thanks for your effort !
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on May 12, 2013, 02:14:52 am
Update:
I found a typo in UsbBulkWrite call! I can now print using Cups 1.6.2 usb.exe built against libusb 1.0!!!!!!

I can also scan on my T60 from my Canon LIDE20 scanner :)

People with USB scanners could try an updated scanimage.exe from http://smedley.id.au/tmp/scanimage.zip

I also need to work out why USB stuff isn't working for me anymore in Virtualbox - neither older builds of things that use libusb 0.1 or usbcalls, nor libusb-1.0 stuff.  I can see the devices, but I can't read/write to them - very frustrating :(
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Andy Willis on May 12, 2013, 05:55:01 am
I also need to work out why USB stuff isn't working for me anymore in Virtualbox - neither older builds of things that use libusb 0.1 or usbcalls, nor libusb-1.0 stuff.  I can see the devices, but I can't read/write to them - very frustrating :(
Are you using IBM drivers or Lar's drivers?  If Lar's, then which version?
Andy
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on May 12, 2013, 08:57:36 am
libmtp can produce a filetree on my Galaxy S4 too :) some weird errors that need debugging but some progress also :)

Example .exe's to play around with at http://smedley.id.au/tmp/libmtp-1.1.6-os2.zip
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on May 12, 2013, 08:59:11 am
I also need to work out why USB stuff isn't working for me anymore in Virtualbox - neither older builds of things that use libusb 0.1 or usbcalls, nor libusb-1.0 stuff.  I can see the devices, but I can't read/write to them - very frustrating :(
Are you using IBM drivers or Lar's drivers?  If Lar's, then which version?
Andy
I tend to think it's a virtualbox issue.  Currently using Lar's drivers - tried updating to the latest and didn't help.  I will switch back to the IBM versions, but meanwhile, I'll use my Thinkpad T60 for testing - ie real hardware.
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Barbara on May 12, 2013, 12:45:26 pm
No news here, just more time between the connection and disconnection of the scanner, which is always unusable (IBM T23, USB 1.1x2, scanner attached, last USB drive v. 191 from Hobbes), i'll try previous usb drivers.
Regards.
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on May 12, 2013, 01:29:29 pm
No news here, just more time between the connection and disconnection of the scanner, which is always unusable (IBM T23, USB 1.1x2, scanner attached, last USB drive v. 191 from Hobbes), i'll try previous usb drivers.
Regards.

Please generate a debug log for me.
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Barbara on May 12, 2013, 01:58:14 pm
This is the debug.log


No scanner available, and my mouse, a logitech, works fine.
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on May 12, 2013, 10:13:05 pm
HI Barbara,

Are you sure that's with the scanimage.exe I built yesterday? The debug messages you're getting are from libusb - the current executable has these messages turned off.

The correct scanimage.exe is:
12/05/13  10:01       5,769,032           0  scanimage.exe

from http://smedley.id.au/tmp/scanimage.zip

To turn on Sane debugging for your scanner try the following:
set SANE_DEBUG_MUSTEK_USB=255
set SANE_DEBUG_SANEI_USB=255
scanimage -L  >output.pnm 2>debugoutput.txt

This turns on debugging inside Sane for the Mustek backend, and also for the USB interface.

Debug output will go into debugoutput.txt
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Barbara on May 13, 2013, 05:53:23 am
Ok, correct file, the report is this
It seems always dead, no beeps, sounds or others...  ???
Regards
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Barbara on May 13, 2013, 06:03:53 am
And the content of output.pnm is:
device `mustek_usb:libusb:001:001' is a Mustek 1200 UB flatbed scanner
device `test:0' is a Noname frontend-tester virtual device
device `test:1' is a Noname frontend-tester virtual device
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on May 13, 2013, 09:14:24 am
This is good - the scanner is detected.

Now try:

scanimage >output.pnm 2>debugoutput.txt
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on May 15, 2013, 11:33:01 am
Woohoo - just built latest hpaio.dll from the HP opensource printing/scanning package. For the first time, USB scanning is working!!!!

I need to work some on packaging still, but I'm hopeful I'll have a binary for this within a few days.
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on May 15, 2013, 11:50:47 am
Hmmmmmm this could be interesting: https://code.google.com/p/btstack/
"Bluetooth for All!
The aim of this project is to support devices for which the OS either does not provide a Bluetooth Stack or the available stack is severely limited (e.g., on the iPhone - more than 2.5 million installations). In addition, BTstack is well suited for small, resource-constraint devices such as 8 or 16 bit embedded systems as it is highly configurable and comes with an ultra small memory footprint. A minimal configuration for an SPP server on a MSP430 can run in 32 kB FLASH and only 4 kB of RAM.

On larger POSIX systems, it provides a user-space daemon that connects to the Bluetooth modules via different Bluetooth HCI transport layers (e.g., HCI H4 UART and H5 the "Tree-Wire" protocol). Multiple applications can communicate with this daemon over different inter-process communication methods.

On embedded systems, a minimal run loop implementation allows to use BTstack without a Real Time OS (RTOS). If a RTOS is already used, BTstack can be integrated and run as a single thread. The source repository provides ports for different MSP430 development boards. Other platforms can be targeted by providing the necessary UART, CPU, and CLOCK implementations, see MSP430GettingStarted and EmbeddedSystems. Get the documentation for embedded systems: BTstack Manual v1.0.

Implementation of the Bluetooth 4.0 Low Energy specification has started and BTstack can be operated both as a single mode or a dual mode stack, see BLE.

For starters, look at the Wiki pages for an Architecture overview and the little GettingStarted example for iOS.

Quite a while ago, BTstack was presented at the Google Open Source Jam in Zurich with a focus on the iPhone.

BTstack is available under a dual license. The code provided in this repository allows for non-commercial use. Commercial use is provided by BlueKitchen GmbH."
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Barbara on May 15, 2013, 06:34:09 pm
This is the output
scanimage >output.pnm 2>debugoutput.txt
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: onlineuser2 on May 15, 2013, 07:16:50 pm
Paul, do you mean that bluetooth may be ported to os/2 ecomstation?
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: ivan on May 15, 2013, 11:27:19 pm
Paul, here are the outputs from my usb scanner.
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on May 16, 2013, 04:17:48 am
Paul, do you mean that bluetooth may be ported to os/2 ecomstation?
It may be possible. Of course, whether this means bluetooth keyboards/mice can be supported, remains to be seen.
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on May 16, 2013, 04:20:10 am
This is the output
scanimage >output.pnm 2>debugoutput.txt

Interesting - despite the previous log showing the scanner was detected:
[sanei_usb] sanei_usb_init: Looking for libusb-1.0 devices
[sanei_usb] sanei_usb_init: found 0 devices


Does lsusb see the scanner?
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on May 16, 2013, 04:23:05 am
Paul, here are the outputs from my usb scanner.

out.pnm shows:
device `epson2:libusb:001:001' is a Epson Perfection640 flatbed scanner

so this is the result of scanimage -L?

try scanimage > output.pnm and see if the scanner fires up.
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Wim Brul on May 16, 2013, 11:08:44 am
Hi Paul,

I used the following to obtain debugoutput.txt from my CanoScan LiDE 210 scanner. 

@echo off
setlocal
set beginlibpath=d:\sane23\lib;
set SANE_CONFIG_DIR=d:\sane23\etc\sane.d
set SANE_DEBUG_GENESYS=255
set SANE_DEBUG_SANEI_USB=255
d:\sane23\scanimage -L >output.pnm 2>debugoutput.txt
endlocal
exit

And it reports that the scanner is not configured:

[sanei_debug] Setting debug level of sanei_usb to 255.
[sanei_usb] sanei_usb_init: marking existing devices
[sanei_usb] sanei_usb_init: Looking for kernel scanner devices
[sanei_usb] sanei_usb_init: initializing libusb-1.0
[sanei_usb] sanei_usb_init: Looking for libusb-1.0 devices
[sanei_usb] sanei_usb_init: device 0x04a9/0x190a at 001:001 is not configured
[sanei_usb] sanei_usb_init: found 0 devices

Regards, Wim.
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on May 16, 2013, 11:18:05 am
I used the following to obtain debugoutput.txt from my CanoScan LiDE 210 scanner. 
And it reports that the scanner is not configured:

Can you confirm this is with:
12/05/13  10:01       5,769,032           0  scanimage.exe
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: ivan on May 16, 2013, 01:22:11 pm
Paul, just doing scanimage >output.pnm on my Epson 640U produces a black and white scan - just readable, would create problems with OCR.
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Wim Brul on May 16, 2013, 01:31:00 pm
I used the following to obtain debugoutput.txt from my CanoScan LiDE 210 scanner. 
And it reports that the scanner is not configured:

Can you confirm this is with:
12/05/13  10:01       5,769,032           0  scanimage.exe

Yes, that is the one I used. However, I shot myself in the foot :( since I had the scanner attached to my own usbecd.sys device driver at the same time. That driver never issues a set configuration request by itself although it always sets a flag that it has done so upon device attachment. Without that driver the scanner is configured. 
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Barbara on May 16, 2013, 07:04:59 pm
Last update:
lsusbout positive and only available without NeoWPS USB widget (using it attach and detach infinitly and lsusbout is null (0 size).
However scanimage/tame still don't work.
Regards.
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on May 16, 2013, 10:06:58 pm
Hi Ivan,

Paul, just doing scanimage >output.pnm on my Epson 640U produces a black and white scan - just readable, would create problems with OCR.

Yup - that's OK - so the scanner works?

try something like:
scanimage -mode color -resolution 300 -x 210 -y 297 > output.pnm

I think the default with the epson2 backend is for lineart mode.
scanimage --help -d epson2 will show you all the options for controlling the scanner backend.
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on May 16, 2013, 10:10:22 pm
I used the following to obtain debugoutput.txt from my CanoScan LiDE 210 scanner. 
And it reports that the scanner is not configured:

Can you confirm this is with:
12/05/13  10:01       5,769,032           0  scanimage.exe

Yes, that is the one I used. However, I shot myself in the foot :( since I had the scanner attached to my own usbecd.sys device driver at the same time. That driver never issues a set configuration request by itself although it always sets a flag that it has done so upon device attachment. Without that driver the scanner is configured.

The log shows:
[genesys] attach: found Canon flatbed scanner LiDE 210 at libusb:001:001

I don't seen any scan attempt. What command line was used?

To try a scan, just try:
scanimage > output.pnm

If it fails:
@echo off
setlocal
set beginlibpath=d:\sane23\lib;
set SANE_CONFIG_DIR=d:\sane23\etc\sane.d
set SANE_DEBUG_GENESYS=255
set SANE_DEBUG_SANEI_USB=255
d:\sane23\scanimage  >output.pnm 2>debugoutput.txt
endlocal
exit
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: ivan on May 17, 2013, 12:34:31 am
Hi Paul, yes, it scans.

using scanimage --mode color --resolution 300 I got the attached output - converted to jpg to take up less space.

Using --format tif produces the expected tif file output and all the resolutions work

I used the page I did because it represents the type of pages I have to copy and sometimes OCR.  In fact I'm quite pleased with the results, thank you.

I notice there are a lot of options in the epson2 backend listed as [inactive], will any of these be made active in the future?
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on May 17, 2013, 05:38:21 am
Hi Ivan,

using scanimage --mode color --resolution 300 I got the attached output - converted to jpg to take up less space.

Using --format tif produces the expected tif file output and all the resolutions work

I used the page I did because it represents the type of pages I have to copy and sometimes OCR.  In fact I'm quite pleased with the results, thank you.

I notice there are a lot of options in the epson2 backend listed as [inactive], will any of these be made active in the future?

Thanks for the feedback. IN terms of the [inactive] options in the epson2 backend, that's a question for the Sane guys - I jsut pored it to OS/2 :)

Cheers,

Paul.
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Wim Brul on May 17, 2013, 10:06:05 am
Quote
The log shows: [genesys] attach: found Canon flatbed scanner LiDE 210 at libusb:001:001
I don't seen any scan attempt. What command line was used?

I used d:\sane23\scanimage -L >output.pnm 2>debugoutput.txt

Quote
To try a scan, just try: scanimage > output.pnm

[D:\sane23]scanimage > output.pnm
scanimage: open of device genesys:libusb:001:001 failed: Invalid argument

That failed so I used:

@echo off
setlocal
set beginlibpath=d:\sane23\lib;
set SANE_CONFIG_DIR=d:\sane23\etc\sane.d
set SANE_DEBUG_GENESYS=255
set SANE_DEBUG_SANEI_USB=255
rem - d:\sane23\scanimage -L >output.pnm 2>debugoutput.txt
d:\sane23\scanimage >output.pnm 2>debugoutput.txt
endlocal
exit

This gives "sanei_usb_control_msg: libusb complained: Input/output error" always at the same spot when I try again after unplug/replug of the scanner. This is different from your earlier sane-1.0.22-os2-20120131.zip product which allows me to actual obtain a scan.
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on May 17, 2013, 11:42:53 am
Quote
The log shows: [genesys] attach: found Canon flatbed scanner LiDE 210 at libusb:001:001
I don't seen any scan attempt. What command line was used?

I used d:\sane23\scanimage -L >output.pnm 2>debugoutput.txt

Quote
To try a scan, just try: scanimage > output.pnm

[D:\sane23]scanimage > output.pnm
scanimage: open of device genesys:libusb:001:001 failed: Invalid argument

That failed so I used:

@echo off
setlocal
set beginlibpath=d:\sane23\lib;
set SANE_CONFIG_DIR=d:\sane23\etc\sane.d
set SANE_DEBUG_GENESYS=255
set SANE_DEBUG_SANEI_USB=255
rem - d:\sane23\scanimage -L >output.pnm 2>debugoutput.txt
d:\sane23\scanimage >output.pnm 2>debugoutput.txt
endlocal
exit

This gives "sanei_usb_control_msg: libusb complained: Input/output error" always at the same spot when I try again after unplug/replug of the scanner. This is different from your earlier sane-1.0.22-os2-20120131.zip product which allows me to actual obtain a scan.

Interesting. Any change of a debug log from 1.0.22? Might also be worth sending you a scanimage.exe with libusb logging enabled....
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Wim Brul on May 17, 2013, 12:33:20 pm
Quote
Any change of a debug log from 1.0.22? Might also be worth sending you a scanimage.exe with libusb logging enabled....

Hi Paul,

I have attached the relevant portion of the debugoutput.txt from 1.00.22.
Yes, please send me a scanimage.exe with libusb logging enabled.

Regards, Wim.
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on May 17, 2013, 11:14:09 pm
Quote
Any change of a debug log from 1.0.22? Might also be worth sending you a scanimage.exe with libusb logging enabled....
I have attached the relevant portion of the debugoutput.txt from 1.00.22.
Yes, please send me a scanimage.exe with libusb logging enabled.

http://smedley.id.au/tmp/scanimage-logging.zip
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Barbara on May 18, 2013, 07:50:33 am
Mine using this test.cmd:

set beginlibpath=c:\sane\lib;
set SANE_DEBUG_MUSTEK_USB=255
set SANE_DEBUG_SANEI_USB=255
set sane_config_dir=\sane\etc\sane.d
scanimage -v  >output.pnm 2>debugoutput.txt

return debugoutput.txt in attachment and a size 0  output.pnm
output.pnm came from  scanimage > output.pnm (your last with libusb logging enable)
Regards
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on May 18, 2013, 07:54:34 am
Mine using this test.cmd:

set beginlibpath=c:\sane\lib;
set SANE_DEBUG_MUSTEK_USB=255
set SANE_DEBUG_SANEI_USB=255
set sane_config_dir=\sane\etc\sane.d
scanimage -v  >output.pnm 2>debugoutput.txt

return debugoutput.txt in attachment and a size 0  output.pnm
output.pnm came from  scanimage > output.pnm (your last with libusb logging enable)
Regards

Same as before:
libusb: 0.001000 debug [os2_get_device_list] 0 devices detected

Which is weird, as you can see the scanner with scanimage -L and with lsusb

Seems there is something weird with USB or usbcalls on your system
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: ivan on May 18, 2013, 08:00:32 pm
Hi Paul,

A little more information.  I copied scanimage over to the tame directory and almost everything that worked with the old scanimage works with your new one - except sizing an area in the preview window.  I can size an area and it shows up as it did but scanimage scans the whole area regardless.  If this can be fixed, good, if not it just means cropping in PMView - one extra stage which will only be a big deal if I have a lot of scans to crop.
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Ian Manners on May 19, 2013, 10:52:11 am
With scanimage.exe  build 12/05/13   08:31

[D:\]scanimage -L
device `epson2:libusb:001:001' is a Epson GT-8300 flatbed scanner

scanimage --mode color --resolution 300 --brightness -1 > output.pnm
Produces the normal scan quality in color.

========================
[D:\]scanimage -L
device `plustek:libusb:001:001' is a Hewlett-Packard Scanjet 2200c flatbed scanner

scanimage --mode Color -l 0 -t 0 -x 215 -y 297 --resolution 150  > output.pnm
Looks good, requires scan area info.

========================
[D:\]scanimage -L
device `hp:libusb:001:001' is a Hewlett-Packard ScanJet 5200C flatbed scanner

scanimage --mode Color > output.pnm
Ohh, that's really nice gamma :)
This scanner has normally only been this good with the SCSI option.
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on May 19, 2013, 11:17:27 am
Hi Ivan,

A little more information.  I copied scanimage over to the tame directory and almost everything that worked with the old scanimage works with your new one - except sizing an area in the preview window.  I can size an area and it shows up as it did but scanimage scans the whole area regardless.  If this can be fixed, good, if not it just means cropping in PMView - one extra stage which will only be a big deal if I have a lot of scans to crop.

This is pretty strange - I doubt the command line syntax has changed - it certainly hasn't been caused by the libusb changes....

Might we worth enabling tame logging to see what command line it's passing to scanimage.
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: RBRi on May 19, 2013, 12:08:58 pm
Hi Paul,

did some test with my epson scanner.

device `plustek:libusb:001:001' is a Epson Perfection 1250/Photo flatbed scanner
device `test:0' is a Noname frontend-tester virtual device
device `test:1' is a Noname frontend-tester virtual device

The scanner is detected and a simple color scan has produced a tiff. Looks good so far.
Do you need anything more to be tested?

Thanks
     RBRi
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on May 20, 2013, 04:23:22 am
Hi RBRi

did some test with my epson scanner.

device `plustek:libusb:001:001' is a Epson Perfection 1250/Photo flatbed scanner
device `test:0' is a Noname frontend-tester virtual device
device `test:1' is a Noname frontend-tester virtual device

The scanner is detected and a simple color scan has produced a tiff. Looks good so far.
Do you need anything more to be tested?

Not really - the main thing I need is to confirm it is working as well as the previous Sane builds - it's good confirmation that libusb-1.0 is reasonably feature complete, which is a relief - as I spent way too much time on the port (most of it caused by my lack of programming skills :P)
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on May 25, 2013, 11:54:49 am
Added libusb 1.0 to my site at http://smedley.id.au/os2ports_new/index.php?page=libusb-1-0

It is now implemented as a DLL.

lsusb has also been added to that site as an example application that uses libusb10.dll

Future builds of Sane, CUPS and hplip will all use this DLL to provide support for USB devices.
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on May 25, 2013, 12:01:49 pm
A test version of scanimage (needs the full Sane 1.0.23 package from post 1) that uses libusb10.dll is at http://smedley.id.au/tmp/scanimage-20130525.zip This isn't working on my LIDE20 :(
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Wim Brul on May 25, 2013, 03:56:02 pm
I copied libusb10.dll into d:\ecs\dll and I copied lsusb.exe into d:\ecs.bin and lsusb works for me.
I copied scanimage.exe into d:\sane and I could scan :) with my CanoScan Lide 210 scanner.

@echo off
setlocal
set beginlibpath=d:\sane\lib;
set SANE_CONFIG_DIR=d:\sane\etc\sane.d
d:\sane\scanimage -d genesys --mode color --resolution 300 1>xscan.pnm 2>xscan.txt
d:\programs\tame\nconvert -in -1 -out bmp xscan.pnm
d:\mmos2\mmplayer\ib xscan.bmp
endlocal

Note: In previous posts I used d:\sane23 to distinguish from d:\sane which contains the old version and it appears that I must not do that. I had to rename d:\sane into d:\sane22 and to rename d:\sane23 into d:\sane in order to get the new version to work.
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: David McKenna on May 25, 2013, 03:58:28 pm
Paul,

  When I try 'lsusb -v'  I get an error: lsusb: 'cannot open "/extras/share/usb.ids", No such file or directory', and indeed there isn't. I do have usb.ids in C:\ecs\bin. I am able to scan with my Epson 2480 photo scanner, thanks!
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on May 25, 2013, 11:48:20 pm
Hi Dave,

  When I try 'lsusb -v'  I get an error: lsusb: 'cannot open "/extras/share/usb.ids", No such file or directory', and indeed there isn't. I do have usb.ids in C:\ecs\bin. I am able to scan with my Epson 2480 photo scanner, thanks!

For the next drop of lsusb, I'll try make it look in the default ecs location for usb.ids.

Glad your scanner works still :)

Cheers,

Paul
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on May 26, 2013, 01:28:33 am
  When I try 'lsusb -v'  I get an error: lsusb: 'cannot open "/extras/share/usb.ids", No such file or directory', and indeed there isn't. I do have usb.ids in C:\ecs\bin. I am able to scan with my Epson 2480 photo scanner, thanks!

With https://dl.dropboxusercontent.com/u/76425158/lsusb-20130526.zip it should look in %OS_DIR%\bin for usb.ids.  eCS sets OS_DIR to ?:\ECS, and installs usb.ids into \ecs\bin.

non eCS users can set OS_DIR to x:\OS2 and place usd.ids into x:\OS2\bin
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: David McKenna on May 26, 2013, 03:54:31 am
  Thanks again Paul... this new lsusb works just fine. I have also got your latest SANE working with Tame too - very nice! Think I'll push the envelope and see if I can get saned working and scan remotely...8-)
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on May 26, 2013, 08:36:59 am
Hi Dave,

  Thanks again Paul... this new lsusb works just fine. I have also got your latest SANE working with Tame too - very nice! Think I'll push the envelope and see if I can get saned working and scan remotely...8-)

Cool - great to hear! IIRC your printer is connected to a print server and not USB connected?
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on May 26, 2013, 11:57:23 am
libmtp build updated to use libusb10.dll - http://smedley.id.au/tmp/libmtp-1.1.6-os2.zip
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on May 26, 2013, 12:00:00 pm
I also have an (untested) heimdall build for anyone feeling brave and who owns a Samsung device
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: David McKenna on May 26, 2013, 10:20:21 pm
Paul,

  Yes, my printer is connected to a print server. Just FYI - reading the instructions for hpaio (even though I don't have an HP scanner) inspired me to try getting the HP backend for CUPS printing working. Setting up hplip.conf and running 'hp-mkuri -i 192.168.0.200' (which gave me the proper setting to use for the device), then changing the printer setting in CUPS and now I can print with the HP backend from HPLIP... woohoo! Now I am wondering if it would be possible to use any of the Python scripts that came with HPLIP? I'll eventually get to remote scanning....
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on May 27, 2013, 10:57:14 am
Hi Dave,
  Yes, my printer is connected to a print server. Just FYI - reading the instructions for hpaio (even though I don't have an HP scanner) inspired me to try getting the HP backend for CUPS printing working. Setting up hplip.conf and running 'hp-mkuri -i 192.168.0.200' (which gave me the proper setting to use for the device), then changing the printer setting in CUPS and now I can print with the HP backend from HPLIP... woohoo! Now I am wondering if it would be possible to use any of the Python scripts that came with HPLIP? I'll eventually get to remote scanning....

I'll try put together a printing  package based on 3.13.3 soon.  The python scripts from hplip aren't usable yet.  There are a couple of python modules that need to be compiled/installed, and PyQt probably needs some more work.
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on May 28, 2013, 11:27:43 am
I'll try put together a printing  package based on 3.13.3 soon.  The python scripts from hplip aren't usable yet.  There are a couple of python modules that need to be compiled/installed, and PyQt probably needs some more work.

I should also add that based on the amount of feedback on hplip and other things in general, I don't know that it's worth the significant effort that would be involved in getting PyQt and the hplip python scripts working.....
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Doug Bissett on May 28, 2013, 06:44:57 pm
I should also add that based on the amount of feedback on hplip and other things in general, I don't know that it's worth the significant effort that would be involved in getting PyQt and the hplip python scripts working.....

Hi Paul. Please remember that only about one in a hundred will say anything. Most users are not even sure what you are talking about, but they do appreciate the work that you do.

Personally, I have been using CUPS with my Canon i960, but it doesn't work properly. There seems to be something messed up in the configuration, and it cuts off about 5 mm on the right side of the page. The old OMNI driver, for the Canon i950 works better (and a LOT faster). CUPS does print though.

My brother has a Canon MP620, that you got working about a year ago, using WiFi (bjnp.exe, which doesn't seem to exist in the latest CUPS packages). At the end of June, I will be trying to update that again. Hopefully, the update will be done by installing eCS 2.2 GA.   :)   I will also try to get the built in scanner to work, if I have the time.

Meanwhile, I have been looking at what is available to update my own printer. The i960 has been showing its age, recently. It seems that every printer on the "working" list is not available, and there are newer ones that have replaced them (compatibility unknown). I probably won't get serious about that until August, but it seems to be a real problem. New printers, that are supported, don't even exist on the clearance shelves (but I haven't spent a lot of time looking, yet). I suppose that one answer would be to get an Apple printer, which is likely to get support, eventually. I am considering getting a color laser printer, but I don't want to spend a lot of money on something that I don't use very often.

About 30 years ago, I attended a presentation by IBM, where it was stated that printers probably wouldn't exist by1990. I knew that wasn't going to work when I saw the presenter check his e-mail, and print every one of them so he could read them (shredding them after reading, of course). Today, printers will become obsolete, simply because they change so fast that nobody can keep up to the changes, and people are starting to realize that it is faster, and easier, to view things on the screen. Portable screens also make that much easier.
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: David McKenna on May 28, 2013, 06:59:04 pm
Hi Paul,

  It's all good! I just like to tinker with these things and see how far I can take them. Any effort you take on any of this stuff is certainly appreciated by me at least... and I'm sure a lot of lurkers too.
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: ivan on May 28, 2013, 07:34:46 pm
Hi Paul,

I am one of the silent majority regarding CUPS and hplip. 

When the combination works with my HP Color Laserjet 3500 it works extremely well - this is through the print server on my D-Link Nas.  The problem I have is when the nas goes into sleep mode there is no way I can do any more printing without having to re-install CUPS.  I am assuming this is a problem caused by the nas and not CUPS/hplip hence I have not commented about it before this.

It is much quicker to just save up printing - by printing to file - and then open a cut down version of win XP in VirtualBox and print from there.
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on May 29, 2013, 04:51:36 am
Hi Doug,

I should also add that based on the amount of feedback on hplip and other things in general, I don't know that it's worth the significant effort that would be involved in getting PyQt and the hplip python scripts working.....
Hi Paul. Please remember that only about one in a hundred will say anything. Most users are not even sure what you are talking about, but they do appreciate the work that you do.

You are probably correct about the one in a hundred, but it's extremely frustrating.  Take libusb for example. I'd estimate I spent 20 - 30 hours working on it, possibly more, over a period of several weeks. Now that the port is available, it opens several doors in terms of other software that can be ported & used on OS/2.

I don't *personally* need any of these ports. My desktop OS has been Ubuntu since April 2011. The work I do on OS/2 is purely for a) entertainment and b) because I still have a soft spot for OS/2. I get a lot of satisfaction from getting things working, but in some cases, I put things out there via places like os2world, and based on no feedback - so I don't even know if they're found to be a) useful of b) work they never end up on my site as I don't want to link to things that a) aren't useful or b) don't work, to the possible detriment of other users.
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: David McKenna on May 29, 2013, 05:27:35 am
Hi Paul,

  I've spent some time trying to get network scanning going with saned and I'm so close I can smell it... but not quite there. 'Scanimage -L' works fine remotely, but when I try to do 'scanimage > scan.pnm', I hear the scanner initialize, then there is a 30 second lull, then the scanner initializes again and an error show on the remote machine: 'scanimage: sane_read: Error during device I/O'. I'm pretty sure I got all the proper settings in the various conf and TCPIP files.

  Is there a way to set up debugging of the network interface of SANE?
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Doug Bissett on May 29, 2013, 06:15:11 am
Hi Doug,

You are probably correct about the one in a hundred, but it's extremely frustrating.  Take libusb for example. I'd estimate I spent 20 - 30 hours working on it, possibly more, over a period of several weeks. Now that the port is available, it opens several doors in terms of other software that can be ported & used on OS/2.

I think that something like libusb would mean something only to other developers, who might need it for a project that they are working on. A normal user would have no need for such a thing, by itself. Since you asked for help, those who try to do more than sit back and wait, stepped forward, and did some testing. I must admit that I, for one, did not see any use for it, until you mentioned USB scanners. Whether it will actually turn into something useful, or not, remains to be seen, although initial reports from those who did some USB scanner testing, would seem to be somewhat encouraging. Then, there is the question about how many OS2/eCS users even have a USB scanner. I would bet that there are not a lot. If libusb turns out to be useful for scanners, there may be more, in the future. I for one have an antique Epson ES-1000C SCSI scanner, that doesn't want to work on recent hardware, and SCSI is becoming more of a problem, so I am thinking about getting a new scanner. I expect that it will be USB, when I find something that will likely work. Unfortunately, you usually cannot buy something, and return it just because it won't work with eCS.

I don't *personally* need any of these ports. My desktop OS has been Ubuntu since April 2011. The work I do on OS/2 is purely for a) entertainment and b) because I still have a soft spot for OS/2. I get a lot of satisfaction from getting things working, but in some cases, I put things out there via places like os2world, and based on no feedback - so I don't even know if they're found to be a) useful of b) work they never end up on my site as I don't want to link to things that a) aren't useful or b) don't work, to the possible detriment of other users.

We all appreciate what you do, many just don't bother to say so.

Perhaps you need to split your web site into two parts. 1) with "proven" software, and 2) with "experimental" software. When somebody reports that "experimental" software works, move it to the "proven" area (perhaps three good reports would be better). In fact, three parts, with the third being software support stuff, might make sense.

As for "aren't useful": I admit that I find a lot of what gets ported to be "not useful". I hate to say so, because others obviously find some of it to be useful, and every once in a while, I go looking for something that has been around for a while, that I didn't find useful when it first appeared. Perhaps you need some way for users to request "useful" ports. That would, of course, lead to porting libraries etc. Just picking something, because it sounds like something that people would like, will work sometimes, but spending two weeks on a picture viewer is probably a waste of time, because we already have PMView, which is hard to beat.

At the moment, I have been putting off collecting the information required to try to get Uniaud to work on my new Lenovo ThinkPad L530 system. Version 2.02.01, produced by DAZAR1, creates sound, but it is not right. Older versions won't even load. Now that David A. has got the Realtek Multimac driver working with it, I should get on with reporting the Uniaud problem, but I must admit that sound, on a laptop, is not a high priority for me.

If you are looking for something to do (yeah, right), Have a look at http://www.thinkwiki.org/wiki/Thinkpad-acpi (http://www.thinkwiki.org/wiki/Thinkpad-acpi). There is some indication that the program might enable WiFi radios on ThinkPad models where GENMAC/XWLAN won't do it. It has a number of other "interesting" features as well.
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Paul Smedley on May 29, 2013, 11:55:46 am
Hi Dave,

  I've spent some time trying to get network scanning going with saned and I'm so close I can smell it... but not quite there. 'Scanimage -L' works fine remotely, but when I try to do 'scanimage > scan.pnm', I hear the scanner initialize, then there is a 30 second lull, then the scanner initializes again and an error show on the remote machine: 'scanimage: sane_read: Error during device I/O'. I'm pretty sure I got all the proper settings in the various conf and TCPIP files.

  Is there a way to set up debugging of the network interface of SANE?

I haven't tried saned ina  number of years. I did a quick google and found http://penguin-breeder.org/sane/saned/

It suggests:
You can start saned with debugging enabled. To do this, you to disable the saned in your inetd.conf or xinetd.conf - otherwise you will get an error message telling you that saned couldn't bind a port. Just comment it out with hash-marks (#) or stop the whole inetd or xinetd server. Then start saned from the command line like this
       # SANE_DEBUG_MUSTEK=128 saned -d128
     
(assuming you have a Mustek SCSI scanner, see the man page of your backend for the exact name of the debug variable). If you are using csh or tcsh, you need to use setenv to set the debug variable.

Maybe you can find the error from the output yourself, if not, you can include it into a mail to the sane-devel mailing list. There should also be some output in your syslog.

On the client side you should use something like
        $ SANE_DEBUG_NET=128 scanimage -L
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: Barbara on May 29, 2013, 06:53:59 pm
Hi Paul, this info are also for my usb model?
Title: Re: libusb-1.0 port to OS/2 - help needed
Post by: David McKenna on May 29, 2013, 11:57:46 pm
  Thanks for the pointer Paul, I'll play around with it some more this week....