discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] What if noutput_itmes is too short?


From: Jeon
Subject: Re: [Discuss-gnuradio] What if noutput_itmes is too short?
Date: Fri, 29 May 2015 12:49:22 +0000

After posting the previous thread, I've searched APIs from GNU Radio doxygen.

Several candidates have been found.

1. [`produce()`](http://gnuradio.org/doc/doxygen/classgr_1_1block.html#aa5581727d057bdd8113f8b2a3fc5bd66)
2. [`set_min_noutput_items()`](http://gnuradio.org/doc/doxygen/classgr_1_1block.html#a65cfc579150dc4d10c6180d3365aa9a8)
3. [`set_min_output_buffer()`](http://gnuradio.org/doc/doxygen/classgr_1_1block.html#a9d10e3f6747f91b215abe81b60a003d5)
4. [`expand_minmax_buffer()`](http://gnuradio.org/doc/doxygen/classgr_1_1block.html#a9bbf96f6a81d5c289934a68ef44dd1b4)

I think I can combine `produce()` and `set_min_noutput_items()` to **enlarge** the `noutput_items`

If I get wrong, please let me know.

Regards,
Jeon.

2015년 5월 29일 (금) 오후 8:47, Jeon <address@hidden>님이 작성:
I am trying to remove `preamble` and `start frame delimiter` from a frame and only the payload will be passed to the next block.

While in debugging, `ninput_items` is 7742, and `noutput_items` is 4096, for instance. An offset where the frame starts is 790.

Simple calculation gives me that 7742 - 790 = 6952 samples should be passed to the next block. But output space given is only 4096. Thus, I can only pass 4096 samples and 6952 - 4096 = 2856 samples will be discarded. But, I need them to be passed, too.

Even worse, a stream of samples are coming continuously from a previous block.

Will it be helpful if I have some very long buffer in a block? I don't think it works since `noutput_items` is always smaller than `ninput_items` every time the block runs `general_work()`. In this case, I think the buffer will be overflowed.

The link below is the log that shows

`i`/`ninput_itmes` and `o`/`noutput_items`,

where `i` and `o` are input and output indices. When `ninput_itmes` and `noutput_items` change, it means a new `general_work` is called.

Log (it's quite long...): https://bitbucket.org/snippets/gsongsong/By8x

Regards,
Jeon.

reply via email to

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