WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Problems with libusb-01  (Read 4559 times)

Offline clach04

  • Newbie
  • *
  • Posts: 31
Problems with libusb-01
« on: July 24, 2011, 12:28:39 PM »
I've hit an issue where I think libusb.tcz (1.0.8) with tinycore_3.7.1 isn't working for libusb-0.1. I have a small tool that is working under Ubuntu (10.10), it also works under Puppy 4.2.1:

    $ ldd simpleloader
        linux-gate.so.1 =>  (0x00ec0000)
        libusb-0.1.so.4 => /lib/libusb-0.1.so.4 (0x008e4000)
        libc.so.6 => /lib/libc.so.6 (0x0069f000)
        /lib/ld-linux.so.2 (0x00625000)

where simpleloader is my libusb-0.1 based tool.

I tried using TC with libusb-0.1.so.4 copied from Ubunto into /lib, this works!

    linux-gate.so.1 =>  (0xb76f2000)
    libusb-0.1.so.4 => /lib/libusb-0.1.so.4 (0xb76e6000)
    libc.so.6 => /lib/libc.so.6 (0xb75a3000)
    /lib/ld-linux.so.2 (0xb76f3000)


When using libusb.tcz 1.0.8 from repo (tested 2011-07-24), on a fresh boot (i.e. no junk from copying shared libs around).

    $ ldd ./simpleloader
        linux-gate.so.1 =>  (0xb77d1000)
        libusb-0.1.so.4 => /usr/local/lib/libusb-0.1.so.4 (0xb77ca000)
        libc.so.6 => /lib/libc.so.6 (0xb7687000)
        libusb-1.0.so.0 => /usr/local/lib/libusb-1.0.so.0 (0xb767d000)
        librt.so.1 => /lib/librt.so.1 (0xb7674000)
        libpthread.so.0 => /lib/libpthread.so.0 (0xb765b000)
        /lib/ld-linux.so.2 (0xb77d2000)

I get hangs after searching through the usb devices (searching works), opening appears to hang.

The tcz description mentions 0.1 compatability. I'm not 100% sure but I think Ubuntu (and Puppy Linux) may use a real 0.1 release.

Ubunto 10.10, according to apt, appears to use libusb-0.1-4 (I'm using Ubuntu version 2:0.1.12-15ubuntu2).

Is it possible to provide a real 0.1 release? I may have misunderstood the situation, I'm not that familar with libusb :-(

Is there any more information I can provided about this? The hardware I'm using is rather bespoke so I doubt anyone is going to have it just lying around to test with under TC (if you are interested it is idVendor=0x1043 idProduct=0x82B2 I'm experimenting with http://code.google.com/p/dava33display ).

I'm working around my problem by using a pre-built libusb from Ubuntu but it maybe that others may hit this too.

Thanks!

Chris

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14823
Re: Problems with libusb-01
« Reply #1 on: July 24, 2011, 02:39:51 PM »
libusb-0.1.so.4 is a backwards compatibility wrapper for libusb-1.0 - in all this time, you're the first one to have a problem with this.

Maybe it might be better to compile a separate "true" libusb-0.1 or, failing that, you could try the extension from tc-2.x or 1.x

Offline clach04

  • Newbie
  • *
  • Posts: 31
Re: Problems with libusb-01
« Reply #2 on: July 24, 2011, 03:30:50 PM »
Trying an older TC extension sounds like a good idea. I can see the 3.x extensions at http://distro.ibiblio.org/tinycorelinux/3.x/tcz/index_nojs.html  I tried 2.x in the URL but got a 404. Sorry for a dumb question, do you have the 2.x url?

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: Problems with libusb-01
« Reply #3 on: July 24, 2011, 06:01:49 PM »
Do you mean a direct link like this one?

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11046
Re: Problems with libusb-01
« Reply #4 on: July 25, 2011, 02:51:52 AM »
Since it's your app, and libusb 0.1 is going away, perhaps you could update it to the latest stable API?
The only barriers that can stop you are the ones you create yourself.

Offline clach04

  • Newbie
  • *
  • Posts: 31
Re: Problems with libusb-01
« Reply #5 on: July 26, 2011, 01:31:48 AM »
libusb-0.1.so.4 is a backwards compatibility wrapper for libusb-1.0 - in all this time, you're the first one to have a problem with this.

Maybe it might be better to compile a separate "true" libusb-0.1 or, failing that, you could try the extension from tc-2.x or 1.x

I just tried the TC 2.x libusb, version 1.0..6. It hung too :-( The info file says it also includes the compat layer rather than original libusb-0.1.

Do you have a link for the TC 1.x series that I can try?

Offline clach04

  • Newbie
  • *
  • Posts: 31
Re: Problems with libusb-01
« Reply #6 on: July 26, 2011, 01:32:35 AM »
Do you mean a direct link like this one?

Yes, that was just what I was looking for. Thank you!

Offline clach04

  • Newbie
  • *
  • Posts: 31
Re: Problems with libusb-01
« Reply #7 on: July 26, 2011, 01:38:23 AM »
Since it's your app, and libusb 0.1 is going away, perhaps you could update it to the latest stable API?

I didn't write the original app (I'm hoping to implement a new one using pyusb).

Do you have a reference for libusb-0.1 going away? I thought it was marked as stable and mature. I'm new to usb programming so I've a steep learning curve to go through :-(  any doc references I can read would be useful.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14823
Re: Problems with libusb-01
« Reply #8 on: July 26, 2011, 01:43:30 AM »
In the tc-1.x repo, libusb and usb-utils were combined in one extension

http://distro.ibiblio.org/tinycorelinux/tcz/usb-utils.tczl

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11046
Re: Problems with libusb-01
« Reply #9 on: July 26, 2011, 01:50:38 AM »
I didn't write the original app (I'm hoping to implement a new one using pyusb).

Do you have a reference for libusb-0.1 going away? I thought it was marked as stable and mature. I'm new to usb programming so I've a steep learning curve to go through :-(  any doc references I can read would be useful.

I get that impression from upstream steps (marking 0.1 legacy, and shipping a compat layer etc.). The homepage says

Quote
As of December 2008, libusb-1.0 is the stable and recommended version to use. Developers are encouraged to port their applications to the new API.
The only barriers that can stop you are the ones you create yourself.

Offline clach04

  • Newbie
  • *
  • Posts: 31
Re: Problems with libusb-01
« Reply #10 on: July 27, 2011, 01:43:02 AM »
In the tc-1.x repo, libusb and usb-utils were combined in one extension

http://distro.ibiblio.org/tinycorelinux/tcz/usb-utils.tczl


Thanks, I wouldn't have worked that out on my own so it is goof you mentioned it!

I wasn't able to get the "tczl" from TC 1.x to open with TC 3.7.1 app loader. The 1.0.0 info file says it also includes the compat library so I'm not confident it will work if I could get that open.

I'll probably stick with the copied shared lib for the time being and if I get more familiar with what is going on, see if I can look at the compat lib. What is interesting is that it doesn't look like any of the major distros are using the compat lib.

I'm hoping to get off the need for libusb-0.1 by using the Python wrapper (which looks for a bunch of different libs, including Windows ones). I'm using the C version as a comparison tool,

Thanks for the suggestions, they were appreciated even though I wasn't able to make any head way.