diff --git a/src/libsdr/sdr.c b/src/libsdr/sdr.c index 5ef8ffb..6d41e53 100644 --- a/src/libsdr/sdr.c +++ b/src/libsdr/sdr.c @@ -167,11 +167,6 @@ void *sdr_open(const char __attribute__((__unused__)) *device, double *tx_freque if (bandwidth) PDEBUG(DSDR, DEBUG_INFO, "Require bandwidth of each channel is 2 * (%.1f deviation + %.1f modulation) = %.1f KHz\n", max_deviation / 1e3, max_modulation / 1e3, bandwidth / 1e3); - if (channels < 1) { - PDEBUG(DSDR, DEBUG_ERROR, "No channel given, please fix!\n"); - abort(); - } - sdr = calloc(sizeof(*sdr), 1); if (!sdr) { PDEBUG(DSDR, DEBUG_ERROR, "NO MEM!\n"); @@ -261,10 +256,12 @@ void *sdr_open(const char __attribute__((__unused__)) *device, double *tx_freque } /* create list of channel states */ - sdr->chan = calloc(sizeof(*sdr->chan), channels + (sdr->paging_channel != 0)); - if (!sdr->chan) { - PDEBUG(DSDR, DEBUG_ERROR, "NO MEM!\n"); - goto error; + if (channels) { + sdr->chan = calloc(sizeof(*sdr->chan), channels + (sdr->paging_channel != 0)); + if (!sdr->chan) { + PDEBUG(DSDR, DEBUG_ERROR, "NO MEM!\n"); + goto error; + } } /* swap links, if required */ @@ -276,7 +273,9 @@ void *sdr_open(const char __attribute__((__unused__)) *device, double *tx_freque tx_frequency = temp; } - if (tx_frequency) { + if (tx_frequency && !channels) + tx_center_frequency = tx_frequency[0]; + if (tx_frequency && channels) { /* calculate required bandwidth (IQ rate) */ double tx_low_frequency = 0.0, tx_high_frequency = 0.0; @@ -357,7 +356,9 @@ void *sdr_open(const char __attribute__((__unused__)) *device, double *tx_freque } } - if (rx_frequency) { + if (rx_frequency && !channels) + rx_center_frequency = rx_frequency[0]; + if (rx_frequency && channels) { /* calculate required bandwidth (IQ rate) */ double rx_low_frequency = 0.0, rx_high_frequency = 0.0; for (c = 0; c < channels; c++) { diff --git a/src/libsdr/soapy.c b/src/libsdr/soapy.c index 56c42d9..4acf477 100644 --- a/src/libsdr/soapy.c +++ b/src/libsdr/soapy.c @@ -99,7 +99,7 @@ int soapy_open(size_t channel, const char *_device_args, const char *_stream_arg use_time_stamps = timestamps; if (use_time_stamps && (1000000000LL % (long long)rate)) { - PDEBUG(DSOAPY, DEBUG_ERROR, "The given sample duration is not a multiple of a nano second. I.e. we can't divide 1000,000,000 by sample rate of %.0f. Please choose a different sample rate for time stamp support!\n", rate); + PDEBUG(DSOAPY, DEBUG_ERROR, "The given sample duration is not a multiple of a nano second. I.e. we can't divide 10^9 by sample rate of %.0f. Please choose a different sample rate for time stamp support!\n", rate); use_time_stamps = 0; } Ns_per_sample = 1000000000LL / (long long)rate; diff --git a/src/radio/main.c b/src/radio/main.c index b45d106..b58108f 100644 --- a/src/radio/main.c +++ b/src/radio/main.c @@ -393,7 +393,7 @@ int main(int argc, char *argv[]) tx_frequencies[0] = frequency; rx_frequencies[0] = frequency; am[0] = 0; - sdr = sdr_open(NULL, tx_frequencies, rx_frequencies, am, 1, 0.0, dsp_samplerate, buffer_size, 1.0, 0.0, 0.0, 0.0); + sdr = sdr_open(NULL, tx_frequencies, rx_frequencies, am, 0, 0.0, dsp_samplerate, buffer_size, 1.0, 0.0, 0.0, 0.0); if (!sdr) goto error; sdr_start(sdr); diff --git a/src/tv/main.c b/src/tv/main.c index e8ded74..c46b9d6 100644 --- a/src/tv/main.c +++ b/src/tv/main.c @@ -228,7 +228,7 @@ static int handle_options(int short_option, int argi, char **argv) "--sdr-tx-gain", "50", "--sdr-lo-offset", "-3000000", "--sdr-bandwidth", "60000000", - "-s", "13750000", + "-s", "12500000", }; int argc_lime = sizeof(argv_lime) / sizeof (*argv_lime); return options_command_line(argc_lime, argv_lime, handle_options); @@ -242,7 +242,7 @@ static int handle_options(int short_option, int argi, char **argv) "--sdr-tx-gain", "50", "--sdr-lo-offset", "-3000000", "--sdr-bandwidth", "60000000", - "-s", "13750000", + "-s", "12500000", }; int argc_lime = sizeof(argv_lime) / sizeof (*argv_lime); return options_command_line(argc_lime, argv_lime, handle_options); @@ -333,7 +333,7 @@ static void tx_bas(sample_t *sample_bas, __attribute__((__unused__)) sample_t *s tx_frequencies[0] = frequency; rx_frequencies[0] = frequency; am[0] = 0; - sdr = sdr_open(NULL, tx_frequencies, rx_frequencies, am, 1, 0.0, dsp_samplerate, buffer_size, 1.0, 0.0, 0.0, 0.0); + sdr = sdr_open(NULL, tx_frequencies, rx_frequencies, am, 0, 0.0, dsp_samplerate, buffer_size, 1.0, 0.0, 0.0, 0.0); if (!sdr) goto error; sdr_start(sdr);