From bcf924ecc3962381e5bf14107d7cab2144a81c78 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Thu, 5 Feb 2015 17:58:37 +0100 Subject: Change autotools to "subdir-objects" and simplify --- Makefile.am | 148 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 146 insertions(+), 2 deletions(-) (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index c0b3024..b384024 100644 --- a/Makefile.am +++ b/Makefile.am @@ -18,8 +18,152 @@ # You should have received a copy of the GNU General Public License # along with ODR-DabMod. If not, see . -SUBDIRS = src lib - ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = COPYING NEWS README.md AUTHORS ChangeLog TODO doc + +if IS_GIT_REPO +GITVERSION_FLAGS = -DGITVERSION="\"`git describe`\"" +else +GITVERSION_FLAGS = +endif + +if HAVE_SSE +SIMD_CFLAGS = -msse -msse2 +else +SIMD_CFLAGS = +endif + +bin_PROGRAMS = odr-dabmod + +FFT_DIR=lib/kiss_fft129 +FFT_LDADD= + +if USE_KISS_FFT +FFT_INC=-I$(FFT_DIR) -I$(FFT_DIR)/tools +FFT_FLG=-ffast-math + +.PHONY: lib/kiss_fft129 + +BUILT_SOURCES=lib/kiss_fft129 + +lib/kiss_fft129: + if [ ! -e lib/kiss_fft129/kiss_fft.c ]; then \ + tar xzf lib/kiss_fft129.tar.gz -C lib; \ + fi + +nodist_odr_dabmod_SOURCES = lib/kiss_fft129/kiss_fft.c \ + lib/kiss_fft129/kiss_fft.h \ + lib/kiss_fft129/tools/kiss_fftr.c \ + lib/kiss_fft129/tools/kiss_fftr.h \ + src/kiss_fftsimd.c \ + src/kiss_fftsimd.h + +clean-local: + rm -rf $(FFT_DIR) + +else +FFT_INC= +FFT_FLG= +endif + +odr_dabmod_CPPFLAGS = -Wall \ + $(FFT_INC) $(FFT_FLG) $(SIMD_CFLAGS) $(GITVERSION_FLAGS) +odr_dabmod_LDADD = $(FFT_LDADD) +odr_dabmod_SOURCES = src/DabMod.cpp \ + src/PcDebug.h \ + src/porting.c \ + src/porting.h \ + src/DabModulator.cpp \ + src/DabModulator.h \ + src/Buffer.cpp \ + src/Buffer.h \ + src/ModCodec.cpp \ + src/ModCodec.h \ + src/ModPlugin.cpp \ + src/ModPlugin.h \ + src/ModFormat.cpp \ + src/ModFormat.h \ + src/EtiReader.cpp \ + src/EtiReader.h \ + src/Eti.cpp \ + src/Eti.h \ + src/FicSource.cpp \ + src/FicSource.h \ + src/FIRFilter.cpp \ + src/FIRFilter.h \ + src/ModInput.cpp \ + src/ModInput.h \ + src/PuncturingRule.cpp \ + src/PuncturingRule.h \ + src/PuncturingEncoder.cpp \ + src/PuncturingEncoder.h \ + src/SubchannelSource.cpp \ + src/SubchannelSource.h \ + src/Flowgraph.cpp \ + src/Flowgraph.h \ + src/GainControl.cpp \ + src/GainControl.h \ + src/OutputMemory.cpp \ + src/OutputMemory.h \ + src/OutputZeroMQ.cpp \ + src/OutputZeroMQ.h \ + src/TimestampDecoder.h \ + src/TimestampDecoder.cpp \ + src/OutputUHD.cpp \ + src/OutputUHD.h \ + src/ModOutput.cpp \ + src/ModOutput.h \ + src/InputMemory.cpp \ + src/InputMemory.h \ + src/InputFileReader.cpp \ + src/InputZeroMQReader.cpp \ + src/InputReader.h \ + src/OutputFile.cpp \ + src/OutputFile.h \ + src/FrameMultiplexer.cpp \ + src/FrameMultiplexer.h \ + src/ModMux.cpp \ + src/ModMux.h \ + src/PrbsGenerator.cpp \ + src/PrbsGenerator.h \ + src/BlockPartitioner.cpp \ + src/BlockPartitioner.h \ + src/QpskSymbolMapper.cpp \ + src/QpskSymbolMapper.h \ + src/FrequencyInterleaver.cpp \ + src/FrequencyInterleaver.h \ + src/PhaseReference.cpp \ + src/PhaseReference.h \ + src/DifferentialModulator.cpp \ + src/DifferentialModulator.h \ + src/NullSymbol.cpp \ + src/NullSymbol.h \ + src/SignalMultiplexer.cpp \ + src/SignalMultiplexer.h \ + src/CicEqualizer.cpp \ + src/CicEqualizer.h \ + src/OfdmGenerator.cpp \ + src/OfdmGenerator.h \ + src/GuardIntervalInserter.cpp \ + src/GuardIntervalInserter.h \ + src/Resampler.cpp \ + src/Resampler.h \ + src/ConvEncoder.cpp \ + src/ConvEncoder.h \ + src/TimeInterleaver.cpp \ + src/TimeInterleaver.h \ + src/ThreadsafeQueue.h \ + src/Log.cpp \ + src/Log.h \ + src/RemoteControl.cpp \ + src/RemoteControl.h \ + src/FormatConverter.cpp \ + src/FormatConverter.h \ + src/zmq.hpp + +dist_bin_SCRIPTS = src/crc-dwap.py + +EXTRA_DIST += lib/kiss_fft129.tar.gz +EXTRA_DIST += src/kiss_fftsimd.c src/kiss_fftsimd.h + -- cgit v1.2.3 From 1f7576701b54bf83d600780483017457841e830b Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Thu, 5 Feb 2015 19:22:50 +0100 Subject: Add -Isrc to CPPFLAGS --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index b384024..3f5d639 100644 --- a/Makefile.am +++ b/Makefile.am @@ -67,7 +67,7 @@ FFT_INC= FFT_FLG= endif -odr_dabmod_CPPFLAGS = -Wall \ +odr_dabmod_CPPFLAGS = -Wall -Isrc \ $(FFT_INC) $(FFT_FLG) $(SIMD_CFLAGS) $(GITVERSION_FLAGS) odr_dabmod_LDADD = $(FFT_LDADD) odr_dabmod_SOURCES = src/DabMod.cpp \ -- cgit v1.2.3 From 7bacaf3818494cf706f7372cb6cd194dbaf3f251 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Thu, 12 Feb 2015 10:43:06 +0100 Subject: Move some code from DabMod into Utils --- Makefile.am | 7 +++- src/DabMod.cpp | 90 +------------------------------------------ src/Utils.cpp | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/Utils.h | 44 +++++++++++++++++++++ 4 files changed, 171 insertions(+), 89 deletions(-) create mode 100644 src/Utils.cpp create mode 100644 src/Utils.h (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index 3f5d639..fa8afd0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,10 @@ # Copyright (C) 2007, 2008, 2009, 2010 Her Majesty the Queen in Right # of Canada (Communications Research Center Canada) # -# Copyright (C) 2014 Matthias P. Braendli, http://mpb.li +# Copyright (C) 2014, 2015 +# Matthias P. Braendli, matthias.braendli@mpb.li + +# http://opendigitalradio.org # This file is part of ODR-DabMod. # @@ -160,6 +163,8 @@ odr_dabmod_SOURCES = src/DabMod.cpp \ src/RemoteControl.h \ src/FormatConverter.cpp \ src/FormatConverter.h \ + src/Utils.cpp \ + src/Utils.h \ src/zmq.hpp dist_bin_SCRIPTS = src/crc-dwap.py diff --git a/src/DabMod.cpp b/src/DabMod.cpp index 77e5da4..1bbfc99 100644 --- a/src/DabMod.cpp +++ b/src/DabMod.cpp @@ -3,7 +3,7 @@ Her Majesty the Queen in Right of Canada (Communications Research Center Canada) - Copyright (C) 2014 + Copyright (C) 2014, 2015 Matthias P. Braendli, matthias.braendli@mpb.li http://opendigitalradio.org @@ -30,7 +30,7 @@ #endif #include "porting.h" - +#include "Utils.h" #include "Log.h" #include "DabModulator.h" #include "InputMemory.h" @@ -81,92 +81,6 @@ void signalHandler(int signalNb) running = 0; } - -void printUsage(char* progName, FILE* out = stderr) -{ - fprintf(out, "Welcome to %s %s, compiled at %s, %s\n\n", - PACKAGE, -#if defined(GITVERSION) - GITVERSION, -#else - VERSION, -#endif - __DATE__, __TIME__); - fprintf(out, "Usage with configuration file:\n"); - fprintf(out, "\t%s [-C] config_file.ini\n\n", progName); - - fprintf(out, "Usage with command line options:\n"); - fprintf(out, "\t%s" - " input" - " (-f filename | -u uhddevice -F frequency) " - " [-G txgain]" - " [-o offset]" - " [-O offsetfile]" - " [-T filter_taps_file]" - " [-a gain]" - " [-c clockrate]" - " [-g gainMode]" - " [-h]" - " [-l]" - " [-m dabMode]" - " [-r samplingRate]" - "\n", progName); - fprintf(out, "Where:\n"); - fprintf(out, "input: ETI input filename (default: stdin).\n"); - fprintf(out, "-f name: Use file output with given filename. (use /dev/stdout for standard output)\n"); - fprintf(out, "-u device: Use UHD output with given device string. (use "" for default device)\n"); - fprintf(out, "-F frequency: Set the transmit frequency when using UHD output. (mandatory option when using UHD)\n"); - fprintf(out, "-G txgain: Set the transmit gain for the UHD driver (default: 0)\n"); - fprintf(out, "-o: (UHD only) Set the timestamp offset added to the timestamp in the ETI. The offset is a double.\n"); - fprintf(out, "-O: (UHD only) Set the file containing the timestamp offset added to the timestamp in the ETI.\n" - "The file is read every six seconds, and must contain a double value.\n"); - fprintf(out, " Specifying either -o or -O has two implications: It enables synchronous transmission,\n" - " requiring an external REFCLK and PPS signal and frames that do not contain a valid timestamp\n" - " get muted.\n\n"); - fprintf(out, "-T taps_file: Enable filtering before the output, using the specified file containing the filter taps.\n"); - fprintf(out, "-a gain: Apply digital amplitude gain.\n"); - fprintf(out, "-c rate: Set the DAC clock rate and enable Cic Equalisation.\n"); - fprintf(out, "-g: Set computation gain mode: " - "%u FIX, %u MAX, %u VAR\n", GAIN_FIX, GAIN_MAX, GAIN_VAR); - fprintf(out, "-h: Print this help.\n"); - fprintf(out, "-l: Loop file when reach end of file.\n"); - fprintf(out, "-m mode: Set DAB mode: (0: auto, 1-4: force).\n"); - fprintf(out, "-r rate: Set output sampling rate (default: 2048000).\n"); -} - - -void printVersion(FILE *out = stderr) -{ - fprintf(out, "Welcome to %s %s, compiled at %s, %s\n\n", - PACKAGE, VERSION, __DATE__, __TIME__); - fprintf(out, - " ODR-DabMod is copyright (C) Her Majesty the Queen in Right of Canada,\n" - " 2009, 2010, 2011, 2012 Communications Research Centre (CRC),\n" - " and\n" - " Copyright (C) 2014 Matthias P. Braendli, matthias.braendli@mpb.li\n" - "\n" - " http://opendigitalradio.org\n" - "\n" - " This program is available free of charge and is licensed to you on a\n" - " non-exclusive basis; you may not redistribute it.\n" - "\n" - " This program is provided \"AS IS\" in the hope that it will be useful, but\n" - " WITHOUT ANY WARRANTY with respect to its accurancy or usefulness; witout\n" - " even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n" - " PURPOSE and NONINFRINGEMENT.\n" - "\n" - " In no event shall CRC be LIABLE for any LOSS, DAMAGE or COST that may be\n" - " incurred in connection with the use of this software.\n" - "\n" -#if USE_KISS_FFT - "ODR-DabMod makes use of the following open source packages:\n" - " Kiss FFT v1.2.9 (Revised BSD) - http://kissfft.sourceforge.net/\n" -#endif - ); - -} - - int main(int argc, char* argv[]) { int ret = 0; diff --git a/src/Utils.cpp b/src/Utils.cpp new file mode 100644 index 0000000..5c80eee --- /dev/null +++ b/src/Utils.cpp @@ -0,0 +1,119 @@ +/* + Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 + Her Majesty the Queen in Right of Canada (Communications Research + Center Canada) + + Copyright (C) 2015 + Matthias P. Braendli, matthias.braendli@mpb.li + + http://opendigitalradio.org + */ +/* + This file is part of ODR-DabMod. + + ODR-DabMod is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + ODR-DabMod is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with ODR-DabMod. If not, see . + */ + +#include "Utils.h" +#include "GainControl.h" + +void printUsage(char* progName) +{ + FILE* out = stderr; + + fprintf(out, "Welcome to %s %s, compiled at %s, %s\n\n", + PACKAGE, +#if defined(GITVERSION) + GITVERSION, +#else + VERSION, +#endif + __DATE__, __TIME__); + fprintf(out, "Usage with configuration file:\n"); + fprintf(out, "\t%s [-C] config_file.ini\n\n", progName); + + fprintf(out, "Usage with command line options:\n"); + fprintf(out, "\t%s" + " input" + " (-f filename | -u uhddevice -F frequency) " + " [-G txgain]" + " [-o offset]" + " [-O offsetfile]" + " [-T filter_taps_file]" + " [-a gain]" + " [-c clockrate]" + " [-g gainMode]" + " [-h]" + " [-l]" + " [-m dabMode]" + " [-r samplingRate]" + "\n", progName); + fprintf(out, "Where:\n"); + fprintf(out, "input: ETI input filename (default: stdin).\n"); + fprintf(out, "-f name: Use file output with given filename. (use /dev/stdout for standard output)\n"); + fprintf(out, "-u device: Use UHD output with given device string. (use "" for default device)\n"); + fprintf(out, "-F frequency: Set the transmit frequency when using UHD output. (mandatory option when using UHD)\n"); + fprintf(out, "-G txgain: Set the transmit gain for the UHD driver (default: 0)\n"); + fprintf(out, "-o: (UHD only) Set the timestamp offset added to the timestamp in the ETI. The offset is a double.\n"); + fprintf(out, "-O: (UHD only) Set the file containing the timestamp offset added to the timestamp in the ETI.\n" + "The file is read every six seconds, and must contain a double value.\n"); + fprintf(out, " Specifying either -o or -O has two implications: It enables synchronous transmission,\n" + " requiring an external REFCLK and PPS signal and frames that do not contain a valid timestamp\n" + " get muted.\n\n"); + fprintf(out, "-T taps_file: Enable filtering before the output, using the specified file containing the filter taps.\n"); + fprintf(out, "-a gain: Apply digital amplitude gain.\n"); + fprintf(out, "-c rate: Set the DAC clock rate and enable Cic Equalisation.\n"); + fprintf(out, "-g: Set computation gain mode: " + "%u FIX, %u MAX, %u VAR\n", GAIN_FIX, GAIN_MAX, GAIN_VAR); + fprintf(out, "-h: Print this help.\n"); + fprintf(out, "-l: Loop file when reach end of file.\n"); + fprintf(out, "-m mode: Set DAB mode: (0: auto, 1-4: force).\n"); + fprintf(out, "-r rate: Set output sampling rate (default: 2048000).\n"); +} + + +void printVersion(void) +{ + FILE *out = stderr; + + fprintf(out, "Welcome to %s %s, compiled at %s, %s\n\n", + PACKAGE, VERSION, __DATE__, __TIME__); + fprintf(out, + " ODR-DabMod is copyright (C) Her Majesty the Queen in Right of Canada,\n" + " 2009, 2010, 2011, 2012 Communications Research Centre (CRC),\n" + " and\n" + " Copyright (C) 2014 Matthias P. Braendli, matthias.braendli@mpb.li\n" + "\n" + " http://opendigitalradio.org\n" + "\n" + " This program is available free of charge and is licensed to you on a\n" + " non-exclusive basis; you may not redistribute it.\n" + "\n" + " This program is provided \"AS IS\" in the hope that it will be useful, but\n" + " WITHOUT ANY WARRANTY with respect to its accurancy or usefulness; witout\n" + " even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n" + " PURPOSE and NONINFRINGEMENT.\n" + "\n" + " In no event shall CRC be LIABLE for any LOSS, DAMAGE or COST that may be\n" + " incurred in connection with the use of this software.\n" + "\n" +#if USE_KISS_FFT + "ODR-DabMod makes use of the following open source packages:\n" + " Kiss FFT v1.2.9 (Revised BSD) - http://kissfft.sourceforge.net/\n" +#endif + ); + +} + + diff --git a/src/Utils.h b/src/Utils.h new file mode 100644 index 0000000..7c3129c --- /dev/null +++ b/src/Utils.h @@ -0,0 +1,44 @@ +/* + Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 + Her Majesty the Queen in Right of Canada (Communications Research + Center Canada) + + Copyright (C) 2015 + Matthias P. Braendli, matthias.braendli@mpb.li + + http://opendigitalradio.org + */ +/* + This file is part of ODR-DabMod. + + ODR-DabMod is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + ODR-DabMod is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with ODR-DabMod. If not, see . + */ + +#ifndef __UTILS_H_ +#define __UTILS_H_ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include +#include + +void printUsage(char* progName); + +void printVersion(void); + +#endif + -- cgit v1.2.3