diff options
| author | Zixun LI <[email protected]> | 2026-07-28 21:15:58 +0200 |
|---|---|---|
| committer | Zixun LI <[email protected]> | 2026-07-28 21:15:58 +0200 |
| commit | d8595dafcd9996312a95d06e6532920570f93850 (patch) | |
| tree | 15ad2d7fbb5f46a1ab7871a1621e7d224b239b5d | |
| parent | 8895e94b7faed15b5367dcb1e6715e8ed4c56955 (diff) | |
test/hil: allow audio startup transition
| -rwxr-xr-x | test/hil/hil_test.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/hil/hil_test.py b/test/hil/hil_test.py index 922668041..6ba756a77 100755 --- a/test/hil/hil_test.py +++ b/test/hil/hil_test.py @@ -1671,9 +1671,11 @@ def test_device_audio_test_freertos(board): samples = [int.from_bytes(raw[i:i + 2], 'little', signed=False) for i in range(0, len(raw), 2)] assert sample_count > 1024, f'Not enough samples captured: {sample_count}' - # The firmware sends a continuous uint16 ramp. Using ALSA hw: capture bypasses - # PulseAudio processing, so every adjacent sample must differ by exactly 1. - for i in range(sample_count - 1): + # The producer is already running while ALSA activates streaming, so the + # initial overwritable software FIFO (at most 224 samples) can transition + # between ramp generations. After that startup window, require an exact ramp. + startup_samples = 256 + for i in range(startup_samples, sample_count - 1): expected = (samples[i] + 1) & 0xFFFF assert samples[i + 1] == expected, ( f'Audio mismatch at sample {i + 1}: expected {expected}, got {samples[i + 1]}') |
