[Discuss-gnuradio] Slow down rate of Python source block
From:
David Halls
Subject:
[Discuss-gnuradio] Slow down rate of Python source block
Date:
Thu, 31 Jul 2014 16:21:01 +0000
Dear All,
I have a Python block that produces packets of size 1536 bytes. Due to various reasons, the latter parts of my flow graph are very slow (this is desired and cannot be changed). After producing 510 packets, I get the following error.
"handler caught exception: operands could not be broadcast together with shapes (1527) (1536)
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/gnuradio/gr/gateway.py", line 55, in eval
try: self._callback()
File "/usr/local/lib/python2.7/dist-packages/gnuradio/gr/gateway.py", line 160, in __gr_block_handle
) for i in self.__out_indexes],
File "/usr/local/lib/python2.7/dist-packages/trl/blsd_enc_b.py", line 198, in work
out_cA[0:len(cAm)] = cAm
ValueError: operands could not be broadcast together with shapes (1527) (1536)
thread[thread-per-block[1]: <block blsd_enc_b (2)>]: caught unrecognized exception"
Debugging more carefully, I can see that:
len(cAm) = 1536 , len(out_cA) = 32768
for the first 490 packets, and then the length of 'out_cA' begins to reduce
I believe this is because the latter parts of the flow graph are blocking, their buffers become full, and this backs up to my source block. This is confirmed by connecting my source block to null sinks, which then allows the source block to run infinitely (well, a long while!).
Is there a way I can slow up this block? I tried using a throttle on the output, but this doesn't help (in fact it seems to make it worse!).
The full code of the block is attached.
Thanks!
David
________________________________
NOTE: The information in this email and any attachments may be confidential and/or legally privileged. This message may be read, copied and used only by the intended recipient. If you are not the intended recipient, please destroy this message, delete any copies held on your system and notify the sender immediately.
Toshiba Research Europe Limited, registered in England and Wales (2519556). Registered Office 208 Cambridge Science Park, Milton Road, Cambridge CB4 0GZ, England. Web: www.toshiba.eu/research/trl
This email has been scanned for email related threats and delivered safely by Mimecast. For more information please visit http://www.mimecast.com