Forum: GNU Radio Increase min output buffer size (python block)

4be425825a8a41f3dd6f044fdf53a624?d=identicon&s=25 unknown (Guest)
on 2013-04-08 21:52
(Received via mailing list)
Hi all,

I am currently working on my DRM receiver and have written a python
block
that returns either 0 or 3200 samples. Everything works fine as long as
I
do not connect its output to another custom python block that consumes
only 1280 samples
per call to general_work(). Both blocks are general blocks. Now I get
this
error message:

File "/usr/local/lib/python2.7/dist-packages/drmrx/freq_sync_py.py",
line
120, in general_work
    out[:self.nfft] = self.correct_freq_offset(in0[:self.nfft])
ValueError: operands could not be broadcast together with shapes (1791)
(3200)
thread[thread-per-block[10]: <gr_block freq_sync_py (23)>]: caught
unrecognized exception

If I understand that correctly, the output buffer of the first block is
too small and therefore cannot take all the samples I'd like to return.
I
tried to call top_block.drmrx_freq_sync_py_0.set_min_output_buffer(3200)
in the python file generated by GRC but it gave me another error:

tb.drmrx_freq_sync_py_0.set_min_output_buffer(3200)
AttributeError: 'freq_sync_py' object has no attribute
'set_min_output_buffer'

Is there a possibility to solve this problem or do I have to find an
alternative solution, e. g. creating an internal buffer?

Best regards
Felix Wunsch
D7c45fe2b9d1bc4156cebeb19a3a2b63?d=identicon&s=25 Josh Blum (Guest)
on 2013-04-08 21:55
(Received via mailing list)
> tb.drmrx_freq_sync_py_0.set_min_output_buffer(3200)
> AttributeError: 'freq_sync_py' object has no attribute
> 'set_min_output_buffer'
>
> Is there a possibility to solve this problem or do I have to find an
> alternative solution, e. g. creating an internal buffer?
>

There is an API call set_output_multiple, this sets the minimum reserve
size for buffers. So your worker should only get called with buffers of
at least this size.

-josh
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.