[sane-devel] libusb/sane on macosx/darwin (not yet working...)

Henning Meier-Geinitz henning@meier-geinitz.de
Wed, 11 Dec 2002 13:18:24 +0100


Hi,

On Wed, Dec 11, 2002 at 12:40:55PM +0100, Beat Birkhofer wrote:
> Any Idea why sane failed?

An additional SANE_DEBUG_PLUSTEK=255 may help to find out, what the
backend is currently doing.

> is it possible to get more debug information without using gdb?

I don't think so. But you can add more DBGs or printfs in the
sanei_usb.c or libusb code.

> % scanimage -d plustek:libusb:002:002
> [sanei_debug] Setting debug level of sanei_usb to 128.
> usb_set_debug: Setting debugging level to 255 (on)
> usb_os_find_busses: Found 002
> usb_os_find_busses: Found 001
> usb_os_find_devices: Found 002 on 002
> usb_os_find_devices: Found 001 on 002

Two devices on bus 002. The root hub and the scanner?

> usb_os_open: 05ac:8005
> USB error: could not open device

It may make sense to find out, why this can't be opened.
On the other hand, that's probably the root hub, so it won't matter.

> usb_os_open: 04a9:220e
> usb_control_msg: 128 6 512 0 0xbfffe8f8 8 1000
> usb_control_msg: 128 6 512 0 0xc44d0 39 1000
> usb_os_close: 04a9:220e

The scanner. Looks ok.

> usb_os_find_devices: Found 001 on 001
> usb_os_open: 05ac:8005
> USB error: could not open device

First bus. Only the hub (?).

[...]

> [sanei_usb] sanei_usb_open: trying to open device `libusb:002:002'
> usb_os_open: 04a9:220e
> [sanei_usb] sanei_usb_open: ignoring interrupt-in endpoint (address: 1)
> [sanei_usb] sanei_usb_open: found bulk-in endpoint (address 2)
> [sanei_usb] sanei_usb_open: found bulk-out endpoint (address 3)
> [sanei_usb] sanei_usb_open: opened usb device `libusb:002:002' (*dn=0)

Open returned successfully.

> [sanei_usb] sanei_usb_get_vendor_product: device 0: vendorID: 0x04a9, productID: 0x220e

Now checking the ids. Returned successfully.

> [sanei_usb] sanei_usb_close: closing device 0
> usb_os_close: 04a9:220e

Ok. close doesn't return a status at all.

> scanimage: open of device plustek:libusb:002:002 failed: Error during device I/O

So I don't know where the error comes from. I don't think it's libusb
related, at least it's not obvious from the log. An I/O error can only
happen in the read/write/control message functions and those haven't
been called.

> [sanei_debug] Setting debug level of sanei_usb to 128.
> usb_set_debug: Setting debugging level to 255 (on)
> usb_os_find_busses: Skipping non bus directory devices
> usb_os_find_busses: Skipping non bus directory drivers
> usb_os_find_busses: Found 001
> usb_os_find_devices: Found 001 on 001
> invalid descriptor length of 0
> Unable to parse descriptors

Not nice, but it's the root hub. Maybe that's the reason for the error
about opening the hub on Mac?

> [sanei_usb] sanei_usb_open: trying to open device `libusb:001:002'
> [sanei_usb] sanei_usb_open: ignoring interrupt-in endpoint (address: 1)
> [sanei_usb] sanei_usb_open: found bulk-in endpoint (address 2)
> [sanei_usb] sanei_usb_open: found bulk-out endpoint (address 3)
> [sanei_usb] sanei_usb_open: opened usb device `libusb:001:002' (*dn=0)
> [sanei_usb] sanei_usb_get_vendor_product: device 0: vendorID: 0x04a9, productID: 0x220e
> [sanei_usb] sanei_usb_write_bulk: wanted 5 bytes, wrote 5 bytes

Something is different here, because there is no sane_close.

Bye,
  Henning