Forum: GNU Radio Changing Nout_items and Buffer Settings for GNURadio 3.6.2

Posted by Tom Hendrick (Guest)
on 2013-02-06 19:46
(Received via mailing list)
Hello,

I think its possible some of the underrun issues I mentioned in my other 
posts (where random gaps occur inside a block of data sent to the USRP 
when set the USRP sampling frequency any lower than 1 MHz,) may be 
solved by tweaking nout_items and buffer related settings.

For GNURadio 3.6.2, Is there a simple way to modify the python code 
generated by GRC in order to change those settings? I had seen 
instructions for doing this with 3.6.3 but I think they don't apply to 
the 3.6.2 version. I can consider upgrading to 3.6.3 if there isn't an 
easy solution.

Thank you, Tom
Posted by Tom Rondeau (Guest)
on 2013-02-06 20:37
(Received via mailing list)
On Wed, Feb 6, 2013 at 1:34 PM, Tom Hendrick <sdtom182@yahoo.com> wrote:

> 3.6.2 version.  I can consider upgrading to 3.6.3 if there isn't an easy
> solution.
>
> Thank you, Tom
>

You can tweak the max noutput_items in 3.6.2. You can pass a value to 
the
top block object when you run start/run that will set the maximum value
noutput_items can be.

In 3.6.3, you now have the ability to change the maximum noutput_items 
on a
per block basis with block.set_max_noutput_items (this might be doable 
in
3.6.2; I forget when we added it). You can also change the buffer sizes 
of
a block before you start the flowgraph with set_max/min_output_buffer.

There should be very little concern going between 3.6.2 and 3.6.3. We
maintain API compatibility between those versions.

But, having said all of this, I'm not sure this is really going to help
you. Are you thinking of decreasing the buffer sizes or the max
noutput_items? That's actually going to hurt you computationally. It 
will
lower latency, but it means less time inside a work function and more
overhead in the scheduler, moving things around, and context switching.
Larger buffers mean more time in work for each block, which is when you 
get
the most power.

Tom
Posted by Tom Hendrick (Guest)
on 2013-02-06 20:55
(Received via mailing list)
Hi Tom,
I appreciate your response and information on setting noutput_items for 
version 3.6.2. I am not sure if changing the noutput_items or buffer 
size is going to help at all.

Basically when the data rate is lower than the transmission rate 
(purposely to eliminate latency), I'm noticing that the USRP is 
outputing random gaps in my packet of data during some of the underruns. 
Some of the underruns generate a wider gap between packets (this is 
good) but some of them generate a gap inside the packet data blocks 
causing problems. This happens when I am using a 125kHz sampling 
frequency and the USRP's rate set lower than 1M S/s. However with the 
USRP at 1M S/s it works fine. My goal is to run the USRP at 250k S/s to 
reduce processor load.

For the 125k S/s case and lower than 1 M S/s USRP rate, if I increase my 
packet size by a factor of two, the gaps caused by underruns happen only 
between packets not inside them. The problem is the increase in packet 
size is not desirable for my application.

The behavior I observed makes me think the issue could be fixed with 
changing the Nout_items or buffer settings. Any idea if that might be 
true?
Thank you, Tom






________________________________
 From: Tom Rondeau <tom@trondeau.com>
To: Tom Hendrick <sdtom182@yahoo.com>
Cc: "discuss-gnuradio@gnu.org" <discuss-gnuradio@gnu.org>
Sent: Wednesday, February 6, 2013 2:36 PM
Subject: Re: [Discuss-gnuradio] Changing Nout_items and Buffer Settings 
for GNURadio 3.6.2


On Wed, Feb 6, 2013 at 1:34 PM, Tom Hendrick <sdtom182@yahoo.com> wrote:

Hello,
>
>
>I think its possible some of the underrun issues I mentioned in my other posts 
(where random gaps occur inside a block of data sent to the USRP when set the USRP 
sampling frequency any lower than 1 MHz,) may be solved by tweaking nout_items and 
buffer related settings.
>
>
>For GNURadio 3.6.2, Is there a simple way to modify the python code generated by 
GRC in order to change those settings? I had seen instructions for doing this with 
3.6.3 but I think they don't apply to the 3.6.2 version. I can consider upgrading 
to 3.6.3 if there isn't an easy solution.
>
>
>Thank you, Tom

You can tweak the max noutput_items in 3.6.2. You can pass a value to 
the top block object when you run start/run that will set the maximum 
value noutput_items can be.

In 3.6.3, you now have the ability to change the maximum noutput_items 
on a per block basis with block.set_max_noutput_items (this might be 
doable in 3.6.2; I forget when we added it). You can also change the 
buffer sizes of a block before you start the flowgraph with 
set_max/min_output_buffer.

There should be very little concern going between 3.6.2 and 3.6.3. We 
maintain API compatibility between those versions.

But, having said all of this, I'm not sure this is really going to help 
you. Are you thinking of decreasing the buffer sizes or the max 
noutput_items? That's actually going to hurt you computationally. It 
will lower latency, but it means less time inside a work function and 
more overhead in the scheduler, moving things around, and context 
switching. Larger buffers mean more time in work for each block, which 
is when you get the most power.

Tom
Posted by Tom Hendrick (Guest)
on 2013-02-06 20:59
(Received via mailing list)
To clarify, I am interested in making my file sampling rate at 125 k S/s 
and running the USRP at 250 kS/s. I am using a resampler block in 
between the file source and usrp sink. The file source reads data from a 
fifo file and external modulator code writes to that file.

Thanks, Tom




________________________________
 From: Tom Hendrick <sdtom182@yahoo.com>
To: Tom Rondeau <tom@trondeau.com>
Cc: "discuss-gnuradio@gnu.org" <discuss-gnuradio@gnu.org>
Sent: Wednesday, February 6, 2013 2:54 PM
Subject: Re: [Discuss-gnuradio] Changing Nout_items and Buffer Settings 
for GNURadio 3.6.2


Hi Tom,
I appreciate your response and information on setting noutput_items for 
version 3.6.2. I am not sure if changing the noutput_items or buffer 
size is going to help at all.

Basically when the data rate is lower than the transmission rate 
(purposely to eliminate latency), I'm noticing that the USRP is 
outputing random gaps in my packet of data during some of the underruns. 
Some of the underruns generate a wider gap between packets (this is 
good) but some of them generate a gap inside the packet data blocks 
causing problems. This happens when I am using a 125kHz sampling 
frequency and the USRP's rate set lower than 1M S/s. However with the 
USRP at 1M S/s it works fine. My goal is to run the USRP at 250k S/s to 
reduce processor load.

For the 125k S/s case and lower
 than 1 M S/s USRP rate, if I increase my packet size by a factor of 
two, the gaps caused by underruns happen only between packets not inside 
them. The problem is the increase in packet size is not desirable for my 
application.

The behavior I observed makes me think the issue could be fixed with 
changing the Nout_items or buffer settings. Any idea if that might be 
true?
Thank you, Tom






________________________________
 From: Tom Rondeau <tom@trondeau.com>
To: Tom Hendrick <sdtom182@yahoo.com>
Cc: "discuss-gnuradio@gnu.org" <discuss-gnuradio@gnu.org>
Sent: Wednesday, February 6, 2013 2:36 PM
Subject: Re: [Discuss-gnuradio] Changing Nout_items and Buffer Settings 
for GNURadio 3.6.2


On Wed, Feb 6, 2013 at 1:34 PM, Tom Hendrick <sdtom182@yahoo.com> wrote:

Hello,
>
>
>I think its possible some of the underrun issues I mentioned in my other posts 
(where random gaps occur inside a block of data sent to the USRP when set the USRP 
sampling frequency any lower than 1 MHz,) may be solved by tweaking nout_items and 
buffer related settings.
>
>
>For GNURadio 3.6.2, Is there a simple way to modify the python code generated by 
GRC in order to change those settings? I had seen instructions for doing this with 
3.6.3 but I think they don't apply to the 3.6.2 version. I can consider upgrading 
to 3.6.3 if there isn't an easy solution.
>
>
>Thank you, Tom

You can tweak the max noutput_items in 3.6.2. You can pass a value to 
the top block object when you run start/run that will set the maximum 
value noutput_items can be.

In 3.6.3, you now have the ability to change the maximum noutput_items 
on a per block basis with block.set_max_noutput_items (this might be 
doable in 3.6.2; I forget when we added it). You can also change the 
buffer sizes of a block before you start the flowgraph with 
set_max/min_output_buffer.

There should be very little concern going between 3.6.2 and 3.6.3. We 
maintain API compatibility between those versions.

But, having said all of this, I'm not sure this is really going to help 
you. Are you thinking of decreasing the buffer sizes or the max 
noutput_items? That's actually going to hurt you computationally. It 
will lower latency, but it means less time inside a work function and 
more overhead in the scheduler, moving things around, and context 
switching. Larger buffers mean more time in work for each block, which 
is when you get the most power.

Tom
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.