USRP: libusb-1.0 branch

I pushed an update of the libusb-1.0 support patch to a public github
repository.

Public clone

git clone git://github.com/ttsou/gnuradio-libusb-1.0.git

Viewable at

http://github.com/ttsou/gnuradio-libusb-1.0

Libusb-1.0 is enabled with,

./configure --fusb-tech=libusb1

Why libusb-1.0?
The prior version of libusb provided a portable user-level library that
worked well for USB initialization and configuration, but the
synchronous
calls proved incapable of supporting higher USRP data rates. To get
around
this, gnuradio requires some novel approaches to combine libusb with OS
specific transfer methods. libusb-1.0 introduces an asynchronous I/O
interface, which provides an alternative approach to the current
multi-OS
strategy.

Compatibility
The libusb-1.0 API is incompatible with prior libusb-0.12 interfaces.
There
are quite a few similarities, however, that do exist. Because libusb-1.0
is
fairly new, and current availability is limited to Linux and Darwin,
libusb-0.12 support is necessary for the indefinite future. Eric asked
me to
figure out how to cleanly support libusb-0.12 and libusb-1.0. This is
the
main addition of this update.

Changes
The installed interfaces are virtually unchanged. An extra argument
required
for libusb-1.0 defaults to null and is ignored in non-libusb1 builds, so
existing packages that build against previous low-level code are
unaffected.
This change only affects usrp_prims. Also, some version dependent
headers
are generated out of the configure scripts. The code generation isn’t
ideal
at this moment causing a number of Makefile warnings.

Testing
With this branch on Fedora 11, I get 32Mb/s on all of my machines using
test_usrp_standard_rx or tx. I still need to find some time and put
oprofile
on it to compare against the native Linux USB devio implementation. That
is
unlikely to happen within the next few weeks though.

Information on the original patch can be found in the gnuradio-patch
archives.

http://lists.gnu.org/archive/html/patch-gnuradio/2009-08/msg00003.html

Comments welcome. Thanks.

I had a few minutes, so I tried out this branch on OSX 10.5.8 running
on an Intel MacBook Pro early 2008 using libusb 1.0.3 installed from
MacPorts. The branch does everything correctly: bootstrap, configure,
make, check, installed, and uninstall; I didn’t try distcheck. Using
this branch, I did the following:

% cd /usr/local/share/gnuradio/examples/usrp
% ./usrp_benchmark_usb.py
Testing 2MB/sec… usb_throughput = 2M
ntotal = 1000000
nright = 998622
runlength = 998622
delta = 1378
OK
Testing 4MB/sec… usb_throughput = 4M
ntotal = 2000000
nright = 1998572
runlength = 1998572
delta = 1428
OK
Testing 8MB/sec… uUuOuUuUusb_throughput = 8M
ntotal = 4000000
nright = 3995220
runlength = 3937378
delta = 62622
OK
Testing 16MB/sec… uUuUuUusb_throughput = 16M
ntotal = 8000000
nright = 7997511
runlength = 3819267
delta = 4180733
FAILED
Testing 32MB/sec…
uOuUuOuUuOuUuUuOuOuUuOuUuOuUuOuUuOuUuUuOuOuUuOuUuOuUuOuUuOuOuUuOuUuOuUuOuUuUuUuUuUuUuUuUuUuUuUuUuUuUuUuUuUuUuUuUuUusb_throughput
= 32M
ntotal = 16000000
nright = 15506437
runlength = 19465
delta = 15980535
FAILED
Max USB/USRP throughput = 8MB/sec

I then did “sudo make uninstall”, and moved to the current GNU Radio
trunk, built that and installed it; I then redid the above:

Testing 2MB/sec… uUusb_throughput = 2M
ntotal = 1000000
nright = 998708
runlength = 998708
delta = 1292
OK
Testing 4MB/sec… usb_throughput = 4M
ntotal = 2000000
nright = 1998177
runlength = 1998177
delta = 1823
OK
Testing 8MB/sec… usb_throughput = 8M
ntotal = 4000000
nright = 3999040
runlength = 3999040
delta = 960
OK
Testing 16MB/sec… usb_throughput = 16M
ntotal = 8000000
nright = 7999201
runlength = 7999201
delta = 799
OK
Testing 32MB/sec… usb_throughput = 32M
ntotal = 16000000
nright = 15989449
runlength = 15989449
delta = 10551
OK
Max USB/USRP throughput = 32MB/sec

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs