Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into module_frn
Browse files Browse the repository at this point in the history
  • Loading branch information
sh123 committed Apr 13, 2015
2 parents 18c0af0 + cec397f commit 5fdcc4a
Show file tree
Hide file tree
Showing 25 changed files with 2,319 additions and 548 deletions.
2 changes: 1 addition & 1 deletion src/async/audio/CMakeLists.txt
Expand Up @@ -74,7 +74,7 @@ endif(Opus_FOUND)

if(USE_ALSA)
set(LIBSRC ${LIBSRC} AsyncAudioDeviceAlsa.cpp)
find_package(ALSA REQUIRED)
find_package(ALSA REQUIRED QUIET)
set(LIBS ${LIBS} ${ALSA_LIBRARIES})
include_directories(${ALSA_INCLUDE_DIRS})
endif(USE_ALSA)
Expand Down
103 changes: 51 additions & 52 deletions src/cmake/Modules/FindDL.cmake
@@ -1,55 +1,54 @@
# - Check for the presence of DL
#
# The following variables are set when DL is found:
# HAVE_DL = Set to true, if all components of DL
# have been found.
# DL_INCLUDES = Include path for the header files of DL
# DL_LIBRARIES = Link these to use DL

## -----------------------------------------------------------------------------
## Check for the header files

find_path (DL_INCLUDES dlfcn.h
PATHS /usr/local/include /usr/include ${CMAKE_EXTRA_INCLUDES}
)

## -----------------------------------------------------------------------------
## Check for the library

find_library (DL_LIBRARIES dl
PATHS /usr/local/lib /usr/lib /lib ${CMAKE_EXTRA_LIBRARIES}
)

## -----------------------------------------------------------------------------
## Actions taken when all components have been found

if (DL_INCLUDES AND DL_LIBRARIES)
set (HAVE_DL TRUE)
else (DL_INCLUDES AND DL_LIBRARIES)
if (NOT DL_FIND_QUIETLY)
if (NOT DL_INCLUDES)
message (STATUS "Unable to find DL header files!")
endif (NOT DL_INCLUDES)
if (NOT DL_LIBRARIES)
message (STATUS "Unable to find DL library files!")
endif (NOT DL_LIBRARIES)
endif (NOT DL_FIND_QUIETLY)
endif (DL_INCLUDES AND DL_LIBRARIES)

if (HAVE_DL)
if (NOT DL_FIND_QUIETLY)
message (STATUS "Found components for DL")
message (STATUS "DL_INCLUDES = ${DL_INCLUDES}")
message (STATUS "DL_LIBRARIES = ${DL_LIBRARIES}")
endif (NOT DL_FIND_QUIETLY)
else (HAVE_DL)
if (DL_FIND_REQUIRED)
message (FATAL_ERROR "Could not find DL!")
endif (DL_FIND_REQUIRED)
endif (HAVE_DL)

mark_as_advanced (
HAVE_DL
DL_LIBRARIES
DL_INCLUDES
)
# DL_FOUND = Set to true, if all components of DL
# have been found.
# DL_INCLUDE_DIRS = Include path for the header files of DL
# DL_LIBRARIES = Link these to use DL

if (DL_LIBRARIES AND DL_INCLUDE_DIRS)
# in cache already
set(DL_FOUND TRUE)
else (DL_LIBRARIES AND DL_INCLUDE_DIRS)
## -------------------------------------------------------------------------
## Check for the header files

find_path (DL_INCLUDE_DIR
NAMES dlfcn.h
PATHS /usr/local/include /usr/include ${CMAKE_EXTRA_INCLUDES}
)

## -------------------------------------------------------------------------
## Check for the library

find_library (DL_LIBRARY
NAMES dl
PATHS /usr/local/lib /usr/lib /lib ${CMAKE_EXTRA_LIBRARIES}
)

## -------------------------------------------------------------------------
## Actions taken when all components have been found

if (DL_LIBRARY)
set(DL_FOUND TRUE)
endif (DL_LIBRARY)

set(DL_INCLUDE_DIRS ${DL_INCLUDE_DIR})

if (DL_FOUND)
set(DL_LIBRARIES ${DL_LIBRARIES} ${DL_LIBRARY})
endif (DL_FOUND)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(DL
DEFAULT_MSG
DL_LIBRARIES
DL_INCLUDE_DIRS
)

mark_as_advanced (
HAVE_DL
DL_LIBRARIES
DL_INCLUDES
)
endif (DL_LIBRARIES AND DL_INCLUDE_DIRS)
18 changes: 8 additions & 10 deletions src/cmake/Modules/FindPopt.cmake
Expand Up @@ -73,17 +73,15 @@ else (POPT_LIBRARIES AND POPT_INCLUDE_DIRS)
set(POPT_FOUND TRUE)
endif (POPT_INCLUDE_DIRS AND POPT_LIBRARIES)

if (POPT_FOUND)
if (NOT Popt_FIND_QUIETLY)
message(STATUS "Found Popt: ${POPT_LIBRARIES}")
endif (NOT Popt_FIND_QUIETLY)
else (POPT_FOUND)
if (Popt_FIND_REQUIRED)
message(FATAL_ERROR "Could not find Popt")
endif (Popt_FIND_REQUIRED)
endif (POPT_FOUND)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Popt
DEFAULT_MSG
POPT_LIBRARIES
POPT_INCLUDE_DIRS
)

# show the POPT_INCLUDE_DIR and POPT_LIBRARY variables only in the advanced view
# Show the POPT_INCLUDE_DIR and POPT_LIBRARY variables only in the
# advanced view
mark_as_advanced(POPT_INCLUDE_DIR POPT_LIBRARY)

endif (POPT_LIBRARIES AND POPT_INCLUDE_DIRS)
103 changes: 51 additions & 52 deletions src/cmake/Modules/FindRT.cmake
@@ -1,55 +1,54 @@
# - Check for the presence of RT
#
# The following variables are set when RT is found:
# HAVE_RT = Set to true, if all components of RT
# have been found.
# RT_INCLUDES = Include path for the header files of RT
# RT_LIBRARIES = Link these to use RT

## -----------------------------------------------------------------------------
## Check for the header files

find_path (RT_INCLUDES time.h
PATHS /usr/local/include /usr/include ${CMAKE_EXTRA_INCLUDES}
)

## -----------------------------------------------------------------------------
## Check for the library

find_library (RT_LIBRARIES rt
PATHS /usr/local/lib /usr/lib /lib ${CMAKE_EXTRA_LIBRARIES}
)

## -----------------------------------------------------------------------------
## Actions taken when all components have been found

if (RT_INCLUDES AND RT_LIBRARIES)
set (HAVE_RT TRUE)
else (RT_INCLUDES AND RT_LIBRARIES)
if (NOT RT_FIND_QUIETLY)
if (NOT RT_INCLUDES)
message (STATUS "Unable to find RT header files!")
endif (NOT RT_INCLUDES)
if (NOT RT_LIBRARIES)
message (STATUS "Unable to find RT library files!")
endif (NOT RT_LIBRARIES)
endif (NOT RT_FIND_QUIETLY)
endif (RT_INCLUDES AND RT_LIBRARIES)

if (HAVE_RT)
if (NOT RT_FIND_QUIETLY)
message (STATUS "Found components for RT")
message (STATUS "RT_INCLUDES = ${RT_INCLUDES}")
message (STATUS "RT_LIBRARIES = ${RT_LIBRARIES}")
endif (NOT RT_FIND_QUIETLY)
else (HAVE_RT)
if (RT_FIND_REQUIRED)
message (FATAL_ERROR "Could not find RT!")
endif (RT_FIND_REQUIRED)
endif (HAVE_RT)

mark_as_advanced (
HAVE_RT
RT_LIBRARIES
RT_INCLUDES
)
# RT_FOUND = Set to true, if all components of RT
# have been found.
# RT_INCLUDE_DIRS = Include path for the header files of RT
# RT_LIBRARIES = Link these to use RT

if (RT_LIBRARIES AND RT_INCLUDE_DIRS)
# in cache already
set(RT_FOUND TRUE)
else (RT_LIBRARIES AND RT_INCLUDE_DIRS)
## -------------------------------------------------------------------------
## Check for the header files

find_path (RT_INCLUDE_DIR
NAMES time.h
PATHS /usr/local/include /usr/include ${CMAKE_EXTRA_INCLUDES}
)

## -------------------------------------------------------------------------
## Check for the library

find_library (RT_LIBRARY
NAMES rt
PATHS /usr/local/lib /usr/lib /lib ${CMAKE_EXTRA_LIBRARIES}
)

## -------------------------------------------------------------------------
## Actions taken when all components have been found

if (RT_LIBRARY)
set(RT_FOUND TRUE)
endif (RT_LIBRARY)

set(RT_INCLUDE_DIRS ${RT_INCLUDE_DIR})

if (RT_FOUND)
set(RT_LIBRARIES ${RT_LIBRARIES} ${RT_LIBRARY})
endif (RT_FOUND)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(RT
DEFAULT_MSG
RT_LIBRARIES
RT_INCLUDE_DIRS
)

mark_as_advanced (
HAVE_RT
RT_LIBRARIES
RT_INCLUDES
)
endif (RT_LIBRARIES AND RT_INCLUDE_DIRS)
44 changes: 44 additions & 0 deletions src/cmake/Modules/FindRtlSdr.cmake
@@ -0,0 +1,44 @@
# - Try to find rtl-sdr
# Once done this will define
#
# RTLSDR_FOUND - system has rtl-sdr
# RTLSDR_INCLUDE_DIRS - the rtl-sdr include directory
# RTLSDR_LIBRARIES - Link these to use rtl-sdr
# RTLSDR_DEFINITIONS - Compiler switches required for using rtl-sdr
#

if (RTLSDR_LIBRARIES AND RTLSDR_INCLUDE_DIRS)
# In cache already
set(RTLSDR_FOUND TRUE)
else (RTLSDR_LIBRARIES AND RTLSDR_INCLUDE_DIRS)

find_path(RTLSDR_INCLUDE_DIR
NAMES rtl-sdr.h
PATHS ${RTLSDR_DIR}/include
)

find_library(RTLSDR_LIBRARY
NAMES rtlsdr
PATHS ${RTLSDR_DIR}/build/src
)

set(RTLSDR_INCLUDE_DIRS
${RTLSDR_INCLUDE_DIR}
)

if (RTLSDR_LIBRARY)
set(RTLSDR_LIBRARIES ${RTLSDR_LIBRARIES} ${RTLSDR_LIBRARY})
endif (RTLSDR_LIBRARY)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(RtlSdr
DEFAULT_MSG
RTLSDR_LIBRARIES
RTLSDR_INCLUDE_DIRS
)

# Show the RTLSDR_INCLUDE_DIR and RTLSDR_LIBRARY variables only in
# the advanced view
mark_as_advanced(RTLSDR_INCLUDE_DIR RTLSDR_LIBRARY)

endif (RTLSDR_LIBRARIES AND RTLSDR_INCLUDE_DIRS)
39 changes: 29 additions & 10 deletions src/doc/man/svxlink.conf.5
Expand Up @@ -1183,19 +1183,21 @@ Example: RAW_AUDIO_UDP_DEST=127.0.0.1:10000
.SS Ddr Receiver Section
.
A special kind of local receiver is the Digital Drop Receiver (DDR). It will
use the rtl_tcp utility to interface to a RTL2832U based DVB-T USB dongle and
use that as a wideband receiver. These USB dongles can be bought cheeply from
an Internet shop (~$10). The radio performance may not be great but better than
one might think. Usage as a cheap local coverage receiver or as a link receiver
may work very well.
use either the rtl_tcp utility or a direct USB connection to interface to a
RTL2832U based DVB-T USB dongle and use that as a wideband receiver. These USB
dongles can be bought cheeply from an Internet shop (~$10). The radio
performance may not be great but better than one might think. Usage as a cheap
local coverage receiver or as a link receiver may work very well.

One big advantage of using a wideband receiver is that it is possible to
monitor more than one narrow band channel at a time. The only limit is the CPU
power and the bandwidth of the wideband tuner. You probably need a Pentium4 or
better to fulfill the CPU demands.

Getting the DVB-T dongle running is out of scope for this document but what
you need to do is to find out the frequency error on your specific dongle.
you absolutely need to do is to find out the frequency error on your specific
dongle. When you have figured out what the frequency error is, set up the
FQ_CORR configuration variable in the wideband receiver configuration section.

The rtl_tcp utility is in a package named similar to something like rtl-sdr.
When you have the rtl-sdr stuff installed, just start rtl_tcp. No command line
Expand Down Expand Up @@ -1226,8 +1228,26 @@ A wideband receiver section is used to configure access to a wideband receiver
which can be used by a Digital Drop Receiver (DDR), described above, to handle
multiple narrowband channels using the same hardware. The only hardware
supported at the moment is RTL2832U based DVB-T USB dongles. SvxLink access the
dongle through the rtl_tcp utility which make the dongle available on a TCP
network port. The following configuration variables are available:
dongle directly via USB or through the rtl_tcp utility, which make the dongle
available on a TCP network port. The following configuration variables are
available:
.TP
.B TYPE
The type of wideband receiver used. The only supported values right now are
"RtlTcp" and "RtlUsb".
.TP
.B DEV_MATCH
When using RtlUsb, this configuration variable is used to select the dongle to
use if there are multiple dongles connected to the computer. When looking for
dongles, SvxLink will try to match the string given in this configuration
variable in different ways. First, if it's a digit, a match against the device
index is tried. The device index is just a number, zero and up, that is given
to a dongle when it's inserted.

If the device index does not match, a match against the beginning, end or the
whole serial number will be tried.

Default: 0 (first device found)
.TP
.B HOST
The name of the host that the rtl_tcp utility is running on (Default:
Expand All @@ -1243,8 +1263,7 @@ The sample rate used by the dongle. Legal values are 960000 and 2400000
.B FQ_CORR
This is probably the most important configuration variable. Most dongles are
far off in frequency so they need to be calibrated. How to do this is out of
scope for this document but some later versions of the rtl_fm utility may be
able to do it using the "-c" command line switch.
scope for this document.

The end result should be a correction value for how far off the dongle is in
frequency counted in parts per million (PPM). That is, how many Hz per MHz is
Expand Down
5 changes: 5 additions & 0 deletions src/svxlink/ChangeLog
Expand Up @@ -61,6 +61,11 @@

* Now printing out when 1750Hz tone burst muting is active.

* Added support for the r828D rtl-sdr tuner.

* Now possible to use an RTL2832u DVB-T dongle directly via USB instead of
using rtl_tcp.



1.4.0 -- 02 aug 2014
Expand Down
2 changes: 2 additions & 0 deletions src/svxlink/remotetrx/remotetrx.conf
Expand Up @@ -98,6 +98,8 @@ DTMF_SERIAL=/dev/ttyS0
#WBRX=WbRx1

[WbRx1]
#TYPE=RtlUsb
#DEV_MATCH=0
#HOST=localhost
#PORT=1234
#CENTER_FQ=435075000
Expand Down
8 changes: 8 additions & 0 deletions src/svxlink/remotetrx/remotetrx.cpp
Expand Up @@ -550,6 +550,14 @@ int main(int argc, char **argv)
cerr << "*** ERROR: No trxs successfully initialized. Bailing out...\n";
}

for (vector<TrxHandler*>::iterator it = trx_handlers.begin();
it != trx_handlers.end();
++it)
{
delete *it;
}
trx_handlers.clear();

logfile_flush();

if (stdin_watch != 0)
Expand Down

0 comments on commit 5fdcc4a

Please sign in to comment.