Skip to content
mcuee edited this page Mar 1, 2013 · 29 revisions

A cross-platform user-mode library, for generic access to USB devices

Table of Contents

Description

About

libusbx is a cross-platform user-mode library that provides access to USB devices.

It is intended to serve as both a replacement and improvement over libusb, as the latter has barely managed to produce one release in 2 years and does not actively seek the inclusion of user-requested features, such as topology, HID or hotplug support.

Whether you already have an existing libusb application or plan to develop a new one, we encourage you to consider using libusbx as the better alternative, especially as it provides a drop-in replacement for existing libusb based code.

Features

  • Supports all the major platforms: Linux, OS X, OpenBSD/NetBSD and Windows
  • Supports all versions of USB, from 1.0 to 3.0
  • Unified modern API, that provides both synchronous and asynchronous access
  • User-mode: no need for kernel access

Downloads

All libusbx releases can be accessed from the releases directory.

Documentation

  • The libusbx-1.0 API Reference can be accessed HERE
  • A FAQ is also available.

Support

The prefer way to get support is to use the mailing list. libusbx Mailing list is hosted by Sourceforge. You can subscribe and check the archive HERE.

Nabble and Gmane have more-readable mailing list archive.

Please also read the Wiki as well.

Development

Supported Environments

  • Linux [status: Stable]
    • Any modern Linux system with usbfs.
    • Note: for USB 3.0 port, the Linux xHCI driver is less mature than the other host drivers. So there may be issues with USB 3.0 port. Please report to the mailing list for issues related to USB 3.0.
  • Mac OS X [status: Stable]
    • Any modern version of Mac OS X (PowerPC or x86 either in 32 and 64 bits)
    • Note: for USB 3.0 port,please use Mac OS X Mountain Lion 10.8.2 or later.
    • Note: the device should not be bound to a kernel driver. You can use a codeless kext to achieve that if there is a kernel driver (eg: HID or USB Mass Storage) which already binds to the device.
  • Windows [status: EXPERIMENTAL → Stable]
    • MinGW (32 bit) or MinGW-w64. To compile a library that is both 32 and 64 bit compatible, you should use a version of MinGW-w64 that supports both -m32 and -m64 (a.k.a. "multilib"). A pre-built multilib version can be downloaded with TDM64.
    • Microsoft Visual C++ (Visual Studio).
    • Windows DDK build environment
    • Device driver support: WinUSB, HID and experimental support for libusbk.sys/libusb0.sys
  • OpenBSD and NetBSD [status: EXPERIMENTAL]
    • Only device with ugen driver are supported
More information on the Windows implementation can be obtained from the Windows Backend page.

Note: FreeBSD 8 and above include a FreeBSD-specific reimplementation of the libusbx/libusb API, so your applications will probably work there too. The source code for this library can be found here.

If you are interested in porting to other platforms, the PORTING file tells you where to start. We are more than happy to help out here, please write to the mailing list with your questions and feedback.

Accessing the Source

The latest development tree is always available from git.

For those not familiar with git, here are the commands one can use to retrieve libusbx:

# retrieve development branch (this only needs to be done once)
git clone git://github.com/libusbx/libusbx.git
cd libusbx
# for further updates, once the clone has been done
git pull                                                           

You can also browse the git development tree from https://github.com/libusbx/libusbx.

Also note that, when compiling from git, you may have to run ./autogen.sh, ./bootstrap.sh or run the autotools creation utilities, in order to have configure and Makefile created for you. The difference between autogen.sh and bootstrap.sh is that the former will invoke configure with a set of default options, whereas the latter will not.

To create projects relying on libusbx, please refer to the samples in the examples/ subdirectory.

Open Source projects using libusbx/libusb

Language Bindings

Other Resources