greatscottgadgets / hackrf

low cost software radio platform
https://greatscottgadgets.com/hackrf/
GNU General Public License v2.0
6.53k stars 1.52k forks source link

hackrf works great on Pentoo, but not on Ubuntu 20.04.1 #817

Closed willcummings466 closed 3 years ago

willcummings466 commented 3 years ago

Steps to reproduce

  1. Per "Software Defined Radio with HackRF, Lesson 1" hook up osmosdr source to qtgui_freq_sink (since wxgui is not available)

Expected behaviour

This works when running gnuradio 3.8 in Pentoo from USB dongle. The FFT plot comes up and shows the local radio stations. I expected it to work the same way when running gnuradio 3.8 in Ubuntu 20.04.1

Actual behaviour

When running gnuradio 3.8 in Ubuntu 20.04.1, I get the following error:


RuntimeError: list contains invalid format!

Done (return code 1)


Note: The command "hackrf_transfer -r /dev/null" works as expected.

Version information

Operating system: Ubuntu 20.04.1

hackrf_info output: hackrf_info version: unknown libhackrf version: unknown (0.5) Found HackRF Index: 0 Serial number: 0000000000000000088869dc35a1531b Board ID Number: 2 (HackRF One) Firmware Version: 2018.01.1 (API:1.02) Part ID Number: 0xa000cb3c 0x00584358

If you are reporting a problem that involves third party software (GNU Radio, Gqrx, etc), please report the version here. gnu radio 3.8

Output

Generating: '/home/will/GNURadio/top_block.py'

Executing: /usr/bin/python3 -u /home/will/GNURadio/top_block.py

Warning: failed to XInitThreads()
gr-osmosdr 0.2.0.0 (0.2.0) gnuradio 3.8.1.0 built-in source types: file osmosdr fcd rtl rtl_tcp uhd miri hackrf bladerf rfspace airspy airspyhf soapy redpitaya freesrp [INFO] [UHD] linux; GNU C++ version 9.2.1 20200304; Boost_107100; UHD_3.15.0.0-2build5

RtApiAlsa::getDeviceInfo: snd_pcm_open error for device (hw:0,0), Device or resource busy.

RtApiAlsa::getDeviceInfo: snd_pcm_open error for device (hw:0,1), Invalid argument.

RtApiAlsa::getDeviceInfo: snd_pcm_open error for device (hw:0,1), Invalid argument.

Using HackRF One with firmware 2018.01.1 Traceback (most recent call last):
  File "/home/will/GNURadio/top_block.py", line 188, in <module>
    main()
  File "/home/will/GNURadio/top_block.py", line 166, in main
    tb.start(1)
  File "/usr/lib/python3/dist-packages/gnuradio/gr/top_block.py", line 111, in start
    top_block_start_unlocked(self._impl, max_noutput_items)
  File "/usr/lib/python3/dist-packages/gnuradio/gr/runtime_swig.py", line 4832, in top_block_start_unlocked
    return _runtime_swig.top_block_start_unlocked(r, max_noutput_items)
RuntimeError: list contains invalid format!

>>> Done (return code 1
willcummings466 commented 3 years ago

I figured it out! Thanks to this post: https://lists.gnu.org/archive/html/discuss-gnuradio/2017-01/msg00329.html

I apparently had multiple installations of gnuradio. I'm not sure how that happened. I think (but I'm not sure) that there is a problem with using "sudo apt install gqrx-sdr", so instead I removed gnuradio and reinstalled with pybombs.

As per the post mentioned above, I used the following commands to find all the gnuradio components I'd installed:

apt list --installed | grep gnuradio apt list --installed | grep sdr apt list --installed | grep osmo apt list --installed | grep soapy

and then uninstalled the components I found using commands like this:

sudo apt-get remove --purge libgnuradio sudo apt-get remove --purge soapyosmo sudo apt-get remove --purge libsoapy sudo apt-get remove --purge libosmosdr sudo apt-get remove --purge libmirisdr0 sudo apt-get remove --purge libmirisdr0 sudo apt-get remove --purge librtlsdr sudo apt-get remove --purge libsoapysdr0

Then I installed pybombs (see https://github.com/gnuradio/pybombs) and reinstalled installed gnuradio

sudo apt-get install python3-pip sudo pip3 install pybombs pybombs auto-config pybombs recipes add-defaults pybombs prefix init ~/prefix-3.8 -R gnuradio-default source ~/prefix-3.8/setup_env.sh

Finally I installed gr-osmosdr:

pybombs install gr-osmosdr

Then I invoked GRC:

gnuradio-companion

And by gosh I could pick up my favorite local FM radio station!