aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Knitt <andyknitt@gmail.com>2022-12-23 11:42:22 -0600
committerGitHub <noreply@github.com>2022-12-23 11:42:22 -0600
commitb36cb5813d9bd0319964d0dc9deffcbfa2a6d6d2 (patch)
treea34b957dd2301b3c1f0d69744048dff94fb83c71
parent3f036e0c6f69bd883a54a8cb96f07257602a07c2 (diff)
adjust Source sample rate to match SDR sample rate
If the hardware sample rate doesn't match the Source sample rate (from config.json), adjust the Source sample rate to match.
-rw-r--r--trunk-recorder/source.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/trunk-recorder/source.cc b/trunk-recorder/source.cc
index 27c980f3..ac197824 100644
--- a/trunk-recorder/source.cc
+++ b/trunk-recorder/source.cc
@@ -475,6 +475,7 @@ Source::Source(double c, double r, double e, std::string drv, std::string dev, C
BOOST_LOG_TRIVIAL(info) << "Setting sample rate to: " << FormatSamplingRate(rate);
osmo_src->set_sample_rate(rate);
actual_rate = osmo_src->get_sample_rate();
+ rate = round(actual_rate);
BOOST_LOG_TRIVIAL(info) << "Actual sample rate: " << FormatSamplingRate(actual_rate);
BOOST_LOG_TRIVIAL(info) << "Tuning to " << format_freq(center + error);
osmo_src->set_center_freq(center + error, 0);