aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--configure.ac1
-rw-r--r--src/Makefile.am40
-rw-r--r--src/amps/Makefile.am9
-rw-r--r--src/anetz/Makefile.am9
-rw-r--r--src/bnetz/Makefile.am9
-rw-r--r--src/cnetz/Makefile.am9
-rw-r--r--src/common/Makefile.am22
-rw-r--r--src/common/main_mobile.c4
-rw-r--r--src/common/sender.h2
-rw-r--r--src/jtacs/Makefile.am9
-rw-r--r--src/libimage/Makefile.am2
-rw-r--r--src/libsdr/Makefile.am26
-rw-r--r--src/libsdr/display_iq.c (renamed from src/common/display_iq.c)4
-rw-r--r--src/libsdr/display_spectrum.c (renamed from src/common/display_spectrum.c)4
-rw-r--r--src/libsdr/sdr.c (renamed from src/common/sdr.c)44
-rw-r--r--src/libsdr/sdr.h (renamed from src/common/sdr.h)0
-rw-r--r--src/libsdr/sdr_config.c (renamed from src/common/sdr_config.c)2
-rw-r--r--src/libsdr/sdr_config.h (renamed from src/common/sdr_config.h)0
-rw-r--r--src/libsdr/soapy.c (renamed from src/common/soapy.c)6
-rw-r--r--src/libsdr/soapy.h (renamed from src/common/soapy.h)0
-rw-r--r--src/libsdr/uhd.c (renamed from src/common/uhd.c)6
-rw-r--r--src/libsdr/uhd.h (renamed from src/common/uhd.h)0
-rw-r--r--src/nmt/Makefile.am7
-rw-r--r--src/r2000/Makefile.am7
-rw-r--r--src/tacs/Makefile.am9
-rw-r--r--src/test/Makefile.am36
-rw-r--r--src/tv/Makefile.am15
-rw-r--r--src/tv/main.c4
29 files changed, 205 insertions, 82 deletions
diff --git a/.gitignore b/.gitignore
index 5a7ad4e..88eaa4f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,6 +38,7 @@ src/libwave/libwave.a
src/libfft/libfft.a
src/libmncc/libmncc.a
src/libsound/libsound.a
+src/libsdr/libsdr.a
src/common/libcommon.a
src/common/libmobile.a
src/anetz/libgermanton.a
diff --git a/configure.ac b/configure.ac
index 8a4e745..515a874 100644
--- a/configure.ac
+++ b/configure.ac
@@ -93,6 +93,7 @@ AC_OUTPUT(
src/libfft/Makefile
src/libmncc/Makefile
src/libsound/Makefile
+ src/libsdr/Makefile
src/common/Makefile
src/anetz/Makefile
src/bnetz/Makefile
diff --git a/src/Makefile.am b/src/Makefile.am
index 9b0653e..17f4565 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,3 +1,41 @@
AUTOMAKE_OPTIONS = foreign
-SUBDIRS = libsound libimage libcompandor libgoertzel libjitter libsquelch libhagelbarger libdtmf libtimer libsamplerate libscrambler libemphasis libfsk libfm libfilter libwave libfft libmncc common anetz bnetz cnetz nmt amps tacs jtacs r2000 tv test
+
+SUBDIRS = \
+ libimage \
+ libcompandor \
+ libgoertzel \
+ libjitter \
+ libsquelch \
+ libhagelbarger \
+ libdtmf \
+ libtimer \
+ libsamplerate \
+ libscrambler \
+ libemphasis \
+ libfsk \
+ libfm \
+ libfilter \
+ libwave \
+ libfft \
+ libmncc \
+ libsound
+
+if HAVE_SDR
+SUBDIRS += \
+ libsdr
+endif
+
+SUBDIRS += \
+ common \
+ anetz \
+ bnetz \
+ cnetz \
+ nmt \
+ amps \
+ tacs \
+ jtacs \
+ r2000 \
+ tv \
+ test
+
diff --git a/src/amps/Makefile.am b/src/amps/Makefile.am
index c2fe952..1f384d5 100644
--- a/src/amps/Makefile.am
+++ b/src/amps/Makefile.am
@@ -34,10 +34,8 @@ amps_LDADD = \
$(top_builddir)/src/libtimer/libtimer.a \
$(top_builddir)/src/libsamplerate/libsamplerate.a \
$(top_builddir)/src/libemphasis/libemphasis.a \
- $(top_builddir)/src/libfm/libfm.a \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
- $(top_builddir)/src/libfft/libfft.a \
$(top_builddir)/src/libmncc/libmncc.a \
$(top_builddir)/src/libsound/libsound.a \
$(ALSA_LIBS) \
@@ -45,3 +43,10 @@ amps_LDADD = \
$(SOAPY_LIBS) \
-lm
+if HAVE_SDR
+amps_LDADD += \
+ $(top_builddir)/src/libsdr/libsdr.a \
+ $(top_builddir)/src/libfft/libfft.a \
+ $(top_builddir)/src/libfm/libfm.a
+endif
+
diff --git a/src/anetz/Makefile.am b/src/anetz/Makefile.am
index 5c9c8d6..9ff905e 100644
--- a/src/anetz/Makefile.am
+++ b/src/anetz/Makefile.am
@@ -26,10 +26,8 @@ anetz_LDADD = \
$(top_builddir)/src/libtimer/libtimer.a \
$(top_builddir)/src/libsamplerate/libsamplerate.a \
$(top_builddir)/src/libemphasis/libemphasis.a \
- $(top_builddir)/src/libfm/libfm.a \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
- $(top_builddir)/src/libfft/libfft.a \
$(top_builddir)/src/libmncc/libmncc.a \
$(top_builddir)/src/libsound/libsound.a \
$(ALSA_LIBS) \
@@ -37,3 +35,10 @@ anetz_LDADD = \
$(SOAPY_LIBS) \
-lm
+if HAVE_SDR
+anetz_LDADD += \
+ $(top_builddir)/src/libsdr/libsdr.a \
+ $(top_builddir)/src/libfft/libfft.a \
+ $(top_builddir)/src/libfm/libfm.a
+endif
+
diff --git a/src/bnetz/Makefile.am b/src/bnetz/Makefile.am
index 88f7a44..922e8fb 100644
--- a/src/bnetz/Makefile.am
+++ b/src/bnetz/Makefile.am
@@ -22,10 +22,8 @@ bnetz_LDADD = \
$(top_builddir)/src/libsamplerate/libsamplerate.a \
$(top_builddir)/src/libemphasis/libemphasis.a \
$(top_builddir)/src/libfsk/libfsk.a \
- $(top_builddir)/src/libfm/libfm.a \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
- $(top_builddir)/src/libfft/libfft.a \
$(top_builddir)/src/libmncc/libmncc.a \
$(top_builddir)/src/libsound/libsound.a \
$(ALSA_LIBS) \
@@ -33,3 +31,10 @@ bnetz_LDADD = \
$(SOAPY_LIBS) \
-lm
+if HAVE_SDR
+bnetz_LDADD += \
+ $(top_builddir)/src/libsdr/libsdr.a \
+ $(top_builddir)/src/libfft/libfft.a \
+ $(top_builddir)/src/libfm/libfm.a
+endif
+
diff --git a/src/cnetz/Makefile.am b/src/cnetz/Makefile.am
index e01c685..95b83d4 100644
--- a/src/cnetz/Makefile.am
+++ b/src/cnetz/Makefile.am
@@ -25,10 +25,8 @@ cnetz_LDADD = \
$(top_builddir)/src/libsamplerate/libsamplerate.a \
$(top_builddir)/src/libscrambler/libscrambler.a \
$(top_builddir)/src/libemphasis/libemphasis.a \
- $(top_builddir)/src/libfm/libfm.a \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
- $(top_builddir)/src/libfft/libfft.a \
$(top_builddir)/src/libmncc/libmncc.a \
$(top_builddir)/src/libsound/libsound.a \
$(ALSA_LIBS) \
@@ -36,3 +34,10 @@ cnetz_LDADD = \
$(SOAPY_LIBS) \
-lm
+if HAVE_SDR
+cnetz_LDADD += \
+ $(top_builddir)/src/libsdr/libsdr.a \
+ $(top_builddir)/src/libfft/libfft.a \
+ $(top_builddir)/src/libfm/libfm.a
+endif
+
diff --git a/src/common/Makefile.am b/src/common/Makefile.am
index 6d1e07b..9abad04 100644
--- a/src/common/Makefile.am
+++ b/src/common/Makefile.am
@@ -1,4 +1,4 @@
-AM_CPPFLAGS = -Wall -Wextra -g $(all_includes) $(GRAPHICSMAGICK_CFLAGS) $(IMAGEMAGICK_CFLAGS) $(UHD_CFLAGS) $(SOAPY_CFLAGS)
+AM_CPPFLAGS = -Wall -Wextra -g $(all_includes)
noinst_LIBRARIES = libcommon.a libmobile.a
@@ -16,25 +16,5 @@ libmobile_a_SOURCES = \
if HAVE_SDR
AM_CPPFLAGS += -DHAVE_SDR
-
-libcommon_a_SOURCES += \
- sdr_config.c \
- sdr.c \
- display_iq.c \
- display_spectrum.c
-endif
-
-if HAVE_UHD
-AM_CPPFLAGS += -DHAVE_UHD
-
-libcommon_a_SOURCES += \
- uhd.c
-endif
-
-if HAVE_SOAPY
-AM_CPPFLAGS += -DHAVE_SOAPY
-
-libcommon_a_SOURCES += \
- soapy.c
endif
diff --git a/src/common/main_mobile.c b/src/common/main_mobile.c
index 7516bba..b4f9343 100644
--- a/src/common/main_mobile.c
+++ b/src/common/main_mobile.c
@@ -39,8 +39,8 @@
#include "../libmncc/mncc_sock.h"
#include "../libmncc/mncc_cross.h"
#ifdef HAVE_SDR
-#include "sdr.h"
-#include "sdr_config.h"
+#include "../libsdr/sdr.h"
+#include "../libsdr/sdr_config.h"
#endif
static int got_init = 0;
diff --git a/src/common/sender.h b/src/common/sender.h
index 22a23a1..12a17c9 100644
--- a/src/common/sender.h
+++ b/src/common/sender.h
@@ -1,6 +1,6 @@
#include "../libsound/sound.h"
#ifdef HAVE_SDR
-#include "sdr.h"
+#include "../libsdr/sdr.h"
#endif
#include "../libwave/wave.h"
#include "../libsamplerate/samplerate.h"
diff --git a/src/jtacs/Makefile.am b/src/jtacs/Makefile.am
index 61e7a44..c6a231e 100644
--- a/src/jtacs/Makefile.am
+++ b/src/jtacs/Makefile.am
@@ -20,10 +20,8 @@ jtacs_LDADD = \
$(top_builddir)/src/libtimer/libtimer.a \
$(top_builddir)/src/libsamplerate/libsamplerate.a \
$(top_builddir)/src/libemphasis/libemphasis.a \
- $(top_builddir)/src/libfm/libfm.a \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
- $(top_builddir)/src/libfft/libfft.a \
$(top_builddir)/src/libmncc/libmncc.a \
$(top_builddir)/src/libsound/libsound.a \
$(ALSA_LIBS) \
@@ -31,3 +29,10 @@ jtacs_LDADD = \
$(SOAPY_LIBS) \
-lm
+if HAVE_SDR
+jtacs_LDADD += \
+ $(top_builddir)/src/libsdr/libsdr.a \
+ $(top_builddir)/src/libfft/libfft.a \
+ $(top_builddir)/src/libfm/libfm.a
+endif
+
diff --git a/src/libimage/Makefile.am b/src/libimage/Makefile.am
index 7805bbe..ed9041c 100644
--- a/src/libimage/Makefile.am
+++ b/src/libimage/Makefile.am
@@ -1,4 +1,4 @@
-AM_CPPFLAGS = -Wall -Wextra -g $(all_includes)
+AM_CPPFLAGS = -Wall -Wextra -g $(all_includes) $(GRAPHICSMAGICK_CFLAGS) $(IMAGEMAGICK_CFLAGS)
noinst_LIBRARIES = libimage.a
diff --git a/src/libsdr/Makefile.am b/src/libsdr/Makefile.am
new file mode 100644
index 0000000..5a00457
--- /dev/null
+++ b/src/libsdr/Makefile.am
@@ -0,0 +1,26 @@
+AM_CPPFLAGS = -Wall -Wextra -g $(all_includes)
+
+noinst_LIBRARIES = libsdr.a
+
+libsdr_a_SOURCES = \
+dd sdr_config.c \
+ sdr.c \
+ display_iq.c \
+ display_spectrum.c
+
+AM_CPPFLAGS += -DHAVE_SDR
+
+if HAVE_UHD
+AM_CPPFLAGS += -DHAVE_UHD
+
+libsdr_a_SOURCES += \
+ uhd.c
+endif
+
+if HAVE_SOAPY
+AM_CPPFLAGS += -DHAVE_SOAPY
+
+libsdr_a_SOURCES += \
+ soapy.c
+endif
+
diff --git a/src/common/display_iq.c b/src/libsdr/display_iq.c
index c63a455..350d076 100644
--- a/src/common/display_iq.c
+++ b/src/libsdr/display_iq.c
@@ -23,8 +23,8 @@
#include <math.h>
#include <pthread.h>
#include <stdlib.h>
-#include "sample.h"
-#include "sender.h"
+#include "../common/sample.h"
+#include "../common/sender.h"
/* must be odd value! */
#define SIZE 23
diff --git a/src/common/display_spectrum.c b/src/libsdr/display_spectrum.c
index 80af735..6c60237 100644
--- a/src/common/display_spectrum.c
+++ b/src/libsdr/display_spectrum.c
@@ -22,8 +22,8 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
-#include "sample.h"
-#include "sender.h"
+#include "../common/sample.h"
+#include "../common/sender.h"
#include "../libfft/fft.h"
#define HEIGHT 20
diff --git a/src/common/sdr.c b/src/libsdr/sdr.c
index d7a445b..69e07c1 100644
--- a/src/common/sdr.c
+++ b/src/libsdr/sdr.c
@@ -29,10 +29,10 @@ enum paging_signal;
#define __USE_GNU
#include <pthread.h>
#include <unistd.h>
-#include "sample.h"
+#include "../common/sample.h"
#include "../libfm/fm.h"
#include "../libtimer/timer.h"
-#include "sender.h"
+#include "../common/sender.h"
#include "sdr_config.h"
#include "sdr.h"
#ifdef HAVE_UHD
@@ -41,7 +41,7 @@ enum paging_signal;
#ifdef HAVE_SOAPY
#include "soapy.h"
#endif
-#include "debug.h"
+#include "../common/debug.h"
/* enable to debug buffer handling */
//#define DEBUG_BUFFER
@@ -52,6 +52,8 @@ enum paging_signal;
/* usable bandwidth of IQ rate, because no filter is perfect */
#define USABLE_BANDWIDTH 0.75
+int sdr_rx_overflow = 0;
+
typedef struct sdr_thread {
int use;
volatile int running, exit; /* flags to control exit of threads */
@@ -399,17 +401,6 @@ static void *sdr_write_child(void *arg)
while (sdr->thread_write.running) {
/* write to SDR */
fill = (sdr->thread_write.in - sdr->thread_write.out + sdr->thread_write.buffer_size) % sdr->thread_write.buffer_size;
- if (fill > sdr->thread_write.max_fill)
- sdr->thread_write.max_fill = fill;
- if (sdr->thread_write.max_fill_timer == 0.0)
- sdr->thread_write.max_fill_timer = get_time();
- if (get_time() - sdr->thread_write.max_fill_timer > 1.0) {
- double delay;
- delay = (double)sdr->thread_write.max_fill / 2.0 / (double)sdr->samplerate;
- sdr->thread_write.max_fill = 0;
- sdr->thread_write.max_fill_timer += 1.0;
- PDEBUG(DSDR, DEBUG_DEBUG, "write delay = %.3f ms\n", delay * 1000.0);
- }
num = fill / 2;
if (num) {
#ifdef DEBUG_BUFFER
@@ -668,9 +659,24 @@ int sdr_write(void *inst, sample_t **samples, uint8_t **power, int num, enum pag
if (sdr->threads) {
/* store data towards SDR in ring buffer */
- int space, in;
+ int fill, space, in;
+ fill = (sdr->thread_write.in - sdr->thread_write.out + sdr->thread_write.buffer_size) % sdr->thread_write.buffer_size;
space = (sdr->thread_write.out - sdr->thread_write.in - 2 + sdr->thread_write.buffer_size) % sdr->thread_write.buffer_size;
+
+ /* debug fill level */
+ if (fill > sdr->thread_write.max_fill)
+ sdr->thread_write.max_fill = fill;
+ if (sdr->thread_write.max_fill_timer == 0.0)
+ sdr->thread_write.max_fill_timer = get_time();
+ if (get_time() - sdr->thread_write.max_fill_timer > 1.0) {
+ double delay;
+ delay = (double)sdr->thread_write.max_fill / 2.0 / (double)sdr->samplerate;
+ sdr->thread_write.max_fill = 0;
+ sdr->thread_write.max_fill_timer += 1.0;
+ PDEBUG(DSDR, DEBUG_DEBUG, "write delay = %.3f ms\n", delay * 1000.0);
+ }
+
if (space < num * 2) {
PDEBUG(DSDR, DEBUG_ERROR, "Write SDR buffer overflow!\n");
num = space / 2;
@@ -725,6 +731,8 @@ int sdr_read(void *inst, sample_t **samples, int num, int channels, double *rf_l
int fill, out;
fill = (sdr->thread_read.in - sdr->thread_read.out + sdr->thread_read.buffer_size) % sdr->thread_read.buffer_size;
+
+ /* debug fill level */
if (fill > sdr->thread_read.max_fill)
sdr->thread_read.max_fill = fill;
if (sdr->thread_read.max_fill_timer == 0.0)
@@ -736,6 +744,7 @@ int sdr_read(void *inst, sample_t **samples, int num, int channels, double *rf_l
sdr->thread_read.max_fill_timer += 1.0;
PDEBUG(DSDR, DEBUG_DEBUG, "read delay = %.3f ms\n", delay * 1000.0);
}
+
if (fill / 2 / sdr->oversample < num)
num = fill / 2 / sdr->oversample;
#ifdef DEBUG_BUFFER
@@ -762,6 +771,11 @@ int sdr_read(void *inst, sample_t **samples, int num, int channels, double *rf_l
return count;
}
+ if (sdr_rx_overflow) {
+ PDEBUG(DSDR, DEBUG_ERROR, "SDR RX overflow!\n");
+ sdr_rx_overflow = 0;
+ }
+
if (sdr->wave_rx_rec.fp) {
sample_t *spl_list[2] = { sdr->wavespl0, sdr->wavespl1 };
for (s = 0, ss = 0; s < count; s++) {
diff --git a/src/common/sdr.h b/src/libsdr/sdr.h
index 360f424..360f424 100644
--- a/src/common/sdr.h
+++ b/src/libsdr/sdr.h
diff --git a/src/common/sdr_config.c b/src/libsdr/sdr_config.c
index 4a49bae..0ab24bf 100644
--- a/src/common/sdr_config.c
+++ b/src/libsdr/sdr_config.c
@@ -24,7 +24,7 @@ enum paging_signal;
#include <string.h>
#include <stdint.h>
#include <getopt.h>
-#include "sample.h"
+#include "../common/sample.h"
#include "sdr.h"
#include "sdr_config.h"
diff --git a/src/common/sdr_config.h b/src/libsdr/sdr_config.h
index b64424d..b64424d 100644
--- a/src/common/sdr_config.h
+++ b/src/libsdr/sdr_config.h
diff --git a/src/common/soapy.c b/src/libsdr/soapy.c
index e5d10de..5def101 100644
--- a/src/common/soapy.c
+++ b/src/libsdr/soapy.c
@@ -26,7 +26,9 @@
#include <SoapySDR/Device.h>
#include <SoapySDR/Formats.h>
#include "soapy.h"
-#include "debug.h"
+#include "../common/debug.h"
+
+extern int sdr_rx_overflow;
static SoapySDRDevice *sdr = NULL;
SoapySDRStream *rxStream = NULL;
@@ -413,7 +415,7 @@ int soapy_receive(float *buff, int max)
while (1) {
if (max < rx_samps_per_buff) {
/* no more space this time */
- PDEBUG(DSOAPY, DEBUG_ERROR, "SDR RX overflow!\n");
+ sdr_rx_overflow = 1;
break;
}
/* read RX stream */
diff --git a/src/common/soapy.h b/src/libsdr/soapy.h
index 702890b..702890b 100644
--- a/src/common/soapy.h
+++ b/src/libsdr/soapy.h
diff --git a/src/common/uhd.c b/src/libsdr/uhd.c
index e79b1f7..185fdf6 100644
--- a/src/common/uhd.c
+++ b/src/libsdr/uhd.c
@@ -25,11 +25,13 @@
#include <uhd.h>
#include <uhd/usrp/usrp.h>
#include "uhd.h"
-#include "debug.h"
+#include "../common/debug.h"
/* use to TX time stamp */
//#define TX_TIMESTAMP
+extern int sdr_rx_overflow;
+
static uhd_usrp_handle usrp = NULL;
static uhd_tx_streamer_handle tx_streamer = NULL;
static uhd_rx_streamer_handle rx_streamer = NULL;
@@ -519,7 +521,7 @@ int uhd_receive(float *buff, int max)
while (1) {
if (max < (int)rx_samps_per_buff) {
/* no more space this time */
- PDEBUG(DUHD, DEBUG_ERROR, "SDR RX overflow!\n");
+ sdr_rx_overflow = 1;
break;
}
/* read RX stream */
diff --git a/src/common/uhd.h b/src/libsdr/uhd.h
index 60eb94f..60eb94f 100644
--- a/src/common/uhd.h
+++ b/src/libsdr/uhd.h
diff --git a/src/nmt/Makefile.am b/src/nmt/Makefile.am
index d6ad99c..2c425ad 100644
--- a/src/nmt/Makefile.am
+++ b/src/nmt/Makefile.am
@@ -36,7 +36,6 @@ nmt_LDADD = \
$(top_builddir)/src/libfm/libfm.a \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
- $(top_builddir)/src/libfft/libfft.a \
$(top_builddir)/src/libmncc/libmncc.a \
$(top_builddir)/src/libsound/libsound.a \
$(ALSA_LIBS) \
@@ -44,3 +43,9 @@ nmt_LDADD = \
$(SOAPY_LIBS) \
-lm
+if HAVE_SDR
+nmt_LDADD += \
+ $(top_builddir)/src/libsdr/libsdr.a \
+ $(top_builddir)/src/libfft/libfft.a
+endif
+
diff --git a/src/r2000/Makefile.am b/src/r2000/Makefile.am
index 4066ff7..0b95757 100644
--- a/src/r2000/Makefile.am
+++ b/src/r2000/Makefile.am
@@ -24,7 +24,6 @@ radiocom2000_LDADD = \
$(top_builddir)/src/libfm/libfm.a \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
- $(top_builddir)/src/libfft/libfft.a \
$(top_builddir)/src/libmncc/libmncc.a \
$(top_builddir)/src/libsound/libsound.a \
$(ALSA_LIBS) \
@@ -32,3 +31,9 @@ radiocom2000_LDADD = \
$(SOAPY_LIBS) \
-lm
+if HAVE_SDR
+radiocom2000_LDADD += \
+ $(top_builddir)/src/libsdr/libsdr.a \
+ $(top_builddir)/src/libfft/libfft.a
+endif
+
diff --git a/src/tacs/Makefile.am b/src/tacs/Makefile.am
index 62d681f..1d6d43a 100644
--- a/src/tacs/Makefile.am
+++ b/src/tacs/Makefile.am
@@ -21,10 +21,8 @@ tacs_LDADD = \
$(top_builddir)/src/libtimer/libtimer.a \
$(top_builddir)/src/libsamplerate/libsamplerate.a \
$(top_builddir)/src/libemphasis/libemphasis.a \
- $(top_builddir)/src/libfm/libfm.a \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
- $(top_builddir)/src/libfft/libfft.a \
$(top_builddir)/src/libmncc/libmncc.a \
$(top_builddir)/src/libsound/libsound.a \
$(ALSA_LIBS) \
@@ -32,3 +30,10 @@ tacs_LDADD = \
$(SOAPY_LIBS) \
-lm
+if HAVE_SDR
+tacs_LDADD += \
+ $(top_builddir)/src/libsdr/libsdr.a \
+ $(top_builddir)/src/libfft/libfft.a \
+ $(top_builddir)/src/libfm/libfm.a
+endif
+
diff --git a/src/test/Makefile.am b/src/test/Makefile.am
index dfdfd5f..6e1b2bf 100644
--- a/src/test/Makefile.am
+++ b/src/test/Makefile.am
@@ -19,10 +19,8 @@ test_filter_LDADD = \
$(top_builddir)/src/libtimer/libtimer.a \
$(top_builddir)/src/libsamplerate/libsamplerate.a \
$(top_builddir)/src/libemphasis/libemphasis.a \
- $(top_builddir)/src/libfm/libfm.a \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
- $(top_builddir)/src/libfft/libfft.a \
$(top_builddir)/src/libmncc/libmncc.a \
$(top_builddir)/src/libsound/libsound.a \
$(ALSA_LIBS) \
@@ -30,6 +28,13 @@ test_filter_LDADD = \
$(SOAPY_LIBS) \
-lm
+if HAVE_SDR
+test_filter_LDADD += \
+ $(top_builddir)/src/libsdr/libsdr.a \
+ $(top_builddir)/src/libfft/libfft.a \
+ $(top_builddir)/src/libfm/libfm.a
+endif
+
test_compandor_SOURCES = dummy.x test_compandor.c
test_compandor_LDADD = \
@@ -52,10 +57,8 @@ test_emphasis_LDADD = \
$(top_builddir)/src/libtimer/libtimer.a \
$(top_builddir)/src/libsamplerate/libsamplerate.a \
$(top_builddir)/src/libemphasis/libemphasis.a \
- $(top_builddir)/src/libfm/libfm.a \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
- $(top_builddir)/src/libfft/libfft.a \
$(top_builddir)/src/libmncc/libmncc.a \
$(top_builddir)/src/libsound/libsound.a \
$(ALSA_LIBS) \
@@ -63,6 +66,13 @@ test_emphasis_LDADD = \
$(SOAPY_LIBS) \
-lm
+if HAVE_SDR
+test_emphasis_LDADD += \
+ $(top_builddir)/src/libsdr/libsdr.a \
+ $(top_builddir)/src/libfft/libfft.a \
+ $(top_builddir)/src/libfm/libfm.a
+endif
+
test_dms_SOURCES = test_dms.c dummy.c
test_dms_LDADD = \
@@ -74,10 +84,8 @@ test_dms_LDADD = \
$(top_builddir)/src/libtimer/libtimer.a \
$(top_builddir)/src/libsamplerate/libsamplerate.a \
$(top_builddir)/src/libemphasis/libemphasis.a \
- $(top_builddir)/src/libfm/libfm.a \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
- $(top_builddir)/src/libfft/libfft.a \
$(top_builddir)/src/libmncc/libmncc.a \
$(top_builddir)/src/libsound/libsound.a \
$(ALSA_LIBS) \
@@ -85,6 +93,13 @@ test_dms_LDADD = \
$(SOAPY_LIBS) \
-lm
+if HAVE_SDR
+test_dms_LDADD += \
+ $(top_builddir)/src/libsdr/libsdr.a \
+ $(top_builddir)/src/libfft/libfft.a \
+ $(top_builddir)/src/libfm/libfm.a
+endif
+
test_sms_SOURCES = dummy.c test_sms.c
test_sms_LDADD = \
@@ -96,10 +111,8 @@ test_sms_LDADD = \
$(top_builddir)/src/libtimer/libtimer.a \
$(top_builddir)/src/libsamplerate/libsamplerate.a \
$(top_builddir)/src/libemphasis/libemphasis.a \
- $(top_builddir)/src/libfm/libfm.a \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
- $(top_builddir)/src/libfft/libfft.a \
$(top_builddir)/src/libmncc/libmncc.a \
$(top_builddir)/src/libsound/libsound.a \
$(ALSA_LIBS) \
@@ -107,6 +120,13 @@ test_sms_LDADD = \
$(SOAPY_LIBS) \
-lm
+if HAVE_SDR
+test_sms_LDADD += \
+ $(top_builddir)/src/libsdr/libsdr.a \
+ $(top_builddir)/src/libfft/libfft.a \
+ $(top_builddir)/src/libfm/libfm.a
+endif
+
test_performance_SOURCES = dummy.c test_performance.c
test_performance_LDADD = \
diff --git a/src/tv/Makefile.am b/src/tv/Makefile.am
index da94296..d1677e4 100644
--- a/src/tv/Makefile.am
+++ b/src/tv/Makefile.am
@@ -16,11 +16,9 @@ osmotv_LDADD = \
$(COMMON_LA) \
$(top_builddir)/src/libimage/libimage.a \
$(top_builddir)/src/common/libcommon.a \
- $(top_builddir)/src/libtimer/libtimer.a \
$(top_builddir)/src/libfm/libfm.a \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libwave/libwave.a \
- $(top_builddir)/src/libfft/libfft.a \
$(ALSA_LIBS) \
$(UHD_LIBS) \
$(SOAPY_LIBS) \
@@ -28,15 +26,16 @@ osmotv_LDADD = \
-lm
if HAVE_SDR
-AM_CPPFLAGS += -DHAVE_SDR
+osmotv_LDADD += \
+ $(top_builddir)/src/libsdr/libsdr.a \
+ $(top_builddir)/src/libfft/libfft.a
endif
-if HAVE_UHD
-AM_CPPFLAGS += -DHAVE_UHD
-endif
+osmotv_LDADD += \
+ $(top_builddir)/src/libtimer/libtimer.a
-if HAVE_SOAPY
-AM_CPPFLAGS += -DHAVE_SOAPY
+if HAVE_SDR
+AM_CPPFLAGS += -DHAVE_SDR
endif
if ENABLE_MAGICK
diff --git a/src/tv/main.c b/src/tv/main.c
index 8663952..ed4558f 100644
--- a/src/tv/main.c
+++ b/src/tv/main.c
@@ -34,8 +34,8 @@ enum paging_signal;
#include "../libimage/img.h"
#include "../common/debug.h"
#ifdef HAVE_SDR
-#include "../common/sdr_config.h"
-#include "../common/sdr.h"
+#include "../libsdr/sdr_config.h"
+#include "../libsdr/sdr.h"
#endif
#include "bas.h"
#include "tv_modulate.h"