aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--AUTHORS3
-rw-r--r--ChangeLog13
-rw-r--r--TODO9
-rw-r--r--configure.ac2
-rw-r--r--doc/example.ini15
-rw-r--r--src/ConfigParser.h2
-rw-r--r--src/DabMod.cpp11
-rw-r--r--src/FormatConverter.cpp27
-rw-r--r--src/FormatConverter.h8
-rw-r--r--src/TimeInterleaver.cpp3
-rw-r--r--src/TimeInterleaver.h2
11 files changed, 69 insertions, 26 deletions
diff --git a/AUTHORS b/AUTHORS
index daf9713..7c684ff 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -19,3 +19,6 @@ Matthias P. Braendli <matthias [at] mpb [dot] li>
Jörgen Scott
- ZeroMQ remote control
- Static delay offset
+
+Sergiy
+ - Improvements for TII insertion
diff --git a/ChangeLog b/ChangeLog
index fca7ece..f2e0c6c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,19 @@
This file contains information about the changes done to
ODR-DabMod in this repository
+2017-06-05: Matthias P. Braendli <matthias@mpb.li>
+ (v1.0.1):
+ Move GainControl into a separate thread to make better use
+ of multiprocessor systems.
+ Give explicit names to GainControl modes (fix, max, var) in
+ configuration.
+ Add u8 IQ output format.
+ Add a normalised complexf IQ output format.
+ Read UHD async messages in separate thread to lessen influence on the
+ time-critical transmit thread.
+ Pre-fill UHD IQ buffer before starting to stream data, to ensure it is
+ properly filled and reduce underruns.
+
2017-03-03: Matthias P. Braendli <matthias@mpb.li>
(v1.0.0):
* odr-dabmod:
diff --git a/TODO b/TODO
index dd4f833..ca1b4d5 100644
--- a/TODO
+++ b/TODO
@@ -5,13 +5,14 @@ to some degree.
Unless written, no activity has been started on the topics.
-TII implementation incorrect
-----------------------------
-The current TII implementation is wrong. There are two TII variants:
+TII implementation incomplete
+-----------------------------
+The current TII implementation supports two TII variants:
one according to spec, and the one that was implemented in early modulators
that ended up being used a lot even if not compatible with the spec.
-ODR-DabMod should support both ideally.
+However, when enabled, some receivers are not able to lock on the signal.
+Is the power of the TII too strong? Synchronisation wrong?
EDI input
diff --git a/configure.ac b/configure.ac
index acefa90..d39e318 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,7 +19,7 @@
# along with ODR-DabMod. If not, see <http://www.gnu.org/licenses/>.
AC_PREREQ(2.59)
-AC_INIT([ODR-DabMod], [1.0.0], [matthias.braendli@mpb.li])
+AC_INIT([ODR-DabMod], [1.0.1], [matthias.braendli@mpb.li])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_SYSTEM
diff --git a/doc/example.ini b/doc/example.ini
index fa03d26..425dfa4 100644
--- a/doc/example.ini
+++ b/doc/example.ini
@@ -39,10 +39,11 @@ zmqctrlendpoint=tcp://127.0.0.1:9400
[log]
; Write to a logfile or to syslog.
-; Setting filename to stderr is very useful during tests and development
+; Setting filename to stderr is not necessary, as all messages are
+; automatically written to stderr.
syslog=0
-filelog=1
-filename=/dev/stderr
+filelog=0
+filename=odr-dabmod.log
[input]
; A file or fifo input is using transport=file
@@ -162,8 +163,9 @@ output=uhd
; gainmode VAR and FIX, they should never exceed 50000.
;format=complexf
;
-; When the format is set to complexf_normalised the maximal
-; amplitude written to a file, is the digital gain +-10%.
+; The complexf_normalised format applies a compensation factor to the complexf
+; output to bring the range of the I and Q components to [-1.0 .. 1.0]. The
+; digital_gain is still applied on top of that normalisation.
;format=complexf_normalised
;
; When the format is set to s8, the output writes I/Q 8-bit
@@ -171,6 +173,9 @@ output=uhd
; effectively mapping the gainmode VAR range of -50000 -- 50000
; to -128 -- 128. For other gainmodes, use the digital_gain setting
; to make sure you don't create clipping.
+;
+; The format u8 is the same as s8, except that the values are mapped
+; between 0 and 255.
;format=s8
; The output file:
diff --git a/src/ConfigParser.h b/src/ConfigParser.h
index fede801..22a4fc5 100644
--- a/src/ConfigParser.h
+++ b/src/ConfigParser.h
@@ -61,7 +61,7 @@ struct mod_settings_t {
float gainmodeVariance = 4.0f;
// To handle the timestamp offset of the modulator
- unsigned tist_delay_stages = 0;
+ unsigned tist_delay_stages = 1; // because GainControl is pipelined
double tist_offset_s = 0.0;
bool loop = false;
diff --git a/src/DabMod.cpp b/src/DabMod.cpp
index adc4cf2..7c342a2 100644
--- a/src/DabMod.cpp
+++ b/src/DabMod.cpp
@@ -197,8 +197,11 @@ static shared_ptr<ModOutput> prepare_output(
s.normalise = 1.0 / normalise_factor_file_var;
output = make_shared<OutputFile>(s.outputName);
}
- else if (s.fileOutputFormat == "s8") {
+ else if (s.fileOutputFormat == "s8" or
+ s.fileOutputFormat == "u8") {
// We must normalise the samples to the interval [-127.0; 127.0]
+ // The formatconverter will add 127 for u8 so that it ends up in
+ // [0; 255]
s.normalise = 127.0f / normalise_factor;
output = make_shared<OutputFile>(s.outputName);
@@ -284,8 +287,10 @@ int launch_modulator(int argc, char* argv[])
modulator_data m;
shared_ptr<FormatConverter> format_converter;
- if (mod_settings.useFileOutput and mod_settings.fileOutputFormat == "s8") {
- format_converter = make_shared<FormatConverter>();
+ if (mod_settings.useFileOutput and
+ (mod_settings.fileOutputFormat == "s8" or
+ mod_settings.fileOutputFormat == "u8")) {
+ format_converter = make_shared<FormatConverter>(mod_settings.fileOutputFormat);
}
auto output = prepare_output(mod_settings);
diff --git a/src/FormatConverter.cpp b/src/FormatConverter.cpp
index 89b3274..6826972 100644
--- a/src/FormatConverter.cpp
+++ b/src/FormatConverter.cpp
@@ -2,7 +2,7 @@
Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Her Majesty
the Queen in Right of Canada (Communications Research Center Canada)
- Copyright (C) 2014
+ Copyright (C) 2017
Matthias P. Braendli, matthias.braendli@mpb.li
http://opendigitalradio.org
@@ -39,8 +39,10 @@
# include <xmmintrin.h>
#endif
-FormatConverter::FormatConverter(void) :
- ModCodec() { }
+FormatConverter::FormatConverter(const std::string& format) :
+ ModCodec(),
+ m_offset_by_127(format == "u8")
+{ }
/* Expect the input samples to be in the range [-255.0, 255.0] */
int FormatConverter::process(Buffer* const dataIn, Buffer* dataOut)
@@ -54,6 +56,8 @@ int FormatConverter::process(Buffer* const dataIn, Buffer* dataOut)
float* in = reinterpret_cast<float*>(dataIn->getData());
#if 0
+#error "TODO: SSE FormatConvert does not support u8 yet"
+
// Disabled because subscripting a __m64 doesn't seem to work
// on all platforms.
@@ -84,11 +88,20 @@ int FormatConverter::process(Buffer* const dataIn, Buffer* dataOut)
out[j+3] = b4[0];
}
#else
- int8_t* out = reinterpret_cast<int8_t*>(dataOut->getData());
-
// Slow implementation that uses _ftol()
- for (size_t i = 0; i < sizeIn; i++) {
- out[i] = in[i];
+ if (m_offset_by_127) {
+ uint8_t* out = reinterpret_cast<uint8_t*>(dataOut->getData());
+
+ for (size_t i = 0; i < sizeIn; i++) {
+ out[i] = in[i] + 128;
+ }
+ }
+ else {
+ int8_t* out = reinterpret_cast<int8_t*>(dataOut->getData());
+
+ for (size_t i = 0; i < sizeIn; i++) {
+ out[i] = in[i];
+ }
}
#endif
diff --git a/src/FormatConverter.h b/src/FormatConverter.h
index 86ce347..ce848b6 100644
--- a/src/FormatConverter.h
+++ b/src/FormatConverter.h
@@ -2,7 +2,7 @@
Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Her Majesty
the Queen in Right of Canada (Communications Research Center Canada)
- Copyright (C) 2014
+ Copyright (C) 2017
Matthias P. Braendli, matthias.braendli@mpb.li
http://opendigitalradio.org
@@ -35,6 +35,7 @@
#include "porting.h"
#include "ModPlugin.h"
#include <complex>
+#include <string>
#include <stdint.h>
typedef std::complex<float> complexf;
@@ -42,10 +43,13 @@ typedef std::complex<float> complexf;
class FormatConverter : public ModCodec
{
public:
- FormatConverter(void);
+ FormatConverter(const std::string& format);
int process(Buffer* const dataIn, Buffer* dataOut);
const char* name();
+
+ private:
+ bool m_offset_by_127 = false;
};
diff --git a/src/TimeInterleaver.cpp b/src/TimeInterleaver.cpp
index 9565eca..3bf6339 100644
--- a/src/TimeInterleaver.cpp
+++ b/src/TimeInterleaver.cpp
@@ -26,8 +26,7 @@
#include <stdint.h>
-TimeInterleaver::TimeInterleaver(size_t framesize)
- throw (std::invalid_argument) :
+TimeInterleaver::TimeInterleaver(size_t framesize) :
ModCodec(),
d_framesize(framesize)
{
diff --git a/src/TimeInterleaver.h b/src/TimeInterleaver.h
index c131d24..bc94559 100644
--- a/src/TimeInterleaver.h
+++ b/src/TimeInterleaver.h
@@ -43,7 +43,7 @@ protected:
std::deque<std::vector<unsigned char> > d_history;
public:
- TimeInterleaver(size_t framesize) throw (std::invalid_argument);
+ TimeInterleaver(size_t framesize);
virtual ~TimeInterleaver();
int process(Buffer* const dataIn, Buffer* dataOut);