Paul Alfille | 1 Feb 2005 03:17
Picon
Favicon

Thread Safety

> libusb is definately *not* threadsafe right now. There have been some
> discussions about solving this for the 1.0 API. It is not usable right
> now, so I wouldn't suggest using it yet.

This is a problem for me. What is the issue? Global data?

Can I use 2 usb devices if the actual library calls dont overlap, or is 
opening two USB devices in the same program a problem?

Paul Alfille

-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
Johannes Erdfelt | 1 Feb 2005 03:27

[rfc] libusbpp and QT

I received a report from a user that they weren't able to compile libusb
without X being installed. This is because libusbpp (the C++ API) uses
QT.

The features that libusbpp uses from QT have similar operations in the
STL.

So I hacked up this patch to remove the QT dependency and move it to
something more standard.

It's a rough first stab at the port. Two things of note about it:

1) The iteration is a bit clunky. I like the old method better so I
think I may implement some code workalike class members to do that.
2) No Unicode support. This is actually something useful, but I don't
know if we should go out of our way to support it or not.

Anyway, any opinions?

JE

Index: Makefile.am
===================================================================
RCS file: /cvsroot/libusb/libusb/Makefile.am,v
retrieving revision 1.35
diff -u -r1.35 Makefile.am
--- Makefile.am	1 Feb 2005 00:18:12 -0000	1.35
+++ Makefile.am	1 Feb 2005 02:10:12 -0000
(Continue reading)

Johannes Erdfelt | 1 Feb 2005 03:30

Re: Thread Safety

On Mon, Jan 31, 2005, Paul Alfille <palfille <at> earthlink.net> wrote:
> > libusb is definately *not* threadsafe right now. There have been some
> > discussions about solving this for the 1.0 API. It is not usable right
> > now, so I wouldn't suggest using it yet.
> 
> This is a problem for me. What is the issue? Global data?

Of sorts.

> Can I use 2 usb devices if the actual library calls dont overlap, or is 
> opening two USB devices in the same program a problem?

No, you can open two USB devices at the same time and if you lock around
calls into libusb, you'll be ok.

The problems with libusb have to do with concurrency.

No locks are used for any lists or data structures.

Also, in the Linux port, the usage of the URB interface assumes no other
callers. This can cause problems. Actually, I need to look into this
further. It's probably only an issue when you do multiple transfers to
the same device simultaneously. I think concurrency between devices
should be fine.

JE

-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
(Continue reading)

david kedrosky | 1 Feb 2005 07:17
Picon

Beginners help

Hello, 

I want to start using libusb and so have tried to write a simple
program.  I seem to be having an infinite for-loop problem in
device_init()

 I don't get any compile errors.

 any help would be awesome,

 dave

#include <stdio.h>
#include <string.h>
#include <usb.h>

#define KEYB_VEND_ID 0x0A81

static struct usb_device *device_init(void)
{
  struct usb_bus *bus;
  struct usb_device *dev;

  usb_init();
  usb_find_busses();
  usb_find_devices(); 

	for (bus = usb_busses; bus; bus->next)	
	{	
		for (dev = bus->devices; dev; dev=dev->next)	
(Continue reading)

Isabella | 1 Feb 2005 08:04

RE: Doubt on libusb usage

Hi ,

i want to retrieve a device descriptor information from a device's default
control pipe using usb_get_descriptor()aPI.  But  this function always
returning -1;
When i check with firmware code they are telling no interrupt is coming in
device firmware side when i send this usb_get_descriptor function. Can any
one tell me what will be the problem.
I am using the following code.

#include <stdio.h>
 #include <usb.h>

 #define VEDOR_ID 0x4cc
 #define PRODUCT_ID 0xE000

 int main(void)
 {

    int cnt;
   struct usb_bus *bus;
   struct usb_device *dev;

   usb_init();

   usb_find_busses();
   usb_find_devices();

    for (bus = usb_busses; bus; bus = bus->next) {
     for (dev = bus->devices; dev; dev = dev->next) {
(Continue reading)

Philippe Smadja | 1 Feb 2005 10:38

Fwd: USB-OHCI enumeration at boot time

Hello all,
I have the same error with  linux 2.4.2 (RedHat 7.1)
Thanks for your help.

Philippe Smadja.

>Date: Mon, 31 Jan 2005 19:19:32 +0100
>To: libusb-devel <at> lists.sourceforge.net
>From: Philippe Smadja <psmadja <at> axalto.com>
>Subject: Fwd: USB-OHCI enumeration at boot time
>
>Good Morning,
>I am using Linux 2.4.21 on an embedded device.
>the USB Controller is an OHCI.
>
>The devices are properly detected when plugged after the boot, but they 
>are not detected at boot time.
>
>Any idea to have a workaround?
>Thanks you very much.
>
>Philippe Smadja.
>
>_______________________________________________________
>Philippe Smadja                   R&D Project Manager.
>axalto
>36 rue de la Princesse, P.O. Box 45, 78431 Louveciennes Cédex, France
>http://www.axalto.com
>mailto:psmadja <at> axalto.com
>Phone: +33 1 30 08 48 54
(Continue reading)

Isabella | 1 Feb 2005 11:50

Libusb: Operation not permitted

Hi All,

   i can get the device handle succesfully. After that when i call any API,
it is displaying a error message as "Operation not permitted". can anyone
tell me to proceed further.

Thanks,
Isabella.S

-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
Peter Stuge | 1 Feb 2005 12:16

Re: Libusb: Operation not permitted

On Tue, Feb 01, 2005 at 04:20:02PM +0530, Isabella wrote:
>    i can get the device handle succesfully. After that when i call
> any API, it is displaying a error message as "Operation not
> permitted". can anyone tell me to proceed further.

Check that you have the right permissions, on Linux the relevant
files are /proc/bus/usb/*/*

//Peter

-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
Isabella | 1 Feb 2005 13:01

RE: Libusb: Operation not permitted

Thanks a lot Peter.
usb_get_string is working fine.

But when i  use the following API, i am getting the error message as "Broken
Pipe"

 usb_control_msg(udev, 0x80, 6, 0x10, 0, buf,18, 10000) for getting device
descriptor info.

What may be the problem.

-----Original Message-----
From: libusb-devel-admin <at> lists.sourceforge.net
[mailto:libusb-devel-admin <at> lists.sourceforge.net]On Behalf Of Peter
Stuge
Sent: Tuesday, February 01, 2005 4:47 PM
To: libusb
Subject: Re: [Libusb-devel] Libusb: Operation not permitted

On Tue, Feb 01, 2005 at 04:20:02PM +0530, Isabella wrote:
>    i can get the device handle succesfully. After that when i call
> any API, it is displaying a error message as "Operation not
> permitted". can anyone tell me to proceed further.

Check that you have the right permissions, on Linux the relevant
files are /proc/bus/usb/*/*

//Peter

-------------------------------------------------------
(Continue reading)

Craig Dewick | 1 Feb 2005 13:11
Picon
Picon

plans for public-domain (not Sun-restricted) support for Solaris?


Hi everyone,

I'm new to this list following research into support (or the lack of it)
for USB in Solaris. I came across libusb when trying to gphoto2 (more
specifically it's libgphoto2 library) build and running, only to find that
the recommended USB support library (!) does not yet have public-domain
Solaris support.

I've grabbed but not yet installed Sun's USB DDK which apparently has
libusb support. Presumably this is either a version of the libusb codebase
modified to work with Sun's own USB drivers.

Is anyone in this group actively working on Solaris USB support which will
be added to the public codebase? If yes, please let me know what the
status of the development work is.

How all this came about is that I bought a new digital camera which has
USB, and I've got USB cards in my two Sun Ultra 60's and both systems
detect and bind to the cards, but of course that's where the friendship
currently ends as Sun's drivers are all set up for keyboards and mice (at
present, at least in Solaris 9 which is what I'm running), but not for
anything else such as digital cameras, USB non-volatile storage devices,
etc.

Regards,

Craig.

--

-- 
(Continue reading)


Gmane