fix: remove stale static cache in find_PlutoSDR#76
Merged
zuckschwerdt merged 1 commit intoMay 18, 2026
Conversation
Static `results` variable caused find_PlutoSDR to return the same device list on every call, ignoring args and preventing detection of connect/disconnect events.
Member
|
Thanks for testing the idea to remove the caching! |
Contributor
Author
Happy to help! Let me know if any changes are needed. |
gretel
pushed a commit
to gretel/SoapyPlutoPAPR
that referenced
this pull request
Jun 10, 2026
gretel
added a commit
to gretel/SoapyPlutoPAPR
that referenced
this pull request
Jun 10, 2026
Brings F5OEO/SoapyPlutoPAPR fork up to parity with pothosware/SoapyPlutoSDR: - Remove device cache from find_PlutoSDR (pothosware#76) - Fix tx_streamer not using bufflen Kwarg, also set MTU in rx_streamer (pothosware#77) - feat-setts: settings API, CS12 support, MTU adaptation, streaming improvements, CMake restructure (lowercase find-modules) - plutoPAPR driver key rename (plutosdr -> plutoPAPR) Based on: pothosware/master @ fa4b7b0 + feat-setts @ e80d3c6 Applied on: F5OEO/master @ 95f3139 (tezuka rename + BB rate fix)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
find_PlutoSDRfunction used a staticresultsvariable that was populated only once and never invalidated. This caused two issues:enumerate()with a specificurialways returned all devices instead of filtering by the requested one, causingSoapySDR::Device::make()to always open the first discovered device regardless of the provided args.enumerate()calls since the list was never refreshed.Fix
Moved
resultsfrom a static global variable to a local variable insidefind_PlutoSDR. The existing URI filtering logic inside the function now works correctly, and SoapySDR's own enumerate cache (with a 1-second TTL) handles caching at a higher level.Testing
Tested with two PlutoSDR devices connected simultaneously via USB. Both devices are now correctly opened by their respective
uri, and hot-plug/unplug is properly detected on subsequentenumerate()calls.Closes #66