|
From: | Marcus Müller |
Subject: | Re: [Discuss-gnuradio] How to specify maximum size of input buffers on blocks |
Date: | Fri, 26 Feb 2016 10:52:15 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 |
Hi Gonzalo, these are the mails I like most :) On 25.02.2016 01:11, Gonzalo Arcos
wrote:
So: /->A->Null Sink File Source -| \->B->File Sink Exactly! So the mechanism below is: the output buffer of File Source is the input buffer of A and the input buffer of B. No memory duplication here. File Source has a buffer writer with a write pointer, and A and B have their own read pointers pointing into that buffer. When File Source produces N items, the write pointer advances by N. Similarly, when A consumes M items, A's read pointer advances by M. When calling (general_)work, the input_items buffer(s) is (are) really just a pointer (start_of_buffer + read pointer). Equivalently, the output_items buffer(s) is (are) really just pointing to the write pointer. File Source is only allowed to produce so many items that the write pointer doesn't advance beyond the minimum read pointer, because in that case, it would overwrite samples that a downstream block hasn't consumed. Depends. Typically (64bit Linux), 8192 complex items get allocated, but that really depends on various factors. Yes! For example, as you noticed, in the GRC, open the "advanced" tab in a block property; there's a "Min Output Buffer" and a "Max Output buffer field". There's corresponding methods to set these sizes in the gr::block class[1]. Yes; but that might, depending on the rate in which the file source produces samples, be *a whole lot* of memory! I recommend not doing that, but instead:
You could just write a block that does that for you. Because there's no such thing as a dedicated input buffer :) because every input buffer is in fact the output buffer of the upstream block. No, 0 just instructs GRC to not write a line containing a "set_min_output_buffer" call[2], so GNU Radio uses the default. Best regards, Marcus [1] https://gnuradio.org/doc/doxygen/classgr_1_1block.html#a9d10e3f6747f91b215abe81b60a003d5 [2] https://github.com/gnuradio/gnuradio/blob/master/grc/python/flow_graph.tmpl#L230
|
[Prev in Thread] | Current Thread | [Next in Thread] |