Skip to content

Commit

Permalink
Fix for above 3Mhz sample rate on LimeSDR-USB
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Dantali0n authored and vsonnier committed Mar 9, 2019
1 parent 94e252d commit ed59937
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/sdr/SoapySDRThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

2 comments on commit ed59937

@juribeparada
Copy link

@juribeparada juribeparada commented on ed59937 Mar 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm this patch works very well for my LimeSDR-USB. A similar problem has LimeSDR-Mini (5 MSPS max.), but now working better since I reported this issue almost a year ago, see this: myriadrf/LimeSuite#177

@Dantali0n
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@juribeparada Hi, thanks for the update. If the problem will not be fixed in the LMS7 Soapy module it is likely we will include a fix for all LMS7 based devices. For now, we want to wait for MyriadRF to come with a response then we can decide if this issue will be fixed in their driver or in CubicSDR itself. I recommend tracking this issue: #716 for details.

Kind regards,
Dantali0n

Please sign in to comment.