discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] How to know that the last sample has arrived


From: Julian Arnold
Subject: Re: [Discuss-gnuradio] How to know that the last sample has arrived
Date: Fri, 31 Mar 2017 13:56:25 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

Hey,

> I honestly think that way is at least more reliable than the one you
> sketched above, but probably still not all that reliable.
I would totally agree with Marcus. Especially you first approach can't
work reliably.
What about using tagged streams or just a tag on the last sample? Is
that an option?

Cheers,
Julian

On 03/31/2017 01:47 PM, Marcus Müller wrote:
>
> Hi Ruben,
>
>> If I consume (ninput_items[0] - 1) samples every time general_work is
>> called, I will eventually get general_work called with ninput_items[0]
>> == 1. Would this be a reliable way to do it? Or is there a more
>> straightforward way which I cannot see?
> Oh, I *think* that might work, but really you shouldn't rely on the
> scheduler never calling you with a single sample – we nowhere say it
> wouldn't do that during normal operation.
>
>> The goal is to have a block which reliably appends something specific
>> after the last incoming sample. When I detect that the last sample has
>> arrived, the following call to forecast will return 0, causing
>> general_work to be called again even when ninput_items[0] == 0, and I
>> then return -1 when all the appended samples have been produced. That
>> seems to work fine, but I am unsure if there is a more straight
>> forward way.
> I honestly think that way is at least more reliable than the one you
> sketched above, but probably still not all that reliable.
>
> I think we'll need input from the others on this, but I think we do
> /not/ have a "guaranteed" way of making this work without adding hooks
> to the scheduler that we do not have yet.
>
> I'd rather find a way to access the block executor of the next block
> upstream and ask it whether it is done.
>
> Best regards,
> Marcus
>
> On 31.03.2017 12:06, Ruben Undheim wrote:
>> Hi,
>>
>> Is there a good way to find out from inside general_work that the last
>> sample has arrived? (such as from vector_source_X or file_source)
>>
>> If I consume (ninput_items[0] - 1) samples every time general_work is
>> called, I will eventually get general_work called with ninput_items[0]
>> == 1. Would this be a reliable way to do it? Or is there a more
>> straightforward way which I cannot see?
>>
>> The goal is to have a block which reliably appends something specific
>> after the last incoming sample. When I detect that the last sample has
>> arrived, the following call to forecast will return 0, causing
>> general_work to be called again even when ninput_items[0] == 0, and I
>> then return -1 when all the appended samples have been produced. That
>> seems to work fine, but I am unsure if there is a more straight
>> forward way.
>>
>> Best regards
>>
>> Ruben
>>
>> _______________________________________________
>> Discuss-gnuradio mailing list
>> address@hidden
>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
>
>
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

-- 
Julian Arnold, M.Sc.

Institute for Networked Systems
RWTH Aachen University

Kackertstrasse 9
52072 Aachen
Germany




reply via email to

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