discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Precise interrupts in GNURADIO?


From: Martin Braun
Subject: Re: [Discuss-gnuradio] Precise interrupts in GNURADIO?
Date: Tue, 10 Feb 2015 16:06:05 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

Precise timings like this are difficult to do with GNU Radio, which is
optimized for maximum throughput.

However, I think you can do things easier than you're doing.
First of all, you can stop the flowgraph from within blocks by returning
WORK_DONE from your work function. You can also return WORK_DONE after a
timeout, but that may have some unintended effects, or maybe your work
function isn't being called after the timeout.

However, you don't necessarily need the probe.


On 02/09/2015 11:11 PM, Chen Chen wrote:
> For the second part, I am using the Timer in the package threading.
>      -------------------------------------------------------------
> #def _shut_down_flow_graph():
>             #print "Passing %d seconds, going to kill the process!"
> %self.timing
>             #self.stop()
> 
>         #_timer_thread=Timer(self.timing,_shut_down_flow_graph)
>         #_timer_thread.start()
>      -------------------------------------------------------------
> 
> But, what I observe is that:
> 1. If I set the threshold to 10 packages, I have to wait until about 100
> packages being decoded correctly. Sometimes I have to wait for about 500
> packages. The threading is not very stable, even there is an high-level
> output at the probe, it does not 'see' it immediately.

You have little control over how data is processed, and it might happen
that GNU Radio pushes very large chunks of data through the blocks in
order to maximize throughput (thereby increasing latency).

> 2. The alarm would prevent my flowgraph from exiting. Namely, when there
> are more than 50 packages, the flowgraph would not be stopped, until 30
> seconds passed. But I have a self.stop() in the snippet. 
> 
>                 if (val == 1):
>                     print "package number reach threshold %d!"
> %self.threshold
>                     self.stop()
>                     break
> 
> Why it does not terminate the python program immediately?

I don't fully understand what you're trying to do here.

M




reply via email to

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