Oleg-Malyutin / sdr_receiver_dvb_t2

This is a Software Defined Radio(SDR) project implementing a DVB-T2 receiver.
GNU General Public License v3.0
51 stars 10 forks source link

Building under Linux with SDRPlay Support #3

Closed Konradrundfunk closed 3 years ago

Konradrundfunk commented 3 years ago

Hi, I have a Sdrplay RSPA1 and tried to build with QTcreator. But I got the following errors below. I set the lib path to my lib folder since it wasn't recocnized before. I have the version 2 of the SDRplay lib installed from the website. I am on a ARCH Linux system and have compiled with g++. Thanks for your great work on DVBT2 decoding and deomoding!

14:08:07: Running steps for project sdr_receiver_dvb_t2...
14:08:07: Configuration unchanged, skipping qmake step.
14:08:07: Starting: "/usr/bin/make" -j12
/usr/bin/qmake -o Makefile ../sdr_receiver_dvb_t2/sdr_receiver_dvb_t2.pro -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug
g++  -o sdr_receiver_dvb_t2 tables_handler.o address_freq_deinterleaver.o bb_de_header.o bch_decoder.o data_symbol.o dvbt2_definition.o dvbt2_frame.o fc_symbol.o ldpc_decoder.o llr_demapper.o p1_symbol.o p2_symbol.o pilot_generator.o time_deinterleaver.o airspy.o iqconverter_float.o iqconverter_int16.o getopt.o getopt1.o plutosdr_hi_speed_rx.o main.o main_window.o plot.o qcustomplot.o rx_airspy.o rx_plutosdr.o rx_sdrplay.o qrc_pluto_kernel_module.o moc_bb_de_header.o moc_bch_decoder.o moc_data_symbol.o moc_dvbt2_frame.o moc_fc_symbol.o moc_ldpc_decoder.o moc_llr_demapper.o moc_p1_symbol.o moc_p2_symbol.o moc_time_deinterleaver.o moc_main_window.o moc_plot.o moc_qcustomplot.o moc_rx_airspy.o moc_rx_plutosdr.o moc_rx_sdrplay.o   -lfftw3f -L /usr/local/lib/libmirsdrapi-rsp.so.2 -lusb-1.0 -lssh -lpthread /usr/lib/libQt5PrintSupport.so /usr/lib/libQt5Widgets.so /usr/lib/libQt5Gui.so /usr/lib/libQt5Network.so /usr/lib/libQt5Core.so -lGL   
/usr/bin/ld: rx_sdrplay.o: in function `rx_sdrplay::get(char*&, unsigned char&)':
/home/konrad/git/sdr_receiver_dvb_t2/build-sdr_receiver_dvb_t2-Desktop-Debug/../sdr_receiver_dvb_t2/rx_sdrplay.cpp:77: undefined reference to `mir_sdr_GetDevices'
/usr/bin/ld: /home/konrad/git/sdr_receiver_dvb_t2/build-sdr_receiver_dvb_t2-Desktop-Debug/../sdr_receiver_dvb_t2/rx_sdrplay.cpp:83: undefined reference to `mir_sdr_SetDeviceIdx'
/usr/bin/ld: rx_sdrplay.o: in function `rx_sdrplay::init(double, int)':
/home/konrad/git/sdr_receiver_dvb_t2/build-sdr_receiver_dvb_t2-Desktop-Debug/../sdr_receiver_dvb_t2/rx_sdrplay.cpp:90: undefined reference to `mir_sdr_Uninit'
/usr/bin/ld: /home/konrad/git/sdr_receiver_dvb_t2/build-sdr_receiver_dvb_t2-Desktop-Debug/../sdr_receiver_dvb_t2/rx_sdrplay.cpp:91: undefined reference to `mir_sdr_DCoffsetIQimbalanceControl'
/usr/bin/ld: /home/konrad/git/sdr_receiver_dvb_t2/build-sdr_receiver_dvb_t2-Desktop-Debug/../sdr_receiver_dvb_t2/rx_sdrplay.cpp:104: undefined reference to `mir_sdr_Init'
/usr/bin/ld: rx_sdrplay.o: in function `rx_sdrplay::start()':
/home/konrad/git/sdr_receiver_dvb_t2/build-sdr_receiver_dvb_t2-Desktop-Debug/../sdr_receiver_dvb_t2/rx_sdrplay.cpp:158: undefined reference to `mir_sdr_ReadPacket'
/usr/bin/ld: /home/konrad/git/sdr_receiver_dvb_t2/build-sdr_receiver_dvb_t2-Desktop-Debug/../sdr_receiver_dvb_t2/rx_sdrplay.cpp:233: undefined reference to `mir_sdr_Uninit'
/usr/bin/ld: /home/konrad/git/sdr_receiver_dvb_t2/build-sdr_receiver_dvb_t2-Desktop-Debug/../sdr_receiver_dvb_t2/rx_sdrplay.cpp:234: undefined reference to `mir_sdr_ReleaseDeviceIdx'
/usr/bin/ld: /home/konrad/git/sdr_receiver_dvb_t2/build-sdr_receiver_dvb_t2-Desktop-Debug/../sdr_receiver_dvb_t2/rx_sdrplay.cpp:186: undefined reference to `mir_sdr_SetRf'
/usr/bin/ld: /home/konrad/git/sdr_receiver_dvb_t2/build-sdr_receiver_dvb_t2-Desktop-Debug/../sdr_receiver_dvb_t2/rx_sdrplay.cpp:193: undefined reference to `mir_sdr_SetGr'
collect2: error: ld returned 1 exit status
make: *** [Makefile:454: sdr_receiver_dvb_t2] Error 1
14:08:08: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project sdr_receiver_dvb_t2 (kit: Desktop)
When executing step "Make"
14:08:08: Elapsed time: 00:01.

image

Oleg-Malyutin commented 3 years ago

Hello, Unfortunately, I know English poorly, so I will use the translator.

Run as superuser (sudo, su, I do not know ARCH Linux ) on the command line: ldconfig and replace on unix|win32: LIBS += -lmirsdrapi-rsp

Konradrundfunk commented 3 years ago

Thanks for the quick response. Unfortunately it wouldn't find the driver resulting in this error:

15:28:02: Running steps for project sdr_receiver_dvb_t2...
15:28:02: Configuration unchanged, skipping qmake step.
15:28:02: Starting: "/usr/bin/make" -j12
g++  -o sdr_receiver_dvb_t2 tables_handler.o address_freq_deinterleaver.o bb_de_header.o bch_decoder.o data_symbol.o dvbt2_definition.o dvbt2_frame.o fc_symbol.o ldpc_decoder.o llr_demapper.o p1_symbol.o p2_symbol.o pilot_generator.o time_deinterleaver.o airspy.o iqconverter_float.o iqconverter_int16.o getopt.o getopt1.o plutosdr_hi_speed_rx.o main.o main_window.o plot.o qcustomplot.o rx_airspy.o rx_plutosdr.o rx_sdrplay.o qrc_pluto_kernel_module.o moc_bb_de_header.o moc_bch_decoder.o moc_data_symbol.o moc_dvbt2_frame.o moc_fc_symbol.o moc_ldpc_decoder.o moc_llr_demapper.o moc_p1_symbol.o moc_p2_symbol.o moc_time_deinterleaver.o moc_main_window.o moc_plot.o moc_qcustomplot.o moc_rx_airspy.o moc_rx_plutosdr.o moc_rx_sdrplay.o   -lfftw3f -lmirsdrapi-rsp -lusb-1.0 -lssh -lpthread /usr/lib/libQt5PrintSupport.so /usr/lib/libQt5Widgets.so /usr/lib/libQt5Gui.so /usr/lib/libQt5Network.so /usr/lib/libQt5Core.so -lGL   
/usr/bin/ld: cannot find -lmirsdrapi-rsp
collect2: error: ld returned 1 exit status
make: *** [Makefile:454: sdr_receiver_dvb_t2] Error 1
15:28:02: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project sdr_receiver_dvb_t2 (kit: Desktop)
When executing step "Make"
15:28:02: Elapsed time: 00:00.

This is the contend of my/usr/local/libfolder where the driver should be installed in:

cmake     libair_modes.so           libair_modes.so.9e2515a5  libcorrect.so        libmirsdrapi-rsp.so.2  libsatdump_core.so  libsdrplay_api.so.3
disabled  libair_modes.so.1.0.0git  libcorrect.a              libmirsdrapi-rsp.so  librtlsdr.so           libsdrplay_api.so   libsdrplay_api.so.3.07
Oleg-Malyutin commented 3 years ago

libmirsdrapi-rsp.so this is the link libmirsdrapi-rsp.so.2 I have a link too libmirsdrapi-rsp.so.2.13 I have my own driver maybe you only have links without a driver?

Konradrundfunk commented 3 years ago

this is the relavant ls -al output

lrwxrwxrwx  1 root root       36 Aug 17 15:27 libmirsdrapi-rsp.so -> /usr/local/lib/libmirsdrapi-rsp.so.2
lrwxrwxrwx  1 root root       39 Aug 17 15:27 libmirsdrapi-rsp.so.2 -> /usr/local/lib/libmirsdrapi-rsp.so.2.13
Oleg-Malyutin commented 3 years ago

Then you can try to replace with: -L /usr/local/lib/libmirsdrapi-rsp.so.2.13 Possibly broken links.

Konradrundfunk commented 3 years ago

Same error as firstyl mentioned. Can you just compile it for me and upload to Github releases?

19:04:51: Running steps for project sdr_receiver_dvb_t2...
19:04:51: Configuration unchanged, skipping qmake step.
19:04:51: Starting: "/usr/bin/make" -j12
/usr/bin/qmake -o Makefile ../sdr_receiver_dvb_t2/sdr_receiver_dvb_t2.pro -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug
g++  -o sdr_receiver_dvb_t2 tables_handler.o address_freq_deinterleaver.o bb_de_header.o bch_decoder.o data_symbol.o dvbt2_definition.o dvbt2_frame.o fc_symbol.o ldpc_decoder.o llr_demapper.o p1_symbol.o p2_symbol.o pilot_generator.o time_deinterleaver.o airspy.o iqconverter_float.o iqconverter_int16.o getopt.o getopt1.o plutosdr_hi_speed_rx.o main.o main_window.o plot.o qcustomplot.o rx_airspy.o rx_plutosdr.o rx_sdrplay.o qrc_pluto_kernel_module.o moc_bb_de_header.o moc_bch_decoder.o moc_data_symbol.o moc_dvbt2_frame.o moc_fc_symbol.o moc_ldpc_decoder.o moc_llr_demapper.o moc_p1_symbol.o moc_p2_symbol.o moc_time_deinterleaver.o moc_main_window.o moc_plot.o moc_qcustomplot.o moc_rx_airspy.o moc_rx_plutosdr.o moc_rx_sdrplay.o   -lfftw3f -L /usr/local/lib/libmirsdrapi-rsp.so.2.13 -lusb-1.0 -lssh -lpthread /usr/lib/libQt5PrintSupport.so /usr/lib/libQt5Widgets.so /usr/lib/libQt5Gui.so /usr/lib/libQt5Network.so /usr/lib/libQt5Core.so -lGL   
/usr/bin/ld: rx_sdrplay.o: in function `rx_sdrplay::get(char*&, unsigned char&)':
/home/konrad/git/sdr_receiver_dvb_t2/build-sdr_receiver_dvb_t2-Desktop-Debug/../sdr_receiver_dvb_t2/rx_sdrplay.cpp:77: undefined reference to `mir_sdr_GetDevices'
/usr/bin/ld: /home/konrad/git/sdr_receiver_dvb_t2/build-sdr_receiver_dvb_t2-Desktop-Debug/../sdr_receiver_dvb_t2/rx_sdrplay.cpp:83: undefined reference to `mir_sdr_SetDeviceIdx'
/usr/bin/ld: rx_sdrplay.o: in function `rx_sdrplay::init(double, int)':
/home/konrad/git/sdr_receiver_dvb_t2/build-sdr_receiver_dvb_t2-Desktop-Debug/../sdr_receiver_dvb_t2/rx_sdrplay.cpp:90: undefined reference to `mir_sdr_Uninit'
/usr/bin/ld: /home/konrad/git/sdr_receiver_dvb_t2/build-sdr_receiver_dvb_t2-Desktop-Debug/../sdr_receiver_dvb_t2/rx_sdrplay.cpp:91: undefined reference to `mir_sdr_DCoffsetIQimbalanceControl'
/usr/bin/ld: /home/konrad/git/sdr_receiver_dvb_t2/build-sdr_receiver_dvb_t2-Desktop-Debug/../sdr_receiver_dvb_t2/rx_sdrplay.cpp:104: undefined reference to `mir_sdr_Init'
/usr/bin/ld: rx_sdrplay.o: in function `rx_sdrplay::start()':
/home/konrad/git/sdr_receiver_dvb_t2/build-sdr_receiver_dvb_t2-Desktop-Debug/../sdr_receiver_dvb_t2/rx_sdrplay.cpp:158: undefined reference to `mir_sdr_ReadPacket'
/usr/bin/ld: /home/konrad/git/sdr_receiver_dvb_t2/build-sdr_receiver_dvb_t2-Desktop-Debug/../sdr_receiver_dvb_t2/rx_sdrplay.cpp:233: undefined reference to `mir_sdr_Uninit'
/usr/bin/ld: /home/konrad/git/sdr_receiver_dvb_t2/build-sdr_receiver_dvb_t2-Desktop-Debug/../sdr_receiver_dvb_t2/rx_sdrplay.cpp:234: undefined reference to `mir_sdr_ReleaseDeviceIdx'
/usr/bin/ld: /home/konrad/git/sdr_receiver_dvb_t2/build-sdr_receiver_dvb_t2-Desktop-Debug/../sdr_receiver_dvb_t2/rx_sdrplay.cpp:186: undefined reference to `mir_sdr_SetRf'
/usr/bin/ld: /home/konrad/git/sdr_receiver_dvb_t2/build-sdr_receiver_dvb_t2-Desktop-Debug/../sdr_receiver_dvb_t2/rx_sdrplay.cpp:193: undefined reference to `mir_sdr_SetGr'
collect2: error: ld returned 1 exit status
make: *** [Makefile:454: sdr_receiver_dvb_t2] Error 1
19:04:52: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project sdr_receiver_dvb_t2 (kit: Desktop)
When executing step "Make"
19:04:52: Elapsed time: 00:01.
Oleg-Malyutin commented 3 years ago

This is a link to static compilation with Qt. https://drive.google.com/file/d/15_EmlQ1d__60GNXFC_QOfndGhEdVv5L4/view?usp=sharing But when running on other Linux distributions, there are more problems than when compiling a project.

Your SDRPlay 2.x driver is clearly not installed correctly.

Konradrundfunk commented 3 years ago

Now the program is starting up(thanks was infact a driver issue caused by the install script) but the controls are grayed out and I see no logs in the terminal. I can see the device showing up in lsusb. Bus 001 Device 002: ID 1df7:3000 SDRplay RSP1a

Oleg-Malyutin commented 3 years ago

Which programm? Qt project?

Konradrundfunk commented 3 years ago

Yes the QT Program. So the dvbt2 software.

Oleg-Malyutin commented 3 years ago

When starting the program, only the device selection elements are active. If the device is defined, the following graphic elements will become active. Then tune to the frequency and start, etc.

Konradrundfunk commented 3 years ago

I haven't seen any device selection option only the option to set frequency and gain.

Oleg-Malyutin commented 3 years ago

1

Konradrundfunk commented 3 years ago

Now it won't build at all :/ .I have tried multiple ways to ensure that the lib is infact installed corectly and I can even see it in the ldconfig -p output: libmirsdrapi-rsp.so.2.13 (libc6,x86-64) => /usr/lib/libmirsdrapi-rsp.so.2.13. I don't know why it worked when compiled 30min ago.

Konradrundfunk commented 3 years ago

When linking throught the libs: image When linking directly: image

Oleg-Malyutin commented 3 years ago

It is very strange. It is clear that the problem is not in the project. Does the device work with other programs? It is more like a hardware failure of a computer, such as a hard drive. The drive may run out of space.

Oleg-Malyutin commented 3 years ago

Now I remember. I had a similar problem with another library. I decided through - "right mouse button on the project - add a library ..." Before this "build - clean project"

Konradrundfunk commented 3 years ago

That infact did work whierdly. Thanks for now the software is looking great btw. If you don't mind I can make the instruktions more clear in the README for Arch linux users.

Konradrundfunk commented 3 years ago

I wont get a lock here. What's my mistake? image image

Oleg-Malyutin commented 3 years ago

This signal is too weak. From experience, synchronization starts with a gain reduction of ~ 40. Also strong reflected signal due to sub-optimal antenna orientation (or omnidirectional antenna). For starters, you can get a stable signal on a consumer TV.

Konradrundfunk commented 3 years ago

I do have a groundplane Antenna but I am trying now to get it in a better position but thats a good tip with the gain. I also will try using my V-Dipole Antenna.

Oleg-Malyutin commented 3 years ago

These are decimette waves

image