Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Underflows on input (analogue glitch, S/PDIF discontinuity) #134

Open
danielpieczko opened this issue Feb 22, 2023 · 3 comments
Open

Underflows on input (analogue glitch, S/PDIF discontinuity) #134

danielpieczko opened this issue Feb 22, 2023 · 3 comments

Comments

@danielpieczko
Copy link
Contributor

On xk_316_mc, no specific config, xsig sometimes detects a glitch in the analogue input signals (sine waves generated by the audio analyzer). The glitch can happen at any point in time during the stream, and occurs at the same time on all channels.

This zip contains two stereo WAV files with examples of the glitch at 176400
glitch-wavs.zip

In both cases, there was one frame (22 samples) of incorrect data, three frames of zeros, then one more frame of incorrect data, before the sine waves continue correctly.

Will try to determine if we are going into underflow.

@danielpieczko
Copy link
Contributor Author

Have confirmed that underflow occurs (in the recordings attached to this message, the underflow buffer contained non-zero data and appears as sample values of -0.66)

This has been seen on Windows and MacOS, with any xk_316_mc config, and running at any sample rate.

Before it goes into underflow and/or after coming out, there can be a frame of samples which look valid for the frequency but are out of phase with the expected samples at that point (ie. it's a correct frame received at an incorrect time).

Attaching some examples:
macos-2AMi10o10xssxxx.zip
win11-2AMi8o16xxxxax.zip
win10-2ASi8o8xxxxxx_tdm8.zip

@danielpieczko danielpieczko changed the title Analogue input glitches Underflows on input (analogue glitch, S/PDIF discontinuity) Apr 20, 2023
@danielpieczko
Copy link
Contributor Author

xsig now prints the sample values that it sees after a discontinuity, and it looks like this underflow can also happen on S/PDIF input:

Failed: Failure at sample rate 48000
Channel 8: discontinuity (samples 3357305, 3357730 do not differ by 5 but by 425) (sample 37937)
Channel 8: discontinuity offset 0: 3357730 3357735 3357740 3357745 3357750 3357755 0 0
Channel 8: discontinuity offset 8: 0 0 0 0 0 0 0 0
Channel 8: discontinuity offset 16: 0 0 0 0 0 0 0 0
Channel 8: discontinuity offset 24: 0 0 0 0 0 0 0 0
Channel 8: discontinuity offset 32: 0 0 0 0 0 0 0 0
Channel 8: discontinuity offset 40: 0 0 0 0 0 0 0 0
Channel 8: discontinuity offset 48: 0 0 0 0 0 0 0 0
Channel 8: discontinuity offset 56: 0 0 0 0 3357760 3357765 3357770 3357775
Channel 8: discontinuity offset 64: 3357780 3357785 3357790 3357795 3357800 3357805 3357810 3357815

Frame: N, N+14, nine frames of zeros, N+15, ...

@danielpieczko
Copy link
Contributor Author

These underflow glitches can result in an FFT which is very close to the noise threshold. I have captured one that only crossed the threshold for four of the eight channels, but it includes the same out-of-phase frame and frames of zeros as in the other examples in this issue.

ERROR: Channel 1: Glitch detected, average non peak -88.544024, threshold -89.193021 (sample 720896)
glitch-near-noise-thresh
WAV file

All eight channels will have had an underflow (nine frames of zeros in this case), but some channel's FFT didn't have a high enough level of noise to trigger a failure.

So the glitches that are detected near the noise threshold are not spurious.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant