Open Derek-K opened 1 year ago
Additional info...
apt list --installed | grep -i soapy
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
libsoapysdr-dev/focal,now 0.7.2-1 amd64 [installed]
libsoapysdr0.7/focal,now 0.7.2-1 amd64 [installed,automatic]
soapyosmo-common0.7/focal,now 0.2.5-3build2 amd64 [installed,auto-removable]
soapysdr-module-rtlsdr/focal,now 0.3.0-2build1 amd64 [installed]
soapysdr0.7-module-rtlsdr/focal,now 0.3.0-2build1 amd64 [installed,automatic]
Found a few more lines that will cause Seg Fault in soapy_source.cc
device_->setBandwidth(SOAPY_SDR_RX, 0, 3.0e6);
device_->setGainMode(SOAPY_SDR_RX, 0, false);
device_->setGain(SOAPY_SDR_RX, 0, gain);
I don't get a crash on 20.04.4 (x86_64) with the same soapysdr package versions and a R820T2 dongle:
$ ./dump978-fa --sdr driver=rtlsdr --format CS8 --raw-port 30978 --json-port 30979
raw-port: listening for connections on 0.0.0.0:30978
raw-port: listening for connections on [::]:30978
json-port: listening for connections on 0.0.0.0:30979
json-port: listening for connections on [::]:30979
Found Rafael Micro R820T tuner
Found Rafael Micro R820T tuner
Exact sample rate is: 2083333.135571 Hz
[R82XX] PLL not locked!
SoapySDR: using maximum manual gain 49.6 dB
SoapySDR: using stream setting buffsize=262144
Allocating 15 zero-copy buffers
so this might be something specific to soapysdr with an e4k tuner.
Do you have a stacktrace for the segfault? I don't have e4k hardware to test with.
(unrelated, but you got lucky if your e4k works with dump1090 -- usually those tuners are quite deaf at 1090MHz)
FYI, I was able to run the 'older' dump978(mutability) successfully with the same hardware. Just wondering if I can use that to feed FA using skyaware978.
This isn't trivial to do (and the old dump978 has some reception bugs). Better to track down the segfault ..
Can you check if your soapysdr-rtlsdr driver is basically functional with SoapySDRUtil? (Install package soapysdr-tools
if not already there). Should look something like this:
$ SoapySDRUtil --args='driver=rtlsdr' --rate=2400000 --direction=rx
######################################################
## Soapy SDR -- the SDR abstraction library ##
######################################################
Found Rafael Micro R820T tuner
Found Rafael Micro R820T tuner
[R82XX] PLL not locked!
[INFO] Using format CS8.
Stream format: CS8
Num channels: 1
Element size: 2 bytes
Begin rx rate test at 2.4 Msps
Starting stream loop, press Ctrl+C to exit...
Allocating 15 zero-copy buffers
-^C
Yea, I have been trying to nail down the issue. SoapySDR is still pretty new to me, and I have been doing some readings and compiled a copy...
The problem is SoapySDR never picked up my E4000! I have seen postings that SoapySDR works with E4000 but never really figured out howto.
In fact, I had used this (old) E4000 since day one back when RTLSDR was started and was able to work well with dump1090 -> dump1090-mutability -> dump1090-fa without issue (but none of those require SoapySDR)
So, now the 'bug' is more towards SoapySDR (why it doesn't detect the E4000). But it is also interesting that dump978-fa WAS able to find my E4000 tuner before causing Seg Fault. :/
And for the record...
$ SoapySDRUtil --info
######################################################
## Soapy SDR -- the SDR abstraction library ##
######################################################
Lib Version: v0.8.1-g4e71a35e
API Version: v0.8.200
ABI Version: v0.8-2
Install root: /usr/local
Search path: /usr/local/lib/SoapySDR/modules0.8-2
Module found: /usr/local/lib/SoapySDR/modules0.8-2/libremoteSupport.so (0.6.0-f7dca6e)
Available factories... remote
Available converters...
- CF32 -> [CF32, CS16, CS8, CU16, CU8]
- CS16 -> [CF32, CS16, CS8, CU16, CU8]
- CS32 -> [CS32]
- CS8 -> [CF32, CS16, CS8, CU16, CU8]
- CU16 -> [CF32, CS16, CS8]
- CU8 -> [CF32, CS16, CS8]
- F32 -> [F32, S16, S8, U16, U8]
- S16 -> [F32, S16, S8, U16, U8]
- S32 -> [S32]
- S8 -> [F32, S16, S8, U16, U8]
- U16 -> [F32, S16, S8]
- U8 -> [F32, S16, S8]
$ SoapySDRUtil --args='driver=rtlsdr' --rate=2400000 --direction=rx
######################################################
## Soapy SDR -- the SDR abstraction library ##
######################################################
Error in rate test: SoapySDR::Device::make() no match
$ SoapySDRUtil --find
######################################################
## Soapy SDR -- the SDR abstraction library ##
######################################################
No devices found!
$ SoapySDRUtil --find="driver=rtlsdr"
######################################################
## Soapy SDR -- the SDR abstraction library ##
######################################################
No devices found! driver=rtlsdr
Oh dang... my bad.
Just realized my search path and library are all pointed to version 0.8 (The ones I build from source), but the modules (installed via apt) are all version 0.7 and stored somewhere else.
I can't seem to find the latest version (0.8) even after apt update. And still unsure where I can download the module source code and compile them myself...
OK, problem fixed... At least for the SoapySDR part.
$ SoapySDRUtil --info
######################################################
## Soapy SDR -- the SDR abstraction library ##
######################################################
Lib Version: v0.8.1-g4e71a35e
API Version: v0.8.200
ABI Version: v0.8-2
Install root: /usr/local
Search path: /usr/local/lib/SoapySDR/modules0.8-2
Module found: /usr/local/lib/SoapySDR/modules0.8-2/libremoteSupport.so (0.6.0-f7dca6e)
Module found: /usr/local/lib/SoapySDR/modules0.8-2/librtlsdrSupport.so (0.3.3-40d0708)
Available factories... remote, rtlsdr
Available converters...
- CF32 -> [CF32, CS16, CS8, CU16, CU8]
- CS16 -> [CF32, CS16, CS8, CU16, CU8]
- CS32 -> [CS32]
- CS8 -> [CF32, CS16, CS8, CU16, CU8]
- CU16 -> [CF32, CS16, CS8]
- CU8 -> [CF32, CS16, CS8]
- F32 -> [F32, S16, S8, U16, U8]
- S16 -> [F32, S16, S8, U16, U8]
- S32 -> [S32]
- S8 -> [F32, S16, S8, U16, U8]
- U16 -> [F32, S16, S8]
- U8 -> [F32, S16, S8]
$ SoapySDRUtil --find
######################################################
## Soapy SDR -- the SDR abstraction library ##
######################################################
Found Elonics E4000 tuner
Found device 0
driver = rtlsdr
label = Generic RTL2832U OEM ::
manufacturer = Realtek
product = RTL2838UHIDIR
serial =
tuner = Elonics E4000
But still... Seg fault at setting sample rate.
$ ./dump978-fa --sdr driver=rtlsdr
Found Elonics E4000 tuner
Found Elonics E4000 tuner
Segmentation fault (core dumped)
$ ./dump978-fa --version
dump978-fa 7.2
This sounds like you have version skew between the soapysdr/rtlsdr libraries and dump978.
please ensure that:
a) you have only one version of librtlsdr installed b) you have only one version of soapysdr/soapysdr-rtlsdr installed, and it was compiled against the librtlsdr in (a) c) you compiled dump978 against the soapysdr from (b)
OK, finally. Long story short.
I have removed all SoapySDR packages again, only left with the 8.0 binaries. When I try to build dump978-fa it failed initially because
dpkg-checkbuilddeps: error: Unmet build dependencies: libsoapysdr-dev
dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied; aborting
dpkg-buildpackage: warning: (Use -d flag to override.)
So for the heck of it, I tried to follow the suggestion added "-d" and build with
sudo dpkg-buildpackage -b --pre-clean --no-sign -d
dump978-fa seems to work (at no more seg fault) at the moment, waiting to see if the first packet shows up...
dump978-fa is compiled from GitHub source (without error). The same computer/SDR stick works fine with dump1090-fa without problems.
Additional debugging, SegFault happens at
soapy_source.cc
line 166 when setting the Sample Rate to 2083333.0device_->setSampleRate(SOAPY_SDR_RX, 0, 2083333.0);
However, rtl_test was able to set sample rate at 2083333.0...