Indicate audio FIFO underflow/overflow in GUI #1887
Merged
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.
Currently, there appears to be no indication if audio underflow occurs. There's a message in the log if overflow occurs.
This PR indicates if overflow/underflow has occurred in the last second, by setting the background of the audio mute button to yellow.
Currently the patch is just for WFM Demod - but if you think this is the way to go, I can add to other demods.
Although much of the time underflows are inaudible (to my ears at least), I think it's useful to indicate there's a problem for when audio is being piped to an external demod, as it may be more problematic. (Good example of when they occur, is with some RTL SDRs running at 3.2MSa/s - as not all can quite do it).
The patch also changes how the audio output device works slightly, to try to avoid some zero padding. Currently, the readData(char* data, qint64 maxLen) function always returns the indicated maxLen amount of data, and zero pads if there isn't enough data in the audio FIFOs. The patch changes this, so that zeros are only output if there is no data in any of the audio FIFOs. If there is some, then we just output what is available, giving a bit more time for some more to be added to the FIFOs.