Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into UriDmk
Browse files Browse the repository at this point in the history
Conflicts:
	src/svxlink/trx/CMakeLists.txt
	src/svxlink/trx/LocalRx.cpp
  • Loading branch information
dl1hrc committed Sep 25, 2014
2 parents aa401a4 + 115f51b commit cfaee3b
Show file tree
Hide file tree
Showing 38 changed files with 6,121 additions and 841 deletions.
2 changes: 1 addition & 1 deletion COPYRIGHT
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ WOL (Wide Open License):
async/audio/AudioDecimator.*
async/audio/AudioInterpolator.*

Custom license (Aladdin Enterprises):
Zlib (Aladdin Enterprises):
echolib/md5.{c,h}

MIT License:
Expand Down
19 changes: 17 additions & 2 deletions src/async/audio/AsyncAudioDebugger.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,19 @@ class AudioDebugger : public AudioSink, public AudioSource
int ret = sinkWriteSamples(samples, count);
sample_count += ret;

float max_samp = 0.0f;
for (int i=0; i<count; ++i)
{
if (samples[i] > max_samp)
{
max_samp = samples[i];
}
if (-samples[i] > max_samp)
{
max_samp = -samples[i];
}
}

struct timeval time, diff;
gettimeofday(&time, 0);

Expand All @@ -175,12 +188,14 @@ class AudioDebugger : public AudioSink, public AudioSource
<< " ret=" << ret << " sample_rate=";
if (diff_ms > 0)
{
std::cout << sample_count * 1000 / diff_ms << std::endl;
std::cout << sample_count * 1000 / diff_ms;
}
else
{
std::cout << "inf\n";
std::cout << "inf";
}
std::cout << " max=" << max_samp;
std::cout << std::endl;
return ret;
}

Expand Down
12 changes: 12 additions & 0 deletions src/cmake/Modules/FindGROFF.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FIND_PROGRAM(GROFF_TOOL
NAMES groff
PATHS /bin /usr/bin /usr/local/bin
DOC "The path to the groff document formatting tool"
)


IF(NOT GROFF_TOOL)
MESSAGE(FATAL_ERROR "Unable to find 'groff' program")
ENDIF(NOT GROFF_TOOL)

MARK_AS_ADVANCED(GROFF_TOOL)
14 changes: 12 additions & 2 deletions src/doc/man/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ set(MAN_PAGES svxlink.1 remotetrx.1 siglevdetcal.1 svxlink.conf.5
ModulePropagationMonitor.conf.5 ModuleSelCallEnc.conf.5 qtel.1
)

# Search for gzip program. Error out if not found.
# Search for the gzip and groff programs. Error out if not found.
include(FindGZIP)
include(FindGROFF)

# Set up a target for compressing each manual page. Also add an install
# target for it.
Expand All @@ -17,12 +18,21 @@ foreach(man ${MAN_PAGES})
COMMAND ${GZIP_TOOL} -c ${CMAKE_CURRENT_SOURCE_DIR}/${man} > ${man}.gz
COMMENT "Compressing maual page ${man}.gz..."
)
add_custom_command(OUTPUT ${man}.html
DEPENDS ${man}
COMMAND ${GROFF_TOOL} -mandoc -Thtml < ${CMAKE_CURRENT_SOURCE_DIR}/${man} > ${man}.html
COMMENT "Createing HTML maual page ${man}.html..."
)
string(REGEX REPLACE ^.*\([1-9]\)\$ \\1 sec ${man})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${man}.gz
DESTINATION ${MAN_INSTALL_DIR}/man${sec}
OPTIONAL
)
set(TARGETS ${TARGETS} ${man}.gz)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${man}.html
DESTINATION ${DOC_INSTALL_DIR}/man/man${sec}
OPTIONAL
)
set(TARGETS ${TARGETS} ${man}.gz ${man}.html)
endforeach(man)

# Add a custom target to trigger the build of the man pages
Expand Down
125 changes: 116 additions & 9 deletions src/doc/man/svxlink.conf.5
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH SVXLINK.CONF 5 "SEPTEMBER 2013" Linux "File Formats"
.TH SVXLINK.CONF 5 "JULY 2014" Linux "File Formats"
.
.SH NAME
.
Expand Down Expand Up @@ -1097,6 +1097,115 @@ you define ZVEI1 for SvxLink and a (e.g.) ZVEI3 sequence is received.
At the moment only SEL5_DEC_TYPE=INTERNAL is valid. Maybe we have support for
some external tone detectors later. To disable SEL5 tone decoding, specify
NONE or just comment the configuration variable out.
.TP
.B RAW_AUDIO_UDP_DEST
Setting this configuration variable makes it possible to stream the raw audio
from the sound device to an UDP socket. The sample format is the one used
internally in SvxLink, that is each sample is represented by a 32 bit float.
The sample rate is the same as the one chosen for the audio device.
The destination is specified as ip-address:port.

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.

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.
If you have a recent version of the rtl_fm utility, that can be used to find
the frequency error using the "-c" switch. The rtl_fm utility is in the
rtl-sdr package. You also need the rtl_tcp utility from that package.

When you have the rtl-sdr stuff installed, just start rtl_tcp. No command line
arguments are needed. Then configure a Ddr receiver in SvxLink. All
configuration variables that are available for an ordinary local receiver is
also available for a Ddr receiver, except the audio device related ones which
are just ignored. The following configuration variables are available in
addition to the ordinary ones.
.TP
.B FQ
The narrowband channel frequency to tune to.
.TP
.B WBRX
The configuration section for the wideband receiver to connect this DDR to.
See "Wideband Receiver Section" below.
.TP
.B SIGLEV_DET
For a Ddr there also is a special signal level detector available, DDR, that
will measure the RF power before demodulation. This is much more reliable than
estimating the signal power through the audio which is normally done in SvxLink.
The drawback is that the Ddr signal level is not completely comparable to the
ordinary SvxLink signal level measurements since it have a larger dynamic
range. Set SIGLEV_DET=DDR to activate the Ddr signal level detector.
.
.SS Wideband Receiver Section
.
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:
.TP
.B HOST
The name of the host that the rtl_tcp utility is running on (Default:
localhost).
.TP
.B PORT
The TCP port that rtl_tcp is listening on (Default: 1234).
.TP
.B SAMPLE_RATE
The sample rate used by the dongle. Legal values are 960000 and 2400000
(Default: 960000).
.TP
.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.

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
the tuner off by. Typical values are in the range -100 to 100.
.TP
.B CENTER_FQ
The frequency, in Hz, that the wideband tuner should be placed at. This
configuration variable should normally be left unset since SvxLink will try to
place the wideband tuner to cover all set up Ddr frequencies. SvxLink will also
try to avoid placing a Ddr on the center frequency of the wideband spectrum
since there is usually some noise there. Only use this configration variable
if you need to override the automatic placement for some reason.
.TP
.B GAIN
If unset, automatic gain is used. Do not use automatic gain control if using
the DDR signal level detector. That may mess up the measurements. Finding a
good gain setting may be hard. Too little and you will not hear the signals you
want to hear. Too much and the tuner will be driven into distorsion. One way to
decide the maximum usable gain is to use the PEAK_METER explained below. When
there are no distorsion warning messages printed or just a single one now and
then you have found the max gain. You should probably back at least one step
down from this value. If the signals you want to receive are very strong, set
the gain as low as possible.

What gain values that are available is tuner dependent. SvxLink will print the
available gain values when it establishes the connection to the tuner. Typical
values are in the range -10 to 50dB.
.TP
.B PEAK_METER
If PEAK_METER is set to 1, a warning will be printed every time the tuner is
driven into distorsion. If it happens too often the gain should be lowered. At
most, one warning per second will be printed.
.
.SS Voter Section
.
Expand Down Expand Up @@ -1389,14 +1498,6 @@ maximum level. Then the level of the CTCSS tone should be reduced. The default
in the configuration file is 9%. For the tone to be transmitted the CTCSS_FQ
variable must also be setup and also the TX_CTCSS variable in the logic core
configuration section.

.I Note:
The level of the tone affects the level of the rest of the audio in SvxLink.
This is to avoid distorision when the two audio streams are mixed together. For
example, if a tone level of 9% is setup the rest of the audio will be attenuated
by 9%. This is true even if the CTCSS_FQ and TX_CTCSS configuration variables
are not set so comment this configuration variable out if CTCSS on TX is not
used.
.TP
.B PREEMPHASIS
[EXPERIMENTAL] Enable this feature if you are modulating the FM modulator
Expand Down Expand Up @@ -1444,6 +1545,12 @@ disabled.
The TONE_SIGLEV_LEVEL configuration variable is used to set the tone level.
It is a value in the 1-100 range which indicate the output level in percent
of the maximum possible level. The default is 10.
.TP
.B MASTER_GAIN
This configuration variable can be used to fine tune or increase the audio
gain for all transmitted sound if it's not possible to do using the normal
sound card hardware gain controls. The gain should be given in dB and can
be both positive and negative.
.
.SS Networked Transmitter Section
.
Expand Down
1 change: 1 addition & 0 deletions src/svxlink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ add_subdirectory(modules)
#add_subdirectory(scripts)
add_subdirectory(remotetrx)
add_subdirectory(siglevdetcal)
add_subdirectory(devcal)
27 changes: 27 additions & 0 deletions src/svxlink/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
1.5.0 -- ?? ??? 2014
----------------------

* Added support for using digital drop receivers on an RTL2832U based DVB-T
USB dongle. This will open up the world of cheap receiver hardware to all
SvxLink users. It will for example be very cheap to set up an extra receiver
with local coverage for a SvxLink based repeater, as long as there is a
network connection to the repeater.

* New configuration variable for local receivers, RAW_AUDIO_UDP_DEST, which
makes it possible to stream the raw audio read by SvxLink from the audio
device to a UDP port. This feature was mainly added for debugging but may
be usable for other things as well.

* New configuration variable MASTER_GAIN for local transmitters. This has the
functionality as the PREAMP variable have for local receivers. That is,
it can be used to fine tune or amplify the gain of the signal if it's not
possible to do with the normal hardware sound controls.

* Added a calibration utility, devcal, which can be used to get all the
levels right for all transmitters and receivers in the system.

* New squelch detector type, OPEN, which keeps the squelch open at all times.
Used at calibration for example.



1.4.0 -- 02 aug 2014
----------------------

Expand Down
11 changes: 11 additions & 0 deletions src/svxlink/devcal/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
add_executable(devcal devcal.cpp)
target_link_libraries(devcal asyncaudio asynccpp trx popt)
set_target_properties(devcal PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${RUNTIME_OUTPUT_DIRECTORY}
)

add_executable(noisegen noisegen.cpp)
target_link_libraries(noisegen asyncaudio asynccpp trx)
set_target_properties(noisegen PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${RUNTIME_OUTPUT_DIRECTORY}
)
Loading

0 comments on commit cfaee3b

Please sign in to comment.