Subject: Re: proposed change to ugen to enable USRP to work
To: Greg Troxel <gdt@ir.bbn.com>
From: Hans Petter Selasky <hselasky@c2i.net>
List: tech-kern
Date: 05/03/2006 21:35:44
On Wednesday 03 May 2006 19:58, Greg Troxel wrote:
> At BBN we are working on a project involving teams of
> cognitively-controlled software radios, funded by the US government.
> As part of this, we will be using GNU Radio on NetBSD (which Berndt
> has placed in pkgsrc).  The Universal Software Radio Peripheral (USRP)
> is "software radio hardware", and attaches via USB.  Due to the
> current implementation of ugen(4), reads from the USRP are not
> pipelined and transfer rates top out at around 4 MB/s, compared to 32
> MB/s on Linux.

Pipelining transfers is not a problem in the current USB stack. You only need 
to allocate more USB transfers, and then start them as soon as the first one 
has finished. At least with my USB driver implementation this is how it 
works:

See: http://www.turbocat.net/~hselasky/isdn4bsd/index.html

I think the problem you experience entirely lies within the file "usb/ugen.c".

See: "http://www.turbocat.net/~hselasky/isdn4bsd/sources/src/sys/dev/usb2/"

In my version of "ugen.c", you can set the following define:

#define UGEN_BULK_BUFFER_SIZE (1024*64) /* bytes */

If you use isochronous transfers, achieving the maximum transfer rate should 
not be a problem. Changing "ugen.c" to pipeline BULK [read] transfers should 
not be problem, though it would be better if the application could use larger 
reads.

What kind of transfer types are you using? Isochronous or Bulk?

What is the average read-size ?

PS: My USB driver works best on FreeBSD, hence NetBSD does not support 
"mtx_lock/mtx_unlock ....".

--HPS