Giter Club home page Giter Club logo

soapyfcdpp's Introduction

SoapyFCDPP

Soapy SDR plugin FUNcube Dongle Pro+

https://github.com/pothosware/SoapyFCDPP/wiki

What is this thing?

This is a SoapySDR driver for the FUNcube dongle pro+. It has been tested it on Raspberry Pi 3 & Orange Pi Zero LTS, typically used for streaming IQ data to GQRX.

Unlike the gr-osmosdr it's doesn't depend on the gr-fcdproplus block but is standalone depending on libhidapi and ALSA. I believe this makes it a bit more approachable for hacking.

If you intend to use this as a remote front-end, remember to build on your target system, not your local machine!

Dependencies

  • SoapySDR
  • libasound2 (ALSA)
  • libhidapi
  • cmake or meson and ninja for building

Ubuntu / Debian

(if you don't already have SoapySDR installed from source)

sudo apt-get install libsoapysdr-dev soapysdr-tools

(other dependencies)

sudo apt-get install libhidapi-dev libasound2-dev

Build with cmake

Tested on Debian 10 with out-of-the-box SoapySDR and other dependencies.

# build
git clone https://github.com/pothosware/SoapyFCDPP.git
cd SoapyFCDPP
mkdir build; cd build
cmake ../
make && sudo make install
# Will put the driver in /usr/local/lib/SoapySDR/module0.6

Build with meson

Only tested with the latest SoapySDR / SoapyRemote from source.

# build
git clone https://github.com/pothosware/SoapyFCDPP.git
cd SoapyFCDPP/SoapyFCDPP
meson build && cd build
ninja install
# Will put the driver in /usr/local/lib/SoapySDR/modules0.7

Testing

This driver should now appear in the driver list as fcdpp:

SoapySDRUtil --info

Local use

You can access the driver directly from a SoapySDR client, a typical device string is:

driver=fcdpp,period=19200

where period is optional but specifies the sample count per ALSA period (defaults to sample rate / 4 => 250msec latency). Adjust if you want lower latency at the cost of higher context switch rates (eg: an RPi3 can tolerate down to 2048 samples, however an OrangePi Zero LTS may kernel panic / become unstable below 9600, hence the default!)

Remote use

You can also use SoapyRemote (or another SoapySDR remoting solution) to operate this driver as a headless front-end.

On the remote system:

SoapySDRServer --bind="0.0.0.0:1234"

On the local system (eg: GQRX SoapySDR client):

  • Device string in GQRX: soapy=0,remote=hostname.local:1234,remote:driver=fcdpp
  • Input rate: 192000 (if you have FCD Pro+, otherwise 96000)
  • All other settings default (no decimation, zero bandwidth, LO frequency)

Permissions

To access an FCD USB device for tuning/gain control etc. without being root you need this:

# Udev rules for the Funcube Dongle Pro (0xfb56) & Pro+ (0xfb31)
# Put this in:
# /etc/udev/rules.d/81-funcube.rules

# Udev rule for the Funcube Dongle to be used with libusb (NB: SYMLINK is not necessary but convenient)
SUBSYSTEMS=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="fb56", GROUP="audio", MODE="0666", SYMLINK+="usbfcd1"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="fb31", GROUP="audio", MODE="0666", SYMLINK+="usbfcd2"

NB: If you have GNU radio support for Funcube Dongles installed you may have what you need in /lib/udev/rules.d/60-gr-fcdproplus.rules or /lib/udev/rules.d/60-libgnuradio-fcd*.

License

Boost Software License 1.0 (BSL-1.0)

soapyfcdpp's People

Contributors

ast avatar guruofquality avatar ncorgan avatar phlash avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

soapyfcdpp's Issues

SoapyFCDPP under CubicSDR and SDR++

Hello,
I am trying to get my FunCube Dongle Pro+ working under SDR++ using your driver. I can get it working my FCD working under CubicSDR perfectly with your driver, however, when I first tried it the audio was "choppy" exactly the same way it is under SDR++. Again, using your driver. When check the driver settings under CubicSDR there is an additional "Run-time Setting". I don't know what this is for because there is no label but the lower the number the better. When I enter 192 into this field (the lowest I can enter, BTW) the audio comes out perfectly.

I am trying to find out where to enter in such a run-time parameter using SDR++. I have tried asking the author of SDR++ this question and you can see his response here:
AlexandreRouma/SDRPlusPlus#508

screenshot

Is there another way to enter this parameter to get SDR++ working properly?

Thank you for your time...

ppm not working

Hi,
Managed to get the Funcube Pro+ working under OpenwebRX. Thanks for that!
But....the ppm-value has no effect whatsoever.
"Funcube": {
"name": "Funcube Pro+",
"type": "fcdpp",
"ppm": 8,
"rf_gain": 0,
"samp_rate": 192000,
"profiles": {
This is a universal parameter, so....
Who can help?

CubicSDR 0.2.5: LNA and Mixer Gain can't be changed

I'm trying the FCDPP Soapy support with CubicSDR 0.2.5.

On the GUI we have 3 gain settings: IF, LNA and Mixer corresponding to what SoapyUtil displays about this SDR.

$ SoapySDRUtil --probe

######################################################

Soapy SDR -- the SDR abstraction library

######################################################

Probe device
[INFO] Found device: 0005:0004:02
[DEBUG] getSettingInfo
[DEBUG] getFullDuplex
[DEBUG] hasGainMode
[INFO] listAntennas
[DEBUG] getGainRange
[DEBUG] getGainRange
[DEBUG] getGainRange
[DEBUG] getGainRange
[DEBUG] getGainRange
[DEBUG] getGainRange
[INFO] listFrequencies
[INFO] getFrequencyRange
[INFO] getBandwidth
[INFO] listFrequencies
[INFO] getFrequencyRange
[INFO] getFrequencyArgsInfo
[INFO] listSampleRates
[INFO] listBandwidths


-- Device identification

driver=FCDPP
hardware=FCDPP


-- Peripheral summary

Channels: 1 Rx, 0 Tx
Timestamps: NO


-- RX Channel 0

Full-duplex: NO
Supports AGC: NO
Stream formats: CS16, CF32
Native format: CS32 [full-scale=1.67772e+07]
Antennas: RX
Full gain range: [0, 61] dB
LNA gain range: [0, 1, 1] dB
Mixer gain range: [0, 1, 1] dB
IF gain range: [0, 59, 1] dB
Full freq range: [0.15, 240], [420, 1900] MHz
RF freq range: [0.15, 240], [420, 1900] MHz
Sample rates: 0.192 MSps

No issue with If Gain,

But the 2 others stays always to 0 even if I move the selector, see screenshot.

cubicsdr fcpp
cubicsdr fcpp 2

I don't know if it's a CubicSDR issue or a FCDPP Soapy driver issue.

As LNA and Mixer can only be enabled or disabled, I wonder if it could be implemented as switch options like bias-tee on some other SDRs instead of gain settings.

"Error opening PCM device not found" when used remotely

Can see the Funcube Dongle is detected from CubicSDR devices list.
When I try to start streaming from CubicSDR, SoapySDRServer dies with:

SoapyServerListener::accept([::ffff:192.168.1.77]:45034)
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM not found
Error opening PCM device not found

Console output from CubicSDR:

[INFO] setup stream
Stream setup failed, stream is null. std::exception
SDR Thread stream init error.
[ERROR] SoapyLogAcceptor::handlerLoop(tcp://192.168.1.3:55132) FAIL: SoapyRPCUnpacker::recv(header) FAIL: 

Server version: 0.5.2-unknown

# SoapySDRUtil --probe
######################################################
##     Soapy SDR -- the SDR abstraction library     ##
######################################################

Probe device 
[ERROR] avahi_service_browser_new() failed: Bad state
[INFO] makeFCDPP
[INFO] listAntennas
[INFO] listFrequencies
[INFO] getFrequencyRange
[INFO] getBandwidth
[INFO] listFrequencies
[INFO] getFrequencyRange
[INFO] getFrequencyArgsInfo
[INFO] listSampleRates
[INFO] listBandwidths

----------------------------------------------------
-- Device identification
----------------------------------------------------
  driver=FCDPP
  hardware=FCD

----------------------------------------------------
-- Peripheral summary
----------------------------------------------------
  Channels: 1 Rx, 0 Tx
  Timestamps: NO
  Other Settings:
     * period [key=period, default=0, type=int, range=[96, 48000, 960]]

----------------------------------------------------
-- RX Channel 0
----------------------------------------------------
  Full-duplex: NO
  Supports AGC: NO
  Stream formats: CS16, CF32
  Native format: CS16 [full-scale=32767]
  Full gain range: [0, 97] dB
    LNA gain range: [-5, 30, 2.5] dB
    Mixer gain range: [4, 12, 8] dB
    IF gain range: [3, 57, 1] dB
  Full freq range: [0.15, 240], [420, 1900] MHz
    RF freq range: [0.15, 240], [420, 1900] MHz
  Sample rates: 0.096 MSps

libsoapdysdr 0.8.1

Build error

I'm using utuntu 18.04

$ meson build

The Meson build system Version: 0.45.1 Source dir: /home/nicolas/Applis/SDR/SoapyFCDPP/SoapyFCDPP Build dir: /home/nicolas/Applis/SDR/SoapyFCDPP/SoapyFCDPP/build Build type: native build Project name: SoapyFCDPP Native C compiler: cc (gcc 7.3.0 "cc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0") Native C++ compiler: c++ (gcc 7.3.0 "c++ (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0") Build machine cpu family: x86_64 Build machine cpu: x86_64 Found pkg-config: /usr/bin/pkg-config (0.29.1) Native dependency SoapySDR found: YES 0.7.0 Native dependency hidapi-libusb found: YES 0.8.0-rc1 Native dependency alsa found: YES 1.1.3 Build targets in project: 1 Found ninja-1.8.2 at /usr/bin/ninja

But Build fails:

$ ninja -C build

ninja: Entering directory build'
[3/4] Compiling C++ object 'soapyfcdpp@sha/SoapyFCDPP.cpp.o'.
FAILED: soapyfcdpp@sha/SoapyFCDPP.cpp.o
c++ -Isoapyfcdpp@sha -I. -I.. -I/usr/local/include -I/usr/include/alsa -I/usr/include/hidapi -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++11 -O0 -g -fPIC -MD -MQ 'soapyfcdpp@sha/SoapyFCDPP.cpp.o' -MF 'soapyfcdpp@sha/SoapyFCDPP.cpp.o.d' -o 'soapyfcdpp@sha/SoapyFCDPP.cpp.o' -c ../SoapyFCDPP.cpp
In file included from ../SoapyFCDPP.cpp:1:0:
../SoapyFCDPP.hpp: In constructor ‘SoapyFCDPP::SoapyFCDPP(const string&)’:
../SoapyFCDPP.hpp:39:12: warning: ‘SoapyFCDPP::d_frequency’ will be initialized after [-Wreorder]
double d_frequency;
^~~~~~~~~~~
../SoapyFCDPP.hpp:38:18: warning: ‘const double SoapyFCDPP::d_sample_rate’ [-Wreorder]
const double d_sample_rate;
^~~~~~~~~~~~~
../SoapyFCDPP.cpp:7:1: warning: when initialized here [-Wreorder]
SoapyFCDPP::SoapyFCDPP(const std::string &path) :
^~~~~~~~~~
../SoapyFCDPP.cpp: In member function ‘virtual int SoapyFCDPP::readStream(SoapySDR::Stream*, void* const*, size_t, int&, long long int&, long int)’:
../SoapyFCDPP.cpp:167:86: error: no matching function for call to ‘min(uint32_t&, const size_t&)’
frames = snd_pcm_readi(d_pcm_handle, &d_buff[0], std::min(d_period_size, numElems));
^
In file included from /usr/include/c++/7/vector:60:0,
from /usr/local/include/SoapySDR/Types.hpp:14,
from /usr/local/include/SoapySDR/Device.hpp:14,
from ../SoapyFCDPP.hpp:12,
from ../SoapyFCDPP.cpp:1:
/usr/include/c++/7/bits/stl_algobase.h:195:5: note: candidate: template const _Tp& std::min(const _Tp&, const _Tp&)
min(const _Tp& __a, const _Tp& __b)
^~~
/usr/include/c++/7/bits/stl_algobase.h:195:5: note: template argument deduction/substitution failed:
../SoapyFCDPP.cpp:167:86: note: deduced conflicting types for parameter ‘const _Tp’ (‘unsigned int’ and ‘size_t {aka long unsigned int}’)
frames = snd_pcm_readi(d_pcm_handle, &d_buff[0], std::min(d_period_size, numElems));
^
In file included from /usr/include/c++/7/vector:60:0,
from /usr/local/include/SoapySDR/Types.hpp:14,
from /usr/local/include/SoapySDR/Device.hpp:14,
from ../SoapyFCDPP.hpp:12,
from ../SoapyFCDPP.cpp:1:
/usr/include/c++/7/bits/stl_algobase.h:243:5: note: candidate: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
^~~
/usr/include/c++/7/bits/stl_algobase.h:243:5: note: template argument deduction/substitution failed:
../SoapyFCDPP.cpp:167:86: note: deduced conflicting types for parameter ‘const _Tp’ (‘unsigned int’ and ‘size_t {aka long unsigned int}’)
frames = snd_pcm_readi(d_pcm_handle, &d_buff[0], std::min(d_period_size, numElems));
^
In file included from /usr/include/c++/7/algorithm:62:0,
from ../SoapyFCDPP.cpp:4:
/usr/include/c++/7/bits/stl_algo.h:3450:5: note: candidate: template _Tp std::min(std::initializer_list<_Tp>)
min(initializer_list<_Tp> __l)
^~~
/usr/include/c++/7/bits/stl_algo.h:3450:5: note: template argument deduction/substitution failed:
../SoapyFCDPP.cpp:167:86: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘unsigned int’
frames = snd_pcm_readi(d_pcm_handle, &d_buff[0], std::min(d_period_size, numElems));
^
In file included from /usr/include/c++/7/algorithm:62:0,
from ../SoapyFCDPP.cpp:4:
/usr/include/c++/7/bits/stl_algo.h:3456:5: note: candidate: template<class _Tp, class _Compare> _Tp std::min(std::initializer_list<_Tp>, _Compare)
min(initializer_list<_Tp> __l, _Compare __comp)
^~~
/usr/include/c++/7/bits/stl_algo.h:3456:5: note: template argument deduction/substitution failed:
../SoapyFCDPP.cpp:167:86: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘unsigned int’
frames = snd_pcm_readi(d_pcm_handle, &d_buff[0], std::min(d_period_size, numElems));
^
../SoapyFCDPP.cpp: In member function ‘virtual void SoapyFCDPP::setGain(int, size_t, const string&, double)’:
../SoapyFCDPP.cpp:261:21: warning: suggest parentheses around comparison in operand of ‘!=’ [-Wparentheses]
} else if (name == "IF" != d_if_gain != value){
~~~~~^~~~~~~
../SoapyFCDPP.cpp:261:29: warning: suggest parentheses around comparison in operand of ‘!=’ [-Wparentheses]
} else if (name == "IF" != d_if_gain != value){
~~~~~~~~~~~~~^~~~~~~~~~~~
ninja: build stopped: subcommand failed.`

License file for SoapyFCDPP project

@ast Whats the license for SoapyFCDPP? Can you check in some kind of license file for it. Any standard open source license is probably fine. I need it so I can upload/package this in the PPA, probably needed for debian and others too. Thx

Compile failed with SoapySDR 0.8.0

Meson compile failed with this error:
3/5] Compiling C++ object 'soapyfcdpp@sha/SoapyFCDPP.cpp.o'.
FAILED: soapyfcdpp@sha/SoapyFCDPP.cpp.o
c++ -Isoapyfcdpp@sha -I. -I.. -I/usr/local/include -I/usr/include/alsa -I/usr/include/hidapi -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++11 -g -fPIC -ggdb -mcpu=cortex-a53 -mfpu=neon-fp-armv8 -mfloat-abi=hard -funsafe-math-optimizations -MD -MQ 'soapyfcdpp@sha/SoapyFCDPP.cpp.o' -MF 'soapyfcdpp@sha/SoapyFCDPP.cpp.o.d' -o 'soapyfcdpp@sha/SoapyFCDPP.cpp.o' -c ../SoapyFCDPP.cpp
../SoapyFCDPP.cpp:159:6: error: no declaration matches ‘void SoapyFCDPP::convertCS16toCF32(void*, void*, size_t)’
void SoapyFCDPP::convertCS16toCF32(void dst, void src, size_t samples)
^~~~~~~~~~
../SoapyFCDPP.cpp:159:6: note: no functions named ‘void SoapyFCDPP::convertCS16toCF32(void
, void
, size_t)’
In file included from ../SoapyFCDPP.cpp:5:
../SoapyFCDPP.hpp:29:7: note: ‘class SoapyFCDPP’ defined here
class SoapyFCDPP : public SoapySDR::Device
^~~~~~~~~~
ninja: build stopped: subcommand failed.

Also tried with cmake, with error:

[ 20%] Building CXX object CMakeFiles/FCDPPSupport.dir/SoapyFCDPP/SoapyFCDPP.cpp.o
/usr/src/SoapyFCDPP/SoapyFCDPP/SoapyFCDPP.cpp:159:6: error: no declaration matches ‘void SoapyFCDPP::convertCS16toCF32(void*, void*, size_t)’
void SoapyFCDPP::convertCS16toCF32(void dst, void src, size_t samples)
^~~~~~~~~~
/usr/src/SoapyFCDPP/SoapyFCDPP/SoapyFCDPP.cpp:159:6: note: no functions named ‘void SoapyFCDPP::convertCS16toCF32(void
, void
, size_t)’
In file included from /usr/src/SoapyFCDPP/SoapyFCDPP/SoapyFCDPP.cpp:5:
/usr/src/SoapyFCDPP/SoapyFCDPP/SoapyFCDPP.hpp:29:7: note: ‘class SoapyFCDPP’ defined here
class SoapyFCDPP : public SoapySDR::Device
^~~~~~~~~~
/usr/src/SoapyFCDPP/SoapyFCDPP/SoapyFCDPP.cpp: In member function ‘virtual int SoapyFCDPP::readStream(SoapySDR::Stream*, void* const*, size_t, int&, long long int&, long int)’:
/usr/src/SoapyFCDPP/SoapyFCDPP/SoapyFCDPP.cpp:216:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
if(n_err >= 0) {
^~
/usr/src/SoapyFCDPP/SoapyFCDPP/SoapyFCDPP.cpp:228:9: note: here
case SND_PCM_STATE_XRUN:
^~~~
make[2]: *** [CMakeFiles/FCDPPSupport.dir/build.make:63: CMakeFiles/FCDPPSupport.dir/SoapyFCDPP/SoapyFCDPP.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/FCDPPSupport.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

Using SoapySDR version 0.8.0:

root@sdr:/usr/src/SoapyFCDPP/build# SoapySDRUtil --info
######################################################

Soapy SDR -- the SDR abstraction 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/libremoteSupport.so (0.6.0-c09b2f1)
Module found: /usr/local/lib/SoapySDR/modules0.8/libsdrPlaySupport.so (0.3.0-208f95d)
Available factories... remote, sdrplay
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]

In a Raspberry PI 4 running Raspbian 10.7. Can help me about this error ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.