Friday, 10 April 2015

GNU Radio - python script startup delays

I've started playing with some Python scripts to control the HackRF and I found that it was taking a very long time to configure the device and to start transmitting in GNU Radio Python scripts. The time from invoking the script to the HackRf starting to transmit was almost a second (0.9s). A bit of experimenting led to an easy fix which has reduced the time to about 15mS!

In the Python code generated by GNU Radio Companion there is a line where the Osmosdr driver is initialised, if you don't provide a device hint as a parameter to the driver it will go and search for all available devices supported by the driver, this takes quite a bit of time, but if you include the device hint the driver startup time is reduced dramatically.
Device hint in Python code

Device hint in GRC block
The same thing can be achieved in GNU Radio Companion by setting the device in the properties box for the Osmosdr source or sink block.

Now to continue developing some usable transceiver code :-)

No comments:

Post a Comment