Misc. enhancements (driven by RSPDuo support needs) #786
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.
Hello @fventuri, @SDRplay. This is PR for CubicSDR destined to have better support for RSPDuo, but staying generic at the same time.
Master
andSlave
instance names in the Duo context.readStream
return codeSOAPY_SDR_NOT_SUPPORTED
, or catching exception onreadStream
and stopping the Cubic streaming thread cleanly.Some notes on the second point :
Soapy API has a special code meaning
SOAPY_SDR_NOT_SUPPORTED
that should be returned by thereadStream
on theSlave
instance when theMaster
get lost.Although the Cubic code now also catch any exception around the
readStream
code to stop Cubic side cleanly, last time I checked (pre-Cx11 I confess) it is considered very bad practice to throw exceptions between threads, especially for a parfect valid case of "dying Master instance" like this.Of course there is also less garantees that other clients of Soapy API are expecting exceptions to be managed at all in their particular application.
Either way even with those changes from the user perspective the Waterfall and Spectrum will simply stop animating in case of Duo Master loss on the Slave side. Not much more can be done without developping an insane amount of code compared to this small use case.
I've tested on RSP2 (old driver) with a testing piece of code either throwing a
std:runtime_error
or returningSOAPY_SDR_NOT_SUPPORTED
after some time to simulate it: The WF/Spectrum stream animation stops, but I can still going to eitherStart/Stop device
orDevices
dialogs to restart it. So it is as clean as it can get I think.