Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
f4exb committed Feb 24, 2016
2 parents da26fa3 + aa15e95 commit 3bfb245
Show file tree
Hide file tree
Showing 47 changed files with 2,743 additions and 347 deletions.
34 changes: 33 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
cmake_minimum_required(VERSION 3.0.2)
cmake_policy(SET CMP0043 OLD)

# use, i.e. don't skip the full RPATH for the build tree
set(CMAKE_SKIP_BUILD_RPATH FALSE)

# when building, don't use the install RPATH already
# (but later on when installing)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)

SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")

# add the automatically determined parts of the RPATH
# which point to directories outside the build tree to the install RPATH
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

option(V4L-RTL "Use Linux Kernel RTL-SDR Source." OFF)
option(V4L-MSI "Use Linux Kernel MSI2500 Source." OFF)
option(BUILD_TYPE "Build type (RELEASE, RELEASEWITHDBGINFO, DEBUG" RELEASE)
Expand Down Expand Up @@ -126,6 +139,7 @@ set(sdrbase_SOURCES
sdrbase/settings/preset.cpp
sdrbase/settings/mainsettings.cpp

sdrbase/util/CRC64.cpp
sdrbase/util/db.cpp
sdrbase/util/message.cpp
sdrbase/util/messagequeue.cpp
Expand Down Expand Up @@ -208,7 +222,8 @@ set(sdrbase_HEADERS
include/settings/preset.h
include/settings/mainsettings.h

include/util/db.h
include/util/CRC64.h
include/util/db.h
include/util/export.h
include/util/message.h
include/util/messagequeue.h
Expand Down Expand Up @@ -355,3 +370,20 @@ if(LIBUSB_FOUND AND UNIX)
add_subdirectory(fcdhid)
add_subdirectory(fcdlib)
endif(LIBUSB_FOUND AND UNIX)

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

#install targets
install(TARGETS sdrangel DESTINATION bin)
install(TARGETS sdrbase DESTINATION lib)

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

# uninstall target
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)

add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
34 changes: 28 additions & 6 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ If you use your own location for gr.osmocom install directory you need to specif

`-DGNURADIO_OSMOSDR_LIBRARIES=/opt/install/gr-osmosdr/lib/libgnuradio-osmosdr.so -DGNURADIO_OSMOSDR_INCLUDE_DIRS=/opt/install/gr-osmosdr/include`

<h3>v4l-\*</h3>
<h3>v4l-*</h3>

Use `cmake ../ -DV4L-RTL=ON` to build the Linux kernel driver for RTL-SDR (Experimental). Needs a recent kernel and libv4l2. Will need extra work to support SDRPlay. Needs `cp KERNEL_SOURCE/include/linux/compiler.h /usr/include/linux/` and `cp KERNEL_SOURCE/include/uapi/linux/videodev2.h /usr/include/uapi/linux/` and package `libv4l-dev`.

Expand Down Expand Up @@ -99,6 +99,22 @@ If you use your own location for librtlsdr install directory you need to specify

`-DLIBRTLSDR_LIBRARIES=/opt/install/librtlsdr/lib/librtlsdr.so -DLIBRTLSDR_INCLUDE_DIR=/opt/install/librtlsdr/include`

<h1>Plugins for special sample sources</h1>

<h2>File input</h2>

The file input plugin allows the playback of a recorded IQ file. Such a file is obtained using the recording feature. Press F7 to start recording and F8 to stop. The file has a fixed name `test.sdriq` created in the current directory.

Note that this plugin does not require any of the hardware support libraries nor the libusb library. It is alwasys available in the list of devices as `FileSource[0]` even if no physical device is connected.

<h2>SDRdaemon input</h2>

This is the client side of the SDRdaemon server. See the [SDRdaemon](https://github.com/f4exb/sdrdaemon) project in this Github repository. You must specify the address and UDP port to which the server connects and samples will flow into the SDRangel application (default is `127.0.0.1`port `9090`). It uses the meta data to retrieve the sample flow characteristics such as sample rate and receiveng center frequency.

There is an automated skew rate compensation in place. During rate readjustemnt streaming can be suspended or signal glitches can occur for about one second.

Note that this plugin does not require any of the hardware support libraries nor the libusb library. It is alwasys available in the list of devices as `SDRdaemon[0]` even if no physical device is connected.

<h1>Software build</h1>

<h2>Ubuntu</h2>
Expand All @@ -118,7 +134,7 @@ Install cmake version 3:

<h3>With newer versions just do:</h3>

- `sudo apt-get install cmake g++ pkg-config libfftw3-dev libqt5multimedia5-plugins qtmultimedia5-dev qttools5-dev qttools5-dev-tools libqt5opengl5-dev qtbase5-dev libusb-1.0 librtlsdr-dev libboost-all-dev libasound2-dev pulseaudio`
- `sudo apt-get install cmake g++ pkg-config libfftw3-dev libqt5multimedia5-plugins qtmultimedia5-dev qttools5-dev qttools5-dev-tools libqt5opengl5-dev qtbase5-dev libusb-1.0 librtlsdr-dev libboost-all-dev libasound2-dev pulseaudio liblz4-dev`
- `mkdir build && cd build && cmake ../ && make`

`librtlsdr-dev` is in the `universe` repo. (utopic 14.10 amd64.)
Expand All @@ -145,7 +161,7 @@ For Debian Jessie or Stretch:

This has been tested with the bleeding edge "Thumbleweed" distribution:

`sudo zypper install cmake fftw3-devel gcc-c++ libusb-1_0-devel libqt5-qtbase-devel libQt5OpenGL-devel libqt5-qtmultimedia-devel libqt5-qttools-devel libQt5Network-devel libQt5Widgets-devel boost-devel alsa-devel pulseaudio`
`sudo zypper install cmake fftw3-devel gcc-c++ libusb-1_0-devel libqt5-qtbase-devel libQt5OpenGL-devel libqt5-qtmultimedia-devel libqt5-qttools-devel libQt5Network-devel libQt5Widgets-devel boost-devel alsa-devel pulseaudio liblz4 liblz4-devel`

Then you should be all set to build the software with `cmake` and `make` as discussed earlier.

Expand All @@ -158,7 +174,7 @@ This has been tested with Fedora 23 and 22:

- `sudo dnf groupinstall "C Development Tools and Libraries"`
- `sudo dnf install mesa-libGL-devel`
- `sudo dnf install cmake gcc-c++ pkgconfig fftw-devel libusb-devel qt5-qtbase-devel qt5-qtmultimedia-devel qt5-qttools-devel boost-devel pulseaudio alsa-lib-devel`
- `sudo dnf install cmake gcc-c++ pkgconfig fftw-devel libusb-devel qt5-qtbase-devel qt5-qtmultimedia-devel qt5-qttools-devel boost-devel pulseaudio alsa-lib-devel liblz4 liblz4-devel`

Then you should be all set to build the software with `cmake` and `make` as discussed earlier.

Expand All @@ -168,13 +184,19 @@ Then you should be all set to build the software with `cmake` and `make` as disc

Tested with the 15.09 version with LXDE desktop (community supported). The exact desktop environment should not matter anyway. Since Manjaro is Arch Linux based prerequisites should be similar for Arch and all derivatives.

`sudo pacman -S cmake pkg-config fftw qt5-multimedia qt5-tools qt5-base libusb boost boost-libs pulseaudio`
`sudo pacman -S cmake pkg-config fftw qt5-multimedia qt5-tools qt5-base libusb boost boost-libs pulseaudio lz4`

Then you should be all set to build the software with `cmake` and `make` as discussed earlier.

- Note1 for udev rules: the same as for openSUSE and Fedora applies.
- Note2: A package has been created in the AUR (thanks Mikos!), see: [sdrangel-git](https://aur.archlinux.org/packages/sdrangel-git). It is based on the `205fee6` commit of 8th December 2015.

<h1>Software installation</h1>

Simply do `make install` or `sudo make install` depending on you user rights on the target installation directory. On most systems the default installation directory is `/usr/local` a custom installation directory can be specified with the `-DCMAKE_INSTALL_PREFIX=...` option on the `cmake` command line as usual with cmake.

You can uninstall the software with `make uninstall` or `sudo make uninstall` from the build directory (it needs the `install_manifest.txt` file in the same directory and is automatically created by the `make install`command). Note that this will not remove the possible empty directories.

<h1>Known Issues</h1>

- The message queuing model supports a n:1 connection to an object (on its input queue) and a 1:1 connection from an object (on its output queue). Assuming a different model can cause insidious disruptions.
Expand Down Expand Up @@ -202,7 +224,7 @@ See the v1.0.1 first official relase [release notes](https://github.com/f4exb/sd
- Headless mode based on a saved configuration in above human readable form
- Allow arbitrary sample rate for channelizers and demodulators (not multiple of 48 kHz). Prerequisite for polyphase channelizer
- Implement polyphase channelizer
- Level calibration
- Level calibration
- Even more demods ...

<h1>Developper's notes</h1>
Expand Down
27 changes: 27 additions & 0 deletions cmake/Modules/FindLZ4.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
INCLUDE(FindPkgConfig)
PKG_CHECK_MODULES(PC_LZ4 "liblz4")

FIND_PATH(LZ4_INCLUDE_DIRS
NAMES lz4.h
HINTS ${PC_LZ4_INCLUDE_DIR}
${CMAKE_INSTALL_PREFIX}/include
${LIBLZ4_INSTALL_PREFIX}/include
PATHS
/usr/local/include
/usr/include
)

FIND_LIBRARY(LZ4_LIBRARIES
NAMES lz4 liblz4
HINTS ${PC_LZ4_LIBDIR}
${CMAKE_INSTALL_PREFIX}/lib
${CMAKE_INSTALL_PREFIX}/lib64
PATHS
${LZ4_INCLUDE_DIRS}/../lib
/usr/local/lib
/usr/lib
)

INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZ4 DEFAULT_MSG LZ4_LIBRARIES LZ4_INCLUDE_DIRS)
MARK_AS_ADVANCED(LZ4_LIBRARIES LZ4_INCLUDE_DIRS)
21 changes: 21 additions & 0 deletions cmake_uninstall.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")

file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")
foreach(file ${files})
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
exec_program(
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
)
if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
endif(NOT "${rm_retval}" STREQUAL 0)
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
endforeach(file)
2 changes: 2 additions & 0 deletions fcdhid/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ add_library(fcdhid SHARED
target_link_libraries(fcdhid
${LIBUSB_LIBRARIES}
)

install(TARGETS fcdhid DESTINATION lib)
2 changes: 2 additions & 0 deletions fcdlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ add_library(fcdlib SHARED
)

target_link_libraries(fcdlib)

install(TARGETS fcdlib DESTINATION lib)
38 changes: 38 additions & 0 deletions include/util/CRC64.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2016 Edouard Griffiths, F4EXB //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation as version 3 of the License, or //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License V3 for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////

#ifndef INCLUDE_CRC64_H_
#define INCLUDE_CRC64_H_

#include <stdint.h>

class CRC64
{
public:
CRC64();
~CRC64();
uint64_t calculate_crc(uint8_t *stream, int length);

private:
void build_crc_table();

uint64_t m_crcTable[256];
static const uint64_t m_poly;
};



#endif /* INCLUDE_CRC64_H_ */
4 changes: 3 additions & 1 deletion plugins/channel/am/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,6 @@ target_link_libraries(demodam
sdrbase
)

qt5_use_modules(demodam Core Widgets OpenGL Multimedia)
qt5_use_modules(demodam Core Widgets OpenGL Multimedia)

install(TARGETS demodam DESTINATION lib/plugins/channel)
4 changes: 3 additions & 1 deletion plugins/channel/bfm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,6 @@ target_link_libraries(demodbfm
sdrbase
)

qt5_use_modules(demodbfm Core Widgets OpenGL Multimedia)
qt5_use_modules(demodbfm Core Widgets OpenGL Multimedia)

install(TARGETS demodbfm DESTINATION lib/plugins/channel)
2 changes: 2 additions & 0 deletions plugins/channel/chanalyzer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,5 @@ target_link_libraries(chanalyzer
)

qt5_use_modules(chanalyzer Core Widgets OpenGL Multimedia)

install(TARGETS chanalyzer DESTINATION lib/plugins/channel)
2 changes: 2 additions & 0 deletions plugins/channel/lora/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,5 @@ target_link_libraries(demodlora
)

qt5_use_modules(demodlora Core Widgets OpenGL Multimedia)

install(TARGETS demodlora DESTINATION lib/plugins/channel)
4 changes: 3 additions & 1 deletion plugins/channel/nfm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,6 @@ target_link_libraries(demodnfm
sdrbase
)

qt5_use_modules(demodnfm Core Widgets OpenGL Multimedia)
qt5_use_modules(demodnfm Core Widgets OpenGL Multimedia)

install(TARGETS demodnfm DESTINATION lib/plugins/channel)
2 changes: 2 additions & 0 deletions plugins/channel/ssb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,5 @@ target_link_libraries(demodssb
)

qt5_use_modules(demodssb Core Widgets OpenGL Multimedia)

install(TARGETS demodssb DESTINATION lib/plugins/channel)
2 changes: 2 additions & 0 deletions plugins/channel/tcpsrc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,5 @@ target_link_libraries(demodtcpsrc
)

qt5_use_modules(demodtcpsrc Core Widgets OpenGL Network)

install(TARGETS demodtcpsrc DESTINATION lib/plugins/channel)
2 changes: 2 additions & 0 deletions plugins/channel/udpsrc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,5 @@ target_link_libraries(demodudpsrc
)

qt5_use_modules(demodudpsrc Core Widgets OpenGL Network)

install(TARGETS demodudpsrc DESTINATION lib/plugins/channel)
2 changes: 1 addition & 1 deletion plugins/channel/udpsrc/udpsrcgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ void UDPSrcGUI::applySettings()

int udpPort = ui->udpPort->text().toInt(&ok);

if((!ok) || (udpPort < 1) || (udpPort > 65535))
if((!ok) || (udpPort < 1024) || (udpPort > 65535))
{
udpPort = 9999;
}
Expand Down
4 changes: 3 additions & 1 deletion plugins/channel/wfm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,6 @@ target_link_libraries(demodwfm
sdrbase
)

qt5_use_modules(demodwfm Core Widgets OpenGL Multimedia)
qt5_use_modules(demodwfm Core Widgets OpenGL Multimedia)

install(TARGETS demodwfm DESTINATION lib/plugins/channel)
1 change: 1 addition & 0 deletions plugins/samplesource/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ if(LIBUSB_FOUND AND LIBHACKRF_FOUND)
endif(LIBUSB_FOUND AND LIBHACKRF_FOUND)

add_subdirectory(filesource)
add_subdirectory(sdrdaemon)
2 changes: 2 additions & 0 deletions plugins/samplesource/airspy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,5 @@ target_link_libraries(inputairspy
)

qt5_use_modules(inputairspy Core Widgets OpenGL Multimedia)

install(TARGETS inputairspy DESTINATION lib/plugins/samplesource)
2 changes: 2 additions & 0 deletions plugins/samplesource/bladerf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,5 @@ target_link_libraries(inputbladerf
)

qt5_use_modules(inputbladerf Core Widgets OpenGL Multimedia)

install(TARGETS inputbladerf DESTINATION lib/plugins/samplesource)
2 changes: 2 additions & 0 deletions plugins/samplesource/fcdpro/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@ target_link_libraries(inputfcdpro
)

qt5_use_modules(inputfcdpro Core Widgets OpenGL Multimedia)

install(TARGETS inputfcdpro DESTINATION lib/plugins/samplesource)
2 changes: 2 additions & 0 deletions plugins/samplesource/fcdproplus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@ target_link_libraries(inputfcdproplus
)

qt5_use_modules(inputfcdproplus Core Widgets OpenGL Multimedia)

install(TARGETS inputfcdproplus DESTINATION lib/plugins/samplesource)
2 changes: 2 additions & 0 deletions plugins/samplesource/filesource/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,5 @@ target_link_libraries(inputfilesource
)

qt5_use_modules(inputfilesource Core Widgets OpenGL Multimedia)

install(TARGETS inputfilesource DESTINATION lib/plugins/samplesource)
Loading

0 comments on commit 3bfb245

Please sign in to comment.