discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Buffer Question for Streaming with USRP


From: Martin Braun
Subject: Re: [Discuss-gnuradio] Buffer Question for Streaming with USRP
Date: Mon, 4 Apr 2011 10:10:21 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

On Sun, Apr 03, 2011 at 07:12:58PM -0700, Tom Hendrick wrote:
> Hi all,
> 
> I'm using a C++ program that modulates a signal that I feed to GRC via an
> mkfifo (named pipe) file.  The problem is that I get underruns from the USRP. 
> 
> There is a function in the C++ program that converts from double to float and
> then dumps it to stdout which I then feed to an mkfifo file in the command
> line.  With the buffer size of 32 bytes in the stdout line in C++  I get
> consistent underruns.  With the buffer size to 4096 bytes, I get an initial
> underrun and then none for about 1-2 minutes and then I start getting them 
> more
> consistently, and about 500msec of no signal for each underrun.  With the
> buffer size set to the size of a 2 second packet (at 500 kHz) I get an 
> underrun
> every 4 seconds with  a 1-2 seconds of no signal randomly in between my
> modulated signal.
> 
> Does anyone have any ideas if I need to use a certain buffer size?  I tried
> this on my netbook with an intel atom and also laptop with a duo core and got
> the same thing. 
> 
> When I run the C++ program and output to a regular file, and read in with the
> GRC script at the same time, I don't get any underruns at all, but of course
> this isn't real time.
> 
> My other idea is to find a way to do the conversion from double to float in 
> GRC
> with a custom block.  I also wonder if going from stdout to a pipe file and
> then reading the pipe file from GRC is also a problem.

Hi Tom,

I wonder... how do you get double-values in the first place? Literally
no GNU Radio block in the main tree uses double. Perhaps it's the Monday
morning, but the only way I can think of to get doubles into your flow graph
without writing lots of code yourself is by reading them from a file,
which you could convert to float beforehand.

Just checking here... are you sure you have double? After your custom converter,
is the data valid?
Your underruns might also be caused by something else. Do you have a
hardware clock on both ends of the flow graph (e.g. a USRP and a sound
card)?

However, writing simple blocks like a double->float converter is
super-easy. I reckon it would take you as long as it took to set up the
custom converter and the pipes. Use create-gnuradio-out-of-tree-project
to get started and then add a sync block.

MB

-- 
Karlsruhe Institute of Technology (KIT)
Communications Engineering Lab (CEL)

Dipl.-Ing. Martin Braun
Research Associate

Kaiserstra├če 12
Building 05.01
76131 Karlsruhe

Phone: +49 721 608-43790
Fax: +49 721 608-46071
www.cel.kit.edu

KIT -- University of the State of Baden-W├╝rttemberg and
National Laboratory of the Helmholtz Association

Attachment: pgpUGQyVKHIxv.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]