discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] GrBlock


From: Josh Blum
Subject: Re: [Discuss-gnuradio] GrBlock
Date: Mon, 17 Oct 2011 13:11:02 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1


On 10/17/2011 01:01 PM, Tom Rondeau wrote:
> On Mon, Oct 17, 2011 at 12:54 PM, Josh Blum <address@hidden> wrote:
> 
>>
>>
>> On 10/17/2011 12:34 PM, Jason Bonior wrote:
>>> Today we installed the git versions of grblock, grc, gnuradio, and uhd on
>> a
>>> system with Debian 6.0.3, 64-bit (also installed this morning). When
>> trying
>>> to run the demo files we receive the following errors:
>>>
>>> address@hidden:~$ /usr/local/share/grblock/
>>> examples/adder_demo.py
>>> handler caught exception: Unknown exception
>>> Traceback (most recent call last):
>>>  File "/usr/local/lib/python2.6/dist-packages/grblock/gateway.py", line
>> 52,
>>> in handle
>>>    try: self._callback()
>>>  File "/usr/local/lib/python2.6/dist-packages/grblock/gateway.py", line
>> 120,
>>> in __grblock_handle
>>>    [self.__message.work_args.ninput_items]*len(self.__in_sig),
>>>  File "/usr/local/lib/python2.6/dist-packages/grblock/gateway.py", line
>> 41,
>>> in pointers_to_ndarrays
>>>    return [pointer_to_ndarray(*args) for args in zip(addrs, dtypes,
>> nitems)]
>>>  File
>>>
>> "/usr/local/lib/python2.6/dist-packages/gnuradio/gr/gnuradio_core_hier.py",
>>> line 118, in next
>>>    return _gnuradio_core_hier.SwigPyIterator_next(self)
>>> RuntimeError: Unknown exception
>>> thread[thread-per-block[2]: <gr_block add 2 f32 (4)>]: caught
>> unrecognized
>>> exception
>>> ^Cexcepted (1, 5, 9, 13, 17)
>>> actual ()
>>> handler caught exception: Unknown exception
>>> Traceback (most recent call last):
>>>  File "/usr/local/lib/python2.6/dist-packages/grblock/gateway.py", line
>> 52,
>>> in handle
>>>    try: self._callback()
>>>  File "/usr/local/lib/python2.6/dist-packages/grblock/gateway.py", line
>> 120,
>>> in __grblock_handle
>>>    [self.__message.work_args.ninput_items]*len(self.__in_sig),
>>>  File "/usr/local/lib/python2.6/dist-packages/grblock/gateway.py", line
>> 41,
>>> in pointers_to_ndarrays
>>>    return [pointer_to_ndarray(*args) for args in zip(addrs, dtypes,
>> nitems)]
>>>  File
>>>
>> "/usr/local/lib/python2.6/dist-packages/gnuradio/gr/gnuradio_core_hier.py",
>>> line 118, in next
>>>    return _gnuradio_core_hier.SwigPyIterator_next(self)
>>> RuntimeError: Unknown exception
>>> thread[thread-per-block[2]: <gr_block add 2 fc32 (10)>]: caught
>> unrecognized
>>> exception
>>> ^Cexcepted (1, 5j, 9, 13j, 17)
>>> actual ()
>>> address@hidden:~$
>>>
>>
>> The traceback is a bit unclear. I think the problem is happening in
>> pointer_to_ndarray. Can you put some prints in gateway.py and find out
>> what line is dying?
>>
>> pointer_to_ndarray is the darkest magic used in grblock. Perhaps
>> something differers between numpy versions. I have only tested on ubuntu
>> 11.04 and 11.10
>> https://github.com/guruofquality/grblock/blob/master/python/gateway.py#L24
>>
>> grblock certainly needs to be tested across wider audience. I am glad
>> you are giving it a try. I am ccing gr discuss. More eyes and testers
>> cant hurt.
>>
>> So if someone is bored or has 5 mins, can you compile this on your
>> system and let me know if the examples work for you?
>> https://github.com/guruofquality/grblock
>>
>> _josh
>>
> 
> 
> We don't normally pass numpy arrays through Swig to GNU Radio, which could
> be your problem. Try passing it as you_ndarray.tolist() and see if that
> works.
> 

So, its actually only passing an integer (representing a memory address)
into python. The routine described above is using numpy's array
interface to turn that address into a numpy array.

https://github.com/guruofquality/grblock/blob/master/python/gateway.py#L24
http://docs.scipy.org/doc/numpy/reference/arrays.interface.html

-Josh



reply via email to

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