How to use my RSPduo w/ Rpi-3 & command line?

SDRPlay Independent Community Forum Forums General How to use my RSPduo w/ Rpi-3 & command line?

Tagged: 

  • This topic has 34 replies, 3 voices, and was last updated by .
Viewing 15 posts - 16 through 30 (of 35 total)
  • Author
    Posts
  • #1710
    alanmalk
    Participant

      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.0

      pi@macpi:/ $ sudo find . -name *rtlsdrSupport*
      ./usr/local/lib/SoapySDR/modules0.8/librtlsdrSupport.so
      ./usr/lib/arm-linux-gnueabihf/SoapySDR/modules0.6/librtlsdrSupport.so

      pi@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 fault

      And another sanity check:
      pi@macpi:~ $ sudo apt-get remove libsoapysdr-dev

      Package ‘libsoapysdr-dev’ is not installed, so not removed

      pi@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)

      #1711
      Anonymous

        You 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.0

        are 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

        #1712
        Anonymous

          The find should be –

          sudo find /opt -name “*librtlsdr*”

          The edit mode does not work in this forum.

          #1713
          Anonymous

            Second 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

            #1714
            alanmalk
            Participant

              Looks 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 – KE5JL

              #1715
              Anonymous

                You 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”.

                #1717
                alanmalk
                Participant

                  You 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.0

                  Oh so tempting to abuse “sudo rm …”
                  But I’ll move on to your next suggestion and see if that works.

                  #1718
                  alanmalk
                  Participant

                    This 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 status

                    With 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!!! (?)

                    #1719
                    alanmalk
                    Participant

                      to be sure that the
                      ./usr/lib/arm-linux-gnueabihf/librtlsdr.so.0.6.0
                      ./usr/lib/arm-linux-gnueabihf/librtlsdr.so.0
                      are not there

                      Used 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 = 3

                      Rx antennas:
                      Tuner 1 50 ohm
                      Tuner 1 Hi-Z
                      Tuner 2 50 ohm

                      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

                      Gain range RX min 0 max 48
                      FrequencyRange min 1000 max 2e+09

                      Bandwidth 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 0

                      rx->samplerate 2000000
                      [INFO] Using format CF32.
                      getGainMode: 1
                      hasFrequencyCorrection: 1

                      Audio 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 96000

                      SoapySDR 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.so

                      rate 2000000.000000 rx->size 100000
                      Start playing

                      <to be continued in the next post>

                      #1721
                      alanmalk
                      Participant

                        Investigating the missing audio:

                        Playing around with sdrTest parameters at random:
                        Changed the device to “4”.
                        Changed the -fc nn.n to equal -f nn.n

                        BETTER!
                        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!
                        Alan

                        #1722
                        Anonymous

                          You 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

                          #1723
                          alanmalk
                          Participant

                            You 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” !!! 🙂

                            #1725
                            Anonymous

                              If 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 device

                              in 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 work

                              What 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 0

                              It only another 20 lines of code, but I have not gotten around to it yet since the defaults usually work OK.

                              #1726
                              alanmalk
                              Participant

                                Bingo – 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,
                                Alan

                                #1727
                                Anonymous

                                  Have Fun !

                                  Bye.

                                  Dale.

                                Viewing 15 posts - 16 through 30 (of 35 total)
                                • You must be logged in to reply to this topic.