discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Question about output/input buffers


From: Jan Krämer
Subject: Re: [Discuss-gnuradio] Question about output/input buffers
Date: Tue, 15 Mar 2016 08:59:41 +0100

Hi,

what you are trying to do will not work in GNURadio without heavy modification of the scheduler. The in/out buffers of the blocks are allocated by the scheduler as double-mapped FIFO buffers. Whenever your (general_)work() has produced some samples, it will inform the scheduler about the exact amount of samples, let's say N, via the produced() call. The scheduler will then advance the write pointer for that output buffer by N-(history-1) entries. GNURadios scheduler is essentially a stream based scheduler. While tagged streams provided a good approach to packet based communication schemes, I think even then you could not guaranty that for a packet at address 0 with the length N, the next packet will be placed in the output buffer at address 0+N and so on.

One other way you could archieve your task (if I understood it correctly), to strip away the preamble before the FFT when you detect a packet and then preload the fft->input() with that preamble. Inside the FFT block you would have to detect the beginning of the packet again and then copy that packet to the fft input buffer beginning at fft->input()[length_of_preamble].
All this would require you to write custom blocks and in the end I am not sure if copying the preamble would be really the tightest bottleneck you could find in your flowgraph.

hope that clarified some things.
Cheers,
Jan

2016-03-15 1:08 GMT+01:00 Gonzalo Arcos <address@hidden>:
Anyone? Is there a way to keep the buffer array for subsequent executions of work() ?

Also, ive searched everywhere for the meaning of the return value of the work function. The documentation explains the function and its parameters, but not what the return value is for.

2016-03-13 16:11 GMT-03:00 Gonzalo Arcos <address@hidden>:
So basically i tried assigning the sync words only in the first call to work() and the result was that only the first packet was transmitted successfully, so either gnuradio scheduler is erasing all the output buffer before the call to the work function, or the output buffer is a new allocation and has nothing to do with the output buffer of the previous call to work.

In any case, is there a way i can make that gnuradio just allocs that buffer once and does not change the values of it, so i can be sure that in successive calls to work the buffer retains the values written by previous calls to work, if none of the consumer blocks changes their input buffer?

Thanks in advantage.

2016-03-13 14:44 GMT-03:00 Gonzalo Arcos <address@hidden>:
Do output buffers of a block are always allocated in the same address throughout the same execution of the flowgraph? I need to know this because it would allow me to do some optimization.


For example:

Suppose i have the OFDM Carrier Allocator Block connected to the IFFT block.

On every execution of work() the carrier allocator copies the synch words to the beggining of the output buffer. However, i know that my synch words will always remain the same throughout the entire execution of the flowgraph. Additionally, the fft should not change anything in its input buffer, which is ofdm carrier allocator's output buffer. 

So basically, i only need to copy that information once, on the first run, since then that data will remain in the buffer.

This happens ONLY if the ofdm carrier allocator output buffer is not freed/alloc'ed by the gnuradio scheduler more than once per execution of the flowgraph.

Can somebody confirm this?

Thanks



_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio



reply via email to

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