SDRPlay and Linux

Discussion in 'Software Defined Radio (SDR)' started by KC3SWL, Jul 23, 2019.

ad: L-HROutlet
ad: l-rl
ad: L-MFJ
ad: MessiPaoloni-1
ad: Left-2
ad: Subscribe
  1. KA8NCR

    KA8NCR Ham Member QRZ Page

    If it fails to compile, those are likely missing dependencies of the -dev variety. You may have libusb-1.0-0 installed, but you do not have libusb-1.0-0-dev installed.

    Failures with the linker usually are a library isn't where it expects it to be. You need to make sure you run ldconfig after each step, or you need to make sure the custom path to your libraries is entered into /etc/ld.so.conf.

    Those instructions look correct. I just succeeded in getting an SDRPlay RSP1 to talk to an Odroid N2 this weekend.
     
    KA2CZU likes this.
  2. KA2CZU

    KA2CZU XML Subscriber QRZ Page

    checked and lib-usb-1.0-0-dev is installed.

    I'll have to see about the library dependencies...

    retried it this morning to check and trying to link I get a lot of errors thrown like this:

    /usr/bin/ld: CMakeFiles/CubicSDR.dir/src/demod/DemodulatorPreThread.cpp.o: in function `DemodulatorPreThread::setFrequency(long long)': DemodulatorPreThread.cpp: (.text+0x7e8): undefined reference to `__atomic_store_8'
     
  3. KA8NCR

    KA8NCR Ham Member QRZ Page

    So did all the dependencies build okay before trying to build CubicSDR?

    That error seems to indicate that it needs -latomic in the makefile. But cmake should have caught that. I wonder if the system compiler set-up is borked, or that goofy update-alternatives has you pointed to 4.xx compiler version.
     
    Last edited: Oct 7, 2019
  4. KA2CZU

    KA2CZU XML Subscriber QRZ Page

    I'll have to double check... lots and lots of warnings but mostly about long types. I can check later, but why would the dependencies in the make file
    not stop before trying to link, if one or more of the dependent objects weren't built?

    BTW, I did not edit /etc/ld.so.conf yet... just looked at it, and it occurred to me that your comment about it being edited to point to my libraries might be needed.
    Not sure, as I'm not familiar enough with this code to know what needs what...

    Here are (I think all warning messages) the messages thrown for SDRDevices.cpp.o:

    [ 54%] Building CXX object CMakeFiles/CubicSDR.dir/src/forms/SDRDevices/SDRDevices.cpp.o
    /home/pi/sdrplay/CubicSDR/src/forms/SDRDevices/SDRDevices.cpp: In member function ‘wxPGProperty* SDRDevicesDialog::addArgInfoProperty(wxPropertyGrid*, SoapySDR::ArgInfo)’:
    /home/pi/sdrplay/CubicSDR/src/forms/SDRDevices/SDRDevices.cpp:59:44: warning: catching polymorphic type ‘class std::invalid_argument’ by value [-Wcatch-value=]
    } catch (std::invalid_argument e) {
    ^
    /home/pi/sdrplay/CubicSDR/src/forms/SDRDevices/SDRDevices.cpp:71:44: warning: catching polymorphic type ‘class std::invalid_argument’ by value [-Wcatch-value=]
    } catch (std::invalid_argument e) {
    ^
    /home/pi/sdrplay/CubicSDR/src/forms/SDRDevices/SDRDevices.cpp: In member function ‘virtual void SDRDevicesDialog::OnPropGridChanged(wxPropertyGridEvent&)’:
    /home/pi/sdrplay/CubicSDR/src/forms/SDRDevices/SDRDevices.cpp:554:40: warning: catching polymorphic type ‘class std::invalid_argument’ by value [-Wcatch-value=]
    } catch (std::invalid_argument e) {
    ^
    /home/pi/sdrplay/CubicSDR/src/forms/SDRDevices/SDRDevices.cpp:569:38: warning: catching polymorphic type ‘class std::invalid_argument’ by value [-Wcatch-value=]
    catch (std::invalid_argument e) {
    ^
    In file included from /usr/include/c++/8/map:60,
    from /home/pi/sdrplay/CubicSDR/src/forms/SDRDevices/SDRDevices.h:6,
    from /home/pi/sdrplay/CubicSDR/src/forms/SDRDevices/SDRDevices.cpp:4:
    /usr/include/c++/8/bits/stl_tree.h: In member function ‘std::pair<std::_Rb_tree_node_base*, std::_Rb_tree_node_base*> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_get_insert_hint_unique_pos(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator, const key_type&) [with _Key = std::__cxx11::basic_string<char>; _Val = std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo>; _KeyOfValue = std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo> >; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo> >]’:
    /usr/include/c++/8/bits/stl_tree.h:2146:5: note: parameter passing for argument of type ‘std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo> >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo> > >::const_iterator’ {aka ‘std::_Rb_tree_const_iterator<std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo> >’} changed in GCC 7.1
    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/c++/8/bits/stl_tree.h: In member function ‘std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_emplace_hint_unique(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator, _Args&& ...) [with _Args = {const std::piecewise_construct_t&, std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&>, std::tuple<>}; _Key = std::__cxx11::basic_string<char>; _Val = std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo>; _KeyOfValue = std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo> >; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo> >]’:
    /usr/include/c++/8/bits/stl_tree.h:2411:7: note: parameter passing for argument of type ‘std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo> >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo> > >::const_iterator’ {aka ‘std::_Rb_tree_const_iterator<std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo> >’} changed in GCC 7.1
    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In file included from /usr/include/c++/8/map:61,
    from /home/pi/sdrplay/CubicSDR/src/forms/SDRDevices/SDRDevices.h:6,
    from /home/pi/sdrplay/CubicSDR/src/forms/SDRDevices/SDRDevices.cpp:4:
    /usr/include/c++/8/bits/stl_map.h: In member function ‘std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::eek:perator[](std::map<_Key, _Tp, _Compare, _Alloc>::key_type&&) [with _Key = std::__cxx11::basic_string<char>; _Tp = SoapySDR::ArgInfo; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo> >]’:
    /usr/include/c++/8/bits/stl_map.h:518:8: note: parameter passing for argument of type ‘std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo> >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo> > >::const_iterator’ {aka ‘std::_Rb_tree_const_iterator<std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo> >’} changed in GCC 7.1
    __i = _M_t._M_emplace_hint_unique(__i, std::piecewise_construct,
    In file included from /usr/include/c++/8/map:60,
    from /home/pi/sdrplay/CubicSDR/src/forms/SDRDevices/SDRDevices.h:6,
    from /home/pi/sdrplay/CubicSDR/src/forms/SDRDevices/SDRDevices.cpp:4:
    /usr/include/c++/8/bits/stl_tree.h: In member function ‘std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_emplace_hint_unique(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator, _Args&& ...) [with _Args = {const std::piecewise_construct_t&, std::tuple<const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&>, std::tuple<>}; _Key = std::__cxx11::basic_string<char>; _Val = std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo>; _KeyOfValue = std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo> >; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo> >]’:
    /usr/include/c++/8/bits/stl_tree.h:2411:7: note: parameter passing for argument of type ‘std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo> >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo> > >::const_iterator’ {aka ‘std::_Rb_tree_const_iterator<std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo> >’} changed in GCC 7.1
    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In file included from /usr/include/c++/8/map:61,
    from /home/pi/sdrplay/CubicSDR/src/forms/SDRDevices/SDRDevices.h:6,
    from /home/pi/sdrplay/CubicSDR/src/forms/SDRDevices/SDRDevices.cpp:4:
    /usr/include/c++/8/bits/stl_map.h: In member function ‘std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::eek:perator[](const key_type&) [with _Key = std::__cxx11::basic_string<char>; _Tp = SoapySDR::ArgInfo; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo> >]’:
    /usr/include/c++/8/bits/stl_map.h:499:8: note: parameter passing for argument of type ‘std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo> >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo> > >::const_iterator’ {aka ‘std::_Rb_tree_const_iterator<std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo> >’} changed in GCC 7.1
    __i = _M_t._M_emplace_hint_unique(__i, std::piecewise_construct,
    /usr/include/c++/8/bits/stl_map.h: In member function ‘void SDRDevicesDialog::refreshDeviceProperties()’:
    /usr/include/c++/8/bits/stl_map.h:499:8: note: parameter passing for argument of type ‘std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo> >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo> > >::const_iterator’ {aka ‘std::_Rb_tree_const_iterator<std::pair<const std::__cxx11::basic_string<char>, SoapySDR::ArgInfo> >’} changed in GCC 7.1
    __i = _M_t._M_emplace_hint_unique(__i, std::piecewise_construct,
     
  5. KA8NCR

    KA8NCR Ham Member QRZ Page

    Try this...

    In your CMakeLists.txt:

    Find the line:

    ADD_DEFINITIONS(
    -DUSE_SOAPY_SDR=1
    )


    IF (WIN32)
    set(wxWidgets_USE_STATIC) ON


    Insert before/above the IF and below/after the ADD_DEFINITONS

    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -latomic")


    Diff here (because this forum doesn't support code pasting):
    https://pastebin.com/7sdUifPg

    This will have to be done each time you create a new profile with cmake for this project.
     
    Last edited: Oct 7, 2019
    KA9JLM likes this.
  6. KA2CZU

    KA2CZU XML Subscriber QRZ Page

    thanks, will give it a try later
     
  7. KA2CZU

    KA2CZU XML Subscriber QRZ Page

    and THAT, Mr. Breitner, did it!

    I don't know what those parameters forced, but it worked!

    Thanks!

    Now onto actually finding the RSP1 etc etc etc (just did a quick startup of CubicSDR to verify and it runs without error)
     
  8. KA2CZU

    KA2CZU XML Subscriber QRZ Page

    ok, everything seems to be working now. Turns out I missed one step somewhere along the line.
    I could verify, via lsusb, that the RSP1 was being "seen" in the list of devices, but CubicSDR did not see it.

    I needed to download and build SoapySDRPlay which then "connected" CubicSDR to the Soapy API... down to the device. Not sure of the entire chain
    but no matter, seems to work fine!
     
  9. KA9JLM

    KA9JLM Ham Member QRZ Page

    My brain hurts now. :confused:
     
  10. KA2CZU

    KA2CZU XML Subscriber QRZ Page

    sorry about that, but Jeffrey knows his stuff and really helped out! :D
     

Share This Page