LimeSDR Gnu Radio Plug-in Breaks RTL-SDR Gnu Radio Plug-in

Hello, all! I’m running Gnu Radio Companion on both a desktop system and a laptop, both with Linux Mint 19.2. I have several RTL-based SDRs, and after loading the appropriate packages from the repository, I have no problems using them from GRC. HOWEVER, once I load the Limesuite GR-plugin, the RTL-SDRs will no longer work with GRC. I get the following message when I attempt to run a GRC flowgraph (any flow graph) with one of the RTL-SDRs:

Warning: failed to XInitThreads()
Traceback (most recent call last):
File “/home/gary/gnuradio/rtlTest.py”, line 30, in
import osmosdr
File “/usr/lib/python2.7/dist-packages/osmosdr/init.py”, line 26, in
from osmosdr_swig import *
File “/usr/lib/python2.7/dist-packages/osmosdr/osmosdr_swig.py”, line 17, in
_osmosdr_swig = swig_import_helper()
File “/usr/lib/python2.7/dist-packages/osmosdr/osmosdr_swig.py”, line 16, in swig_import_helper
return importlib.import_module(‘_osmosdr_swig’)
File “/usr/lib/python2.7/importlib/init.py”, line 37, in import_module
import(name)
ImportError: No module named _osmosdr_swig

Done (return code 1)

Here’s what I’ve tried to fix the problem (all unsuccessful):

  • Reloaded the OS, then reloaded only the GRC plug-ins (thought maybe some other program caused the problem)
  • Uninstalled and reinstalled the Osmocom plug-ins from the repository.
  • Uninstalled and reinstalled the osmocom plug-ins from source.
  • Uninstalled both Limesuite and osmocom plug-ins, then reinstalled in different order (osmocom, then Limesuite, Limesuite, then osmocom).

NOTE: Limesuite always works; its just the osmocom that is broken. I’ve left the laptop without Limesuite so that I can still use my RTL-SDRs, but I’d really like to understand and fix this problem.

Any ideas are welcome.

Just to be clear, you mean gr-limesdr? And how have you installed everything?

Just to be clear, you mean gr-limesdr?

Yes.

And how have you installed everything?

I was able to install gr-limesdr with the instructions provided on the Github site using the PPA, specifically these four commands:

sudo add-apt-repository -y ppa:myriadrf/drivers
sudo add-apt-repository -y ppa:myriadrf/gnuradio
sudo apt update
sudo apt install gr-limesdr

The LimeSDR works perfectly in Gnu Radio once I add the plugin, but it appears to break the RTL-SDR / Osmocom plugin in the process.

Hm, not sure why this would be. @Garmus, any ideas?

I wasn’t able to reproduce this problem in either ubuntu 16.04 or 18.04 when installing the gr-limesdr and gr-osmocom packages from source or using the package manager. So the problem you are experiencing is specific to your install and most likely there is something wrong with library linking.

Does the file _osmosdr_swig.so exsit in /usr/lib/python2.7/dist-packages/osmosdr/ ? Can you provide output of ldd -r /usr/lib/python2.7/dist-packages/osmosdr/_osmosdr_swig.so

$ ldd -r /usr/lib/python2.7/dist-packages/osmosdr/_osmosdr_swig.so
ldd: /usr/lib/python2.7/dist-packages/osmosdr/_osmosdr_swig.so: No such file or directory

Strangely, I have a separate system on which I did NOT load the Limesuite. It provided the same answer as above, but my RTL-SDRs work just fine on it.

Because most likely your packages are in /usr/local/lib… instead of /usr/lib/…
If you have both gr-osmosdr and gr-limesdr installed can you try setting up your $LD_LIBRARY_PATH to /usr/local/lib

Now things are even more strange. Based on your suggestion, I took a look in the /usr/local/lib directory, both on the computer having these issues, and on another computer not having the issue (but also the one I didn’t load gr-limesdr onto). The one having the issues was missing the directory “osmosdr” under the /usr/local/lib/python2.7/dist-packages/ directory; it was present on the working system.
Because I’m now REALLY curious, I’m going to load “gr-limesdr” onto the working system to see what reaction it has for this particular directory. I’ll report back when I have some results.

UPDATE: I took a computer, formatted & reloaded Linux Mint 19.2 Cinnamon, then added (from “Software Manager”) both Gnu Radio Companion and gr-osmosdr.
At that point, I connected a RTL-SDR and ran a simple graph (osmocom source to frequency sink). Worked with no problem.
I then loaded (using the four lines of commands stated above) gr-limesdr and set the udev rules. I connected my LimeSDR Mini, ran the same type of graph as above (lime source to frequency sink), and it worked perfectly.
Here’s where it went bad. I then rebooted the computer. When it came back up, it told me it wanted to do some updates. I went ahead and approved those updates. They included updates for “gr-osmosdr” and “rtl-sdr”. After those finished, I brought up GRC and attempted to re-run the RTL-SDR graph. That’s when I got the error that started this thread.
Thoughts?

Sounds like a dependency issue. Maybe gr-limesdr pulls-in more recent versions of something which in turn then breaks gr-osmosdr. You’re going to have to investigate what dependencies each have and when the updates take place, what is being updated and from where.

I also managed to replicate the issue. After I downgraded gr-osmosdr from version 0.1.4.127-myriadrf1~bionic to 0.1.4-14build1, it started working again