summaryrefslogtreecommitdiffstats
path: root/src/DabMod.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/DabMod.cpp')
-rw-r--r--src/DabMod.cpp71
1 files changed, 21 insertions, 50 deletions
diff --git a/src/DabMod.cpp b/src/DabMod.cpp
index 25a93bf..31fa76d 100644
--- a/src/DabMod.cpp
+++ b/src/DabMod.cpp
@@ -37,12 +37,9 @@
#include "OutputFile.h"
#include "FormatConverter.h"
#include "FrameMultiplexer.h"
-#if defined(HAVE_OUTPUT_UHD)
-# include "OutputUHD.h"
-#endif
-#if defined(HAVE_SOAPYSDR)
-# include "OutputSoapy.h"
-#endif
+#include "output/SDR.h"
+#include "output/UHD.h"
+#include "output/Soapy.h"
#include "OutputZeroMQ.h"
#include "InputReader.h"
#include "PcDebug.h"
@@ -133,15 +130,15 @@ static void printModSettings(const mod_settings_t& mod_settings)
else if (mod_settings.useUHDOutput) {
fprintf(stderr, " UHD\n"
" Device: %s\n"
- " Type: %s\n"
+ " Subdevice: %s\n"
" master_clock_rate: %ld\n"
" refclk: %s\n"
" pps source: %s\n",
- mod_settings.outputuhd_conf.device.c_str(),
- mod_settings.outputuhd_conf.usrpType.c_str(),
- mod_settings.outputuhd_conf.masterClockRate,
- mod_settings.outputuhd_conf.refclk_src.c_str(),
- mod_settings.outputuhd_conf.pps_src.c_str());
+ mod_settings.sdr_device_config.device.c_str(),
+ mod_settings.sdr_device_config.subDevice.c_str(),
+ mod_settings.sdr_device_config.masterClockRate,
+ mod_settings.sdr_device_config.refclk_src.c_str(),
+ mod_settings.sdr_device_config.pps_src.c_str());
}
#endif
#if defined(HAVE_SOAPYSDR)
@@ -149,8 +146,8 @@ static void printModSettings(const mod_settings_t& mod_settings)
fprintf(stderr, " SoapySDR\n"
" Device: %s\n"
" master_clock_rate: %ld\n",
- mod_settings.outputsoapy_conf.device.c_str(),
- mod_settings.outputsoapy_conf.masterClockRate);
+ mod_settings.sdr_device_config.device.c_str(),
+ mod_settings.sdr_device_config.masterClockRate);
}
#endif
else if (mod_settings.useZeroMQOutput) {
@@ -208,18 +205,20 @@ static shared_ptr<ModOutput> prepare_output(
#if defined(HAVE_OUTPUT_UHD)
else if (s.useUHDOutput) {
s.normalise = 1.0f / normalise_factor;
- s.outputuhd_conf.sampleRate = s.outputRate;
- output = make_shared<OutputUHD>(s.outputuhd_conf);
- rcs.enrol((OutputUHD*)output.get());
+ s.sdr_device_config.sampleRate = s.outputRate;
+ auto uhddevice = make_shared<Output::UHD>(s.sdr_device_config);
+ output = make_shared<Output::SDR>(s.sdr_device_config, uhddevice);
+ rcs.enrol((Output::SDR*)output.get());
}
#endif
#if defined(HAVE_SOAPYSDR)
else if (s.useSoapyOutput) {
/* We normalise the same way as for the UHD output */
s.normalise = 1.0f / normalise_factor;
- s.outputsoapy_conf.sampleRate = s.outputRate;
- output = make_shared<OutputSoapy>(s.outputsoapy_conf);
- rcs.enrol((OutputSoapy*)output.get());
+ s.sdr_device_config.sampleRate = s.outputRate;
+ auto soapydevice = make_shared<Output::Soapy>(s.sdr_device_config);
+ output = make_shared<Output::SDR>(s.sdr_device_config, soapydevice);
+ rcs.enrol((Output::SDR*)output.get());
}
#endif
#if defined(HAVE_ZEROMQ)
@@ -270,12 +269,6 @@ int launch_modulator(int argc, char* argv[])
throw std::runtime_error("Configuration error");
}
- // When using the FIRFilter, increase the modulator offset pipelining delay
- // by the correct amount
- if (not mod_settings.filterTapsFilename.empty()) {
- mod_settings.tist_delay_stages += FIRFILTER_PIPELINE_DELAY;
- }
-
printModSettings(mod_settings);
modulator_data m;
@@ -296,7 +289,7 @@ int launch_modulator(int argc, char* argv[])
set_thread_name("modulator");
if (mod_settings.inputTransport == "edi") {
- EdiReader ediReader(mod_settings.tist_offset_s, mod_settings.tist_delay_stages);
+ EdiReader ediReader(mod_settings.tist_offset_s);
EdiDecoder::ETIDecoder ediInput(ediReader, false);
if (mod_settings.edi_max_delay_ms > 0.0f) {
// setMaxDelay wants number of AF packets, which correspond to 24ms ETI frames
@@ -321,17 +314,6 @@ int launch_modulator(int argc, char* argv[])
flowgraph.connect(modulator, output);
}
-#if defined(HAVE_OUTPUT_UHD)
- if (mod_settings.useUHDOutput) {
- ((OutputUHD*)output.get())->setETISource(modulator->getEtiSource());
- }
-#endif
-#if defined(HAVE_SOAPYSDR)
- if (mod_settings.useSoapyOutput) {
- ((OutputSoapy*)output.get())->setETISource(modulator->getEtiSource());
- }
-#endif
-
size_t framecount = 0;
while (running) {
@@ -401,7 +383,7 @@ int launch_modulator(int argc, char* argv[])
m.flowgraph = &flowgraph;
m.data.setLength(6144);
- EtiReader etiReader(mod_settings.tist_offset_s, mod_settings.tist_delay_stages);
+ EtiReader etiReader(mod_settings.tist_offset_s);
m.etiReader = &etiReader;
auto input = make_shared<InputMemory>(&m.data);
@@ -415,17 +397,6 @@ int launch_modulator(int argc, char* argv[])
flowgraph.connect(modulator, output);
}
-#if defined(HAVE_OUTPUT_UHD)
- if (mod_settings.useUHDOutput) {
- ((OutputUHD*)output.get())->setETISource(modulator->getEtiSource());
- }
-#endif
-#if defined(HAVE_SOAPYSDR)
- if (mod_settings.useSoapyOutput) {
- ((OutputSoapy*)output.get())->setETISource(modulator->getEtiSource());
- }
-#endif
-
inputReader->PrintInfo();
run_modulator_state_t st = run_modulator(m);