SDRPlay Independent Community Forum › Forums › General › How to use my RSPduo w/ Rpi-3 & command line?
Tagged: sdrTest
- This topic has 34 replies, 3 voices, and was last updated by .
-
AuthorPosts
-
February 16, 2021 at 9:53 pm #1710alanmalkParticipant
Another day, another black hole…
It would appear I have all needed libraries.
pi@macpi:/ $ sudo find . -iname *librtlsdr.so.*
./usr/local/lib/librtlsdr.so.0
./usr/local/lib/librtlsdr.so.0.6git
./usr/lib/arm-linux-gnueabihf/librtlsdr.so.0.6.0
./usr/lib/arm-linux-gnueabihf/librtlsdr.so.0pi@macpi:/ $ sudo find . -name *rtlsdrSupport*
./usr/local/lib/SoapySDR/modules0.8/librtlsdrSupport.so
./usr/lib/arm-linux-gnueabihf/SoapySDR/modules0.6/librtlsdrSupport.sopi@macpi:~/Downloads/SdrGlut $ ldd ./sdrglut.x
…
libSoapySDR.so.0.6 => /lib/arm-linux-gnueabihf/libSoapySDR.so.0.6 (0x76a85000)pi@macpi:~/Downloads/SdrGlut/sdrTest $ ldd ./sdrTest
…
librtaudio.so.6 => /usr/local/lib/librtaudio.so.6 (0x76f7d000)
libSoapySDR.so.0.6 => /lib/arm-linux-gnueabihf/libSoapySDR.so.0.6 (0x76f2b000)Now, with infinite optimism, but ending with a crash&burn…
pi@macpi:~ $ ./Downloads/SdrGlut/sdrTest//sdrTest -fc 1e6 -f 0.76e6 -am -gain 1 -device 1 -set direct_samp 2
Found Rafael Micro R820T tuner
[INFO] [UHD] linux; GNU C++ version 8.2.0; Boost_106700; UHD_3.13.1.0-3
Number of Devices Found: 2
SDR device = 0 label = PulseAudio
SDR device = 1 label = Generic RTL2832U OEM :: 00000001
device = 1 selected
available = Yes driver = rtlsdr label = Generic RTL2832U OEM :: 00000001 manufacturer = Realtek product = RTL2838UHIDIR rtl = 0 serial = 00000001 tuner = Rafael Micro R820T
Found Rafael Micro R820T tuner
driver = RTLSDR
hardware = RTLSDR
origin = https://github.com/pothosware/SoapyRTLSDR rtl = 0
Rx antennas:
RX
Setting Info:
setcount 1
direct_samp 2
Segmentation faultAnd another sanity check:
pi@macpi:~ $ sudo apt-get remove libsoapysdr-dev
…
Package ‘libsoapysdr-dev’ is not installed, so not removedpi@macpi:~ $ sudo apt-get install libsoapysdr0.6
…
libsoapysdr0.6 is already the newest version (0.6.1-4+b4).Now, I really wouldn’t object if sdrTest could find my RSPduo …
pi@macpi:~ $ lsusb
Bus 001 Device 005: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T
Bus 001 Device 006: ID 1df7:3020
That would be Device 006, but at this point I am not choosy. Having it work properly with anything would make my day (with apologies to Clint Eastwood)February 17, 2021 at 3:04 am #1711AnonymousYou need to get rid of all of the libraries not in /usr/local –
ldd ./sdrglut.x
ldd ./sdrTest
shows you are still loading the wrong libraries.
If you do –
sudo apt-get remove libsoapysdr-dev
sudo apt-get remove libsoapysdr0.6
and do the find-
sudo find . -iname *librtlsdr.so.*
to be sure that the
./usr/lib/arm-linux-gnueabihf/librtlsdr.so.0.6.0
./usr/lib/arm-linux-gnueabihf/librtlsdr.so.0are not there
cd ./Downloads/SdrGlut
rm *.x *.o */*.o */*/*.o
make -f makefileRaspbian -j 4
./sdrglut.x
should build sdrglut.
and
ldd ./sdrglut.x
should not show
libSoapySDR.so.0.6
February 17, 2021 at 3:16 am #1712AnonymousThe find should be –
sudo find /opt -name “*librtlsdr*”
The edit mode does not work in this forum.
February 17, 2021 at 3:23 am #1713AnonymousSecond try. make it –
sudo find / -name “*librtlsdr*”
The instruction above should get sdrglut working with your RSPDuo and if you rebuild sdrTest, it should also work.
You stick does not seem to have the direct_samp option – so you are stuck above 27MHZ-
Try your luck at fm
./sdrTest -fc 101.1e6 -f 101.5e6 -fm -gain 1 -device 1
February 17, 2021 at 4:17 am #1714alanmalkParticipantLooks like I went from bad to worse – sigh.
This will have to wait ’till morning – I’m not a night person.Not to worried about frequencies below 27MHz since my RPi is “only” being used as an travel trailer alarm-clock-radio-weather station streaming WIFI mp3 player;
and whatever else I can fool around with. Commercial FM is fine, but it has to be command line friendly to function with my Python code. In the past I
have been doing OK with rtl_fm and the cheap dongle but now am lusting after more stability and sensitivity.In the real world my RSPduo works just fine with Mac and Windows conventional software. My main interest is ham radio so I’m having a lot of fun with it.
Thanks again for keeping me on the straight and narrow.
Alan – KE5JLFebruary 17, 2021 at 3:08 pm #1715AnonymousYou are the first person that has not been able the get rid of the old soapy libraries.
This should work to correctly load sdrTest even with the old libraries there, but I cannot test it on the PI.
g++ -O2 -std=c++11 -Wno-deprecated -I/usr/local/include -o sdrTest ./src/sdrTest.cpp ./src/mThread.cpp ./src/cMalloc.cpp ./src/Clisten.cpp -L/usr/local/bin -lrtaudio -lliquid /usr/local/lib/libSoapySDR.so.0.8
The “/usr/local/lib/libSoapySDR.so.0.8” should be what ever libSoapySDR is called in /usr/local/lib/ – I think that it is “libSoapySDR.so.0.8”.
February 17, 2021 at 5:21 pm #1717alanmalkParticipantYou are the first person that has not been able the get rid of the old soapy libraries.
Unfortunately this seems to be true.
Doing the “find” before and after the “apt-get remove(s) …” shows that nothing has changed.
pi@macpi:/usr/lib/arm-linux-gnueabihf $ ls -l librtl*
-rw-r–r– 1 root root 65246 Feb 11 2019 librtlsdr.a
lrwxrwxrwx 1 root root 14 Feb 11 2019 librtlsdr.so -> librtlsdr.so.0
lrwxrwxrwx 1 root root 18 Feb 11 2019 librtlsdr.so.0 -> librtlsdr.so.0.6.0
-rw-r–r– 1 root root 51492 Feb 11 2019 librtlsdr.so.0.6.0Oh so tempting to abuse “sudo rm …”
But I’ll move on to your next suggestion and see if that works.February 17, 2021 at 5:34 pm #1718alanmalkParticipantThis should work to correctly load sdrTest even with the old libraries there, but I cannot test it on the PI.
Sigh…
pi@macpi:~/Downloads/SdrGlut/sdrTest $ g++ -O2 -std=c++11 -Wno-deprecated -I/usr/local/include -o sdrTest ./src/sdrTest.cpp ./src/mThread.cpp ./src/cMalloc.cpp ./src/Clisten.cpp -L/usr/local/bin -lrtaudio -lliquid /usr/local/lib/libSoapySDR.so.0.8
/usr/bin/ld: /tmp/ccw4FIcx.o: undefined reference to symbol ‘pthread_create@@GLIBC_2.4’
/usr/bin/ld: //lib/arm-linux-gnueabihf/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit statusWith my limited knowledge I couldn’t even begin to guess what might be needed to fix this error.
With nothing to loose at this point, I think I will use the wrecking ball of “sudo rm …”.
What could go wrong!!! (?)February 17, 2021 at 6:23 pm #1719alanmalkParticipantto be sure that the
./usr/lib/arm-linux-gnueabihf/librtlsdr.so.0.6.0
./usr/lib/arm-linux-gnueabihf/librtlsdr.so.0
are not thereUsed the big hammer (rm …) and (drum roll, please) ==> JOY, at least partially.
One slight problem remains – no audio – but at least I can see the light at the end of the tunnel.pi@macpi:~/Downloads/SdrGlut/sdrTest $ ./sdrTest -fc 101.1e6 -f 101.5e6 -fm -gain 1 -device 1
Found Rafael Micro R820T tuner
Number of Devices Found: 5
SDR device = 0 label = Generic RTL2832U OEM :: 00000001
SDR device = 1 label = SDRplay Dev0 RSPduo 1806037A32 – Single Tuner
SDR device = 2 label = SDRplay Dev1 RSPduo 1806037A32 – Dual Tuner
SDR device = 3 label = SDRplay Dev2 RSPduo 1806037A32 – Master
SDR device = 4 label = SDRplay Dev3 RSPduo 1806037A32 – Master (RSPduo sample rate=8Mhz)device = 1 selected
driver = sdrplay label = SDRplay Dev0 RSPduo 1806037A32 – Single Tuner rspduo_mode = 1[INFO] devIdx: 0
[INFO] hwVer: 3
[INFO] rspDuoMode: 1
[INFO] tuner: 1
[INFO] rspDuoSampleFreq: 0.000000
driver = SDRplay
hardware = 1806037A32 – Single Tuner
sdrplay_api_api_version = 3.070000 sdrplay_api_hw_version = 3Rx antennas:
Tuner 1 50 ohm
Tuner 1 Hi-Z
Tuner 2 50 ohmSetting Info:
key rfgain_sel value 4 read 4 type 3 min 0 max 0 step 1.17877e-310
key iqcorr_ctrl value true read true type 0 min 0 max 0 step 1.09123e+265
key agc_setpoint value -30 read -30 type 1 min -60 max 0 step 0
key extref_ctrl value true read false type 0 min 0 max 0 step 1.15312e-271
key biasT_ctrl value true read false type 0 min 0 max 0 step 4.97896e-313
key rfnotch_ctrl value true read false type 0 min 0 max 0 step 1.09123e+265
key dabnotch_ctrl value true read false type 0 min 0 max 0 step 1.17877e-310Gain range RX min 0 max 48
FrequencyRange min 1000 max 2e+09Bandwidth MHZ 0.20 0.30 0.60 1.54 5.00 6.00 7.00 8.00
SampleRates MHZ 0.06 0.10 0.12 0.19 0.25 0.38 0.50 0.77 1.00 2.00 2.05 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00
Gains:
0 IFGR range max 59 min 20
1 RFGR range max 9 min 0rx->samplerate 2000000
[INFO] Using format CF32.
getGainMode: 1
hasFrequencyCorrection: 1Audio device Count 1 default output device 0 audiodevice 0
audio device = 0 : output channels = 2 Device Name = PulseAudio sampleRates = 8000 16000 22050 32000 44100 48000 96000
audio device = 0 : input channels = 2 Device Name = PulseAudio sampleRates = 8000 16000 22050 32000 44100 48000 96000SoapySDR Library
Lib Version: v0.8.0-g351896d3
API Version: v0.8.0
ABI Version: v0.8
Install root: /usr/local
Search path: /usr/local/lib/SoapySDR/modules0.8
Module found: /usr/local/lib/SoapySDR/modules0.8/librtlsdrSupport.so
Module found: /usr/local/lib/SoapySDR/modules0.8/libsdrPlaySupport.sorate 2000000.000000 rx->size 100000
Start playing<to be continued in the next post>
February 17, 2021 at 7:10 pm #1721alanmalkParticipantInvestigating the missing audio:
Playing around with sdrTest parameters at random:
Changed the device to “4”.
Changed the -fc nn.n to equal -f nn.nBETTER!
Hearing my intended commercial FM station.
Audio is sounding poor – buffer underruns? Skipping, dropouts and repeats.
But it’s audio!Could you provide a pointer to the various parameters that might be helpful?
Thanks!
AlanFebruary 17, 2021 at 8:57 pm #1722AnonymousYou have managed to have every problem that there is with the PI.
Last one hopefully with the sound –
Install aloft-conf –
sudo apt-get install alsoft-conf
and run it and –
sudo alsoft-conf
and disabling all of the backends except for “ALSA” – that usually get rid of the distortion in the audio
February 17, 2021 at 11:07 pm #1723alanmalkParticipantYou have managed to have every problem that there is with the PI.
If everything just worked – well, that wouldn’t be much of a challenge. Like using my Mac…
I was hoping you can point me towards some instructions for sdrTest. Specifically,
what some of the parameters control. For example, I see -fc and -f but really
don’t understand the difference. I observe they are close in frequency but to say
what the 400000hz difference means would be a total guess on my part. Would also
like to control the sample rate, the gain in db, etc.And alsoft-conf is a possibility but will have to research how it interacts with my
current audio board (a little class D amp with an I2S interface.) As I said earlier,
“what could possibly go wrong” !!! 🙂February 18, 2021 at 1:54 am #1725AnonymousIf you look into sdrTest – main you can see the current list –
A quick summary of the options-
-debug – turn on debug print out
-am – set mode to am
-fm – set mode of fm
-nbfm – set mode to narrow band fm
-usb – set mode to upper sideband
-lsd – set mode to lower sideband
-gain 1.0 – set audio gain to maximum gain
-fc 1e6 – set center frequency to 1 MHZ
-f 0.76e6 – set receive frequency to 760,000 HZ abs(f-fc) needs to less that 0.5*samplerate;-device 0 – select SDR device 0
-audiodevice 1 – select audio output device 1
-timeout 10 – play for 10 seconds then quit the program.
-samplerate 10e6 – set sample rate to 10 MHZ
-faudio 48000 – this is the default audio rate and you normally do not change it, expect when you are writing to a file
-antenna “Tuner 1 50 ohm”
In you case
Rx antennas:
Tuner 1 50 ohm
Tuner 1 Hi-Z
Tuner 2 50 ohm-set rfnotch_ctrl true – turn on the notch filter (i.e. kill AM and FM bands)
-set dabnotch_ctrl true – turn on the dabnotch filter (i.e. kill dab bands)
-set biasT_ctrl true – turn on voltage to power external antenna devicein you case the set options are, but I not sure what the rest of them are for –
Setting Info:
key rfgain_sel value 4 read 4 type 3 min 0 max 0 step 1.17877e-310
key iqcorr_ctrl value true read true type 0 min 0 max 0 step 1.09123e+265
key agc_setpoint value -30 read -30 type 1 min -60 max 0 step 0
key extref_ctrl value true read false type 0 min 0 max 0 step 1.15312e-271
key biasT_ctrl value true read false type 0 min 0 max 0 step 4.97896e-313
key rfnotch_ctrl value true read false type 0 min 0 max 0 step 1.09123e+265
key dabnotch_ctrl value true read false type 0 min 0 max 0 step 1.17877e-310-dumpbyminute – dumps I/Q files every minute
-file fileout – writes the audio output to file out
-PPM -0.380 – does not seem workWhat is missing is the control for the gains –
In you case –
Gain range RX min 0 max 48
Gains:
0 IFGR range max 59 min 20
1 RFGR range max 9 min 0It only another 20 lines of code, but I have not gotten around to it yet since the defaults usually work OK.
February 18, 2021 at 4:20 am #1726alanmalkParticipantBingo – Jackpot.
That did the trick. Playing with samplerate and abs(f-fc) has resulted in good sounding audio. Gain and faudio clearly have some influence also.
I could spend days tweaking but in a week we have to pack the trailer and hit the road for 3 months of camping. I’m very happy to have a better
sdr to connect to the magic alarm clock. I’ll be taking a directional FM antenna and with luck will be in radio heaven thanks to your generous
help.
Best Regards,
AlanFebruary 18, 2021 at 4:53 am #1727AnonymousHave Fun !
Bye.
Dale.
-
AuthorPosts
- You must be logged in to reply to this topic.