Fix for above 3Mhz sample rate on LimeSDR-USB

This problem could  also be present on other devices using the FX3 driver and is perhaps part of a larger general problem  in the LMS7 Soapy  module.
This commit is contained in:
Dantali0n 2019-03-09 19:16:57 +00:00 committed by vsonnier
parent 94e252db51
commit ed5993748f
1 changed files with 7 additions and 1 deletions

View File

@ -446,12 +446,18 @@ void SDRThread::updateSettings() {
}
if (rate_changed.load()) {
device->setSampleRate(SOAPY_SDR_RX,0,sampleRate.load());
// TODO: explore bandwidth setting option to see if this is necessary for others
if (device->getDriverKey() == "bladeRF") {
device->setBandwidth(SOAPY_SDR_RX, 0, sampleRate.load());
}
// Fix for LimeSDR-USB not properly handling samplerate changes while device is
// active.
else if (device->getHardwareKey() == "LimeSDR-USB") {
std::cout << "SDRThread::updateSettings(): Force deactivate / activate limeSDR stream" << std::endl << std::flush;
device->deactivateStream(stream);
device->activateStream(stream);
}
sampleRate.store(device->getSampleRate(SOAPY_SDR_RX,0));
numChannels.store(getOptimalChannelCount(sampleRate.load()));
numElems.store(getOptimalElementCount(sampleRate.load(), TARGET_DISPLAY_FPS));