1

I have a flow graph with a file source (with repeat off) and a GUI Time Sink. The graph is throttled by a throttle block at 2 samples / sec. I expect to see two new samples in my GUI Time Sink every second. However, instead of 1-second updates, the GUI Time Sink doesn't display anything at all. If I turn repeat on on the file source, the GUI Time Sink does update. Why doesn't it update when repeat is off?

My question is similar to this one. In my case, I also have a file source throttled down to a very slow sample rate. However, my sink is a GUI Time Sink, not a file sink--I see no option for an "Unbuffered" parameter on the Time Sink.

My flow graph Flow graph

Repeat off

Repeat off

Repeat On

enter image description here

Community
  • 1
  • 1
watkipet
  • 959
  • 12
  • 23

1 Answers1

3

This is actually multiple problems in one:

  1. You're assuming the time sink will show two new values when they come in. That's not true: it will only update the display when it has (at least) as many new items as you configured it to show in number of points.
  2. You're assuming GNU Radio will happily read single items (or two) at a time. Typically, that is not the case: it will ask the file source for as many items as there is space in the output buffer, something like 8192 (not fixed). And typically,
  3. Throttle doesn't work like you think. It takes the number of input samples it gets in each call to its work function (e.g. 8192) and divides that number by the throttle rate you set and then just blocks for that amount of seconds. Throttle regulates the average rate, on a longer time scale, or in your really minimal rate case, a very long time scale.

You can limit the number of items in an output buffer, but not below a page size (4kB); for complexes that is 1024 items at least.

I think the classical graphical GNU Radio sinks might just not be the right thing to analyze files sample-by-sample.

I recommend trying the example flow graphs that come with Tim O'Shea's gr-pyqt. They are very handy for this kind of analysis.

Marcus Müller
  • 34,677
  • 4
  • 53
  • 94
  • Regarding #1, I configured the sink for 2 points, so that shouldn't be the problem. For #3, I removed the throttle block--the GUI sink is still blank. So, regarding #2, am I right to conclude that GNU Radio will take no action until it has filled it's output buffer? – watkipet Dec 22 '15 at 18:16
  • hm, usually, as soon as a source says "ok, here's some samples you can work with", the downstream block can start working. How long is your file? – Marcus Müller Dec 23 '15 at 08:04
  • (but: GNU Radio will *ask* the source to produce as much as there's space in the buffer. What the source does with that request is up to itself, and it can produce much less.) – Marcus Müller Dec 23 '15 at 08:07
  • are you sure you've configured num of points = 2? Looks like 4 to me in the screenshots – Marcus Müller Dec 23 '15 at 08:07
  • Yeah, number of points is 2. The sink in the flow graph shows it: "Number of Points: 2". The file is very short--only 3 bytes. – watkipet Dec 23 '15 at 15:52