discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Calling general_work when one of the inputs are a


From: Ramazan Cetin
Subject: Re: [Discuss-gnuradio] Calling general_work when one of the inputs are available
Date: Wed, 17 Jul 2019 17:48:03 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

Hey folk,

I can implement my purpose, when my block is called so frequenctly. It is called in every 5 ms in average. Log:

time_span: 0.075296 ms, noutput_items: 4096
time_span: 0.017153 ms, noutput_items: 4096
time_span: 0.008007 ms, noutput_items: 4096
time_span: 0.008484 ms, noutput_items: 4096
time_span: 0.009831 ms, noutput_items: 4096
time_span: 0.009719 ms, noutput_items: 4096
time_span: 0.010456 ms, noutput_items: 4096
time_span: 0.009762 ms, noutput_items: 4096
time_span: 0.009515 ms, noutput_items: 4096
time_span: 0.009494 ms, noutput_items: 4096
time_span: 0.008571 ms, noutput_items: 4096
time_span: 0.009026 ms, noutput_items: 4096
time_span: 0.008326 ms, noutput_items: 4096
time_span: 0.008157 ms, noutput_items: 4096
time_span: 0.009956 ms, noutput_items: 4096
time_span: 0.010269 ms, noutput_items: 4096
time_span: 0.010086 ms, noutput_items: 4096
time_span: 0.010077 ms, noutput_items: 4096
time_span: 0.008122 ms, noutput_items: 4096
time_span: 0.005877 ms, noutput_items: 4096
time_span: 0.008254 ms, noutput_items: 4096
time_span: 0.012721 ms, noutput_items: 4096
time_span: 0.014022 ms, noutput_items: 4096
time_span: 0.010354 ms, noutput_items: 4096
time_span: 0.006212 ms, noutput_items: 4096
time_span: 0.005713 ms, noutput_items: 4096
time_span: 0.005867 ms, noutput_items: 4096
time_span: 0.005723 ms, noutput_items: 4096
time_span: 0.005703 ms, noutput_items: 4096
time_span: 0.005745 ms, noutput_items: 4096
time_span: 0.005775 ms, noutput_items: 4096
time_span: 0.005707 ms, noutput_items: 4096
time_span: 0.005693 ms, noutput_items: 4096
time_span: 0.005745 ms, noutput_items: 4096
time_span: 0.005721 ms, noutput_items: 4096
time_span: 0.00568 ms, noutput_items: 4096
time_span: 0.005853 ms, noutput_items: 4096
time_span: 0.005772 ms, noutput_items: 4096
time_span: 0.005772 ms, noutput_items: 4096
time_span: 0.005728 ms, noutput_items: 4096
time_span: 0.005735 ms, noutput_items: 4096
time_span: 0.005723 ms, noutput_items: 4096
time_span: 0.005731 ms, noutput_items: 4096
time_span: 0.00569 ms, noutput_items: 4096
time_span: 0.005884 ms, noutput_items: 4096
time_span: 0.005805 ms, noutput_items: 4096
time_span: 0.00595 ms, noutput_items: 4096

However, this causes crashing RX of my USRP (its RX LED turns off) after some time. Work() function should be called whenever an input is available on of my block's input ports.

Also, forecast() does not solve my problem. Because i cannot say to forecast() "hey, please run whenever there is an input on input0 or input1".

How can i achieve this situation? Please, help. Thanks for your time.

Best regards.

On 16.07.2019 19:17, Ramazan Çetin wrote:
Hello gnuradio users,

I want to implement a general block which have two inputs and one output. The general_work of this block should be called when one of the inputs is available. My task is just tagging and copying inputs to the output.

But my block is called any time, even if there is no input. I just want to call it when there is data one of the inputs.

I have tried to implement forecast() function;

    void
    rtag_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required)
    {
        ninput_items_required[0] = noutput_items;
        ninput_items_required[1] = noutput_items;
    }

But here, my block waits both of the inputs. Is there any way to implement or condition in forecast()? (That means, call general_work when there is data on input 0 or input 1)

Best regards.

Ramazan


reply via email to

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