From 685095418bc8fd27dcd0b1d73ad1741114aeda6a Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Sun, 14 Sep 2014 00:08:53 +0200 Subject: SFN: carry FCT along with timestamps This is the first step to fix issue #6. The goal is to enable the OutputUHD to check for FCT consistency. Once it can do that, it will also be able to reset the UHD streamer if necessary. --- src/OutputUHD.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/OutputUHD.h') diff --git a/src/OutputUHD.h b/src/OutputUHD.h index 69e5b20..3a047bf 100644 --- a/src/OutputUHD.h +++ b/src/OutputUHD.h @@ -36,6 +36,8 @@ DESCRIPTION: #ifndef OUTPUT_UHD_H #define OUTPUT_UHD_H +#define FAKE_UHD 0 + #ifdef HAVE_CONFIG_H # include #endif @@ -77,15 +79,14 @@ struct UHDWorkerFrameData { // Full timestamp struct frame_timestamp ts; - - // Frame counter - uint32_t fct; }; enum refclk_lock_loss_behaviour_t { CRASH, IGNORE }; struct UHDWorkerData { +#if FAKE_UHD == 0 uhd::usrp::multi_usrp::sptr myUsrp; +#endif unsigned sampleRate; // Double buffering between the two threads @@ -117,7 +118,12 @@ struct UHDWorkerData { // The common logger Logger* logger; -}; + + // What transmission mode we're using defines by how + // much the FCT should increment for each + // transmission frame. + int fct_increment; +}; class UHDWorker { -- cgit v1.2.3 From cf46de6e9faa6628650217f53bae72059475c63e Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Sun, 2 Nov 2014 21:07:08 +0100 Subject: Change UHD txgain to double --- doc/example.ini | 2 +- src/DabMod.cpp | 4 ++-- src/OutputUHD.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/OutputUHD.h') diff --git a/doc/example.ini b/doc/example.ini index 9cdfe03..38a856c 100644 --- a/doc/example.ini +++ b/doc/example.ini @@ -107,7 +107,7 @@ filename=/dev/stdout ; ; Settings for a USRP B100: device=master_clock_rate=32768000,type=b100 -txgain=2 +txgain=2.0 ; Try first with small gain values ; Also set rate to 2048000 diff --git a/src/DabMod.cpp b/src/DabMod.cpp index a4ef228..b0a7a2c 100644 --- a/src/DabMod.cpp +++ b/src/DabMod.cpp @@ -259,7 +259,7 @@ int main(int argc, char* argv[]) break; case 'G': #if defined(HAVE_OUTPUT_UHD) - outputuhd_conf.txgain = (int)strtol(optarg, NULL, 10); + outputuhd_conf.txgain = strtod(optarg, NULL); #endif break; case 'l': @@ -453,7 +453,7 @@ int main(int argc, char* argv[]) "setting type in [uhd] device is deprecated !\n"; } - outputuhd_conf.txgain = pt.get("uhdoutput.txgain", 0); + outputuhd_conf.txgain = pt.get("uhdoutput.txgain", 0.0); outputuhd_conf.frequency = pt.get("uhdoutput.frequency", 0); std::string chan = pt.get("uhdoutput.channel", ""); diff --git a/src/OutputUHD.h b/src/OutputUHD.h index 3a047bf..ef9740d 100644 --- a/src/OutputUHD.h +++ b/src/OutputUHD.h @@ -166,7 +166,7 @@ struct OutputUHDConfig { long masterClockRate; unsigned sampleRate; double frequency; - int txgain; + double txgain; bool enableSync; bool muteNoTimestamps; -- cgit v1.2.3 From 2ba0bcee8b4b3c0ace3d70bae07d8d5d3152da95 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 14 Nov 2014 14:44:09 +0100 Subject: Remove Makefile.am UHD check --- configure.ac | 2 -- src/Makefile.am | 8 +------- src/OutputUHD.cpp | 4 ++++ src/OutputUHD.h | 3 +++ 4 files changed, 8 insertions(+), 9 deletions(-) (limited to 'src/OutputUHD.h') diff --git a/configure.ac b/configure.ac index 7f7ad0a..005b1fc 100644 --- a/configure.ac +++ b/configure.ac @@ -129,8 +129,6 @@ AS_IF([test "x$enable_output_uhd" = "xyes"], [AC_DEFINE(HAVE_OUTPUT_UHD, [1], [Define if UHD output is enabled]) , AC_CHECK_LIB([uhd], [main], [], [AC_MSG_ERROR([library uhd is missing])])]) -AM_CONDITIONAL([HAVE_OUTPUT_UHD_TEST], [test "x$enable_output_uhd" = "xyes"]) - AX_BOOST_BASE([1.41.0], [], AC_MSG_ERROR([BOOST 1.41 or later is required])) AC_CHECK_LIB([boost_system], [main], [], [AC_MSG_ERROR([library boost_system is missing])]) AC_CHECK_LIB([boost_thread], [main], [], [AC_MSG_ERROR([library boost_thread is missing])]) diff --git a/src/Makefile.am b/src/Makefile.am index 635a3d8..922ce52 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -22,12 +22,6 @@ else GITVERSION_FLAGS = endif -if HAVE_OUTPUT_UHD_TEST -UHD_SOURCES = OutputUHD.cpp OutputUHD.h -else -UHD_SOURCES = -endif - if HAVE_SSE SIMD_CFLAGS = -msse -msse2 else @@ -92,7 +86,7 @@ odr_dabmod_SOURCES = DabMod.cpp \ OutputMemory.cpp OutputMemory.h \ OutputZeroMQ.cpp OutputZeroMQ.h \ TimestampDecoder.h TimestampDecoder.cpp \ - $(UHD_SOURCES) \ + OutputUHD.cpp OutputUHD.h \ ModOutput.cpp ModOutput.h \ InputMemory.cpp InputMemory.h \ InputFileReader.cpp InputZeroMQReader.cpp InputReader.h \ diff --git a/src/OutputUHD.cpp b/src/OutputUHD.cpp index 3d8eea6..8063e75 100644 --- a/src/OutputUHD.cpp +++ b/src/OutputUHD.cpp @@ -25,6 +25,9 @@ */ #include "OutputUHD.h" + +#ifdef HAVE_OUTPUT_UHD + #include "PcDebug.h" #include "Log.h" #include "RemoteControl.h" @@ -652,3 +655,4 @@ const string OutputUHD::get_parameter(const string& parameter) const return ss.str(); } +#endif // HAVE_OUTPUT_UHD diff --git a/src/OutputUHD.h b/src/OutputUHD.h index ef9740d..a2ffb7d 100644 --- a/src/OutputUHD.h +++ b/src/OutputUHD.h @@ -42,6 +42,8 @@ DESCRIPTION: # include #endif +#ifdef HAVE_OUTPUT_UHD + #include #include #include @@ -230,6 +232,7 @@ class OutputUHD: public ModOutput, public RemoteControllable { size_t lastLen; }; +#endif // HAVE_OUTPUT_UHD #endif // OUTPUT_UHD_H -- cgit v1.2.3