sdl2-compat icon indicating copy to clipboard operation
sdl2-compat copied to clipboard

test failure in audio_resampleLoss: Expected output length 9600000, got 8820000

Open smcv opened this issue 2 years ago • 7 comments

Originally reproduced with SDL3 libsdl-org/SDL@a2d5942, sdl2-compat d87c932, running tests with SDL_AUDIODRIVER=dummy SDL_VIDEODRIVER=dummy make test.

Still reproducible with the newest version I have tested, SDL3 libsdl-org/SDL@82f2c4d and sdl2-compat 76ab1f9f, by following the steps shown in #125.

INFO:  08/08/23 13:22:51: ----- Test Case 1.16: 'audio_resampleLoss' started
INFO:  08/08/23 13:22:51: Test Description: 'Check signal-to-noise ratio and maximum error of audio resampling.'
INFO:  08/08/23 13:22:51: Test Iteration 1: execKey 5007414650605529528
INFO:  08/08/23 13:22:51: Assert 'Call to SDL_InitSubSystem(SDL_INIT_AUDIO)': Passed
INFO:  08/08/23 13:22:51: Assert 'Check result from SDL_InitSubSystem(SDL_INIT_AUDIO)': Passed
INFO:  08/08/23 13:22:51: Assert 'Test resampling of 50 s 440 Hz 0.000000 phase sine wave from sampling rate of 44100 Hz to 48000 Hz': Passed
INFO:  08/08/23 13:22:51: Assert 'Call to SDL_BuildAudioCVT(&cvt, AUDIO_F32, 1, 44100, AUDIO_F32, 1, 48000)': Passed
INFO:  08/08/23 13:22:51: Assert 'Expected SDL_BuildAudioCVT to succeed and conversion to be needed.': Passed
INFO:  08/08/23 13:22:51: Assert 'Expected input buffer to be created.': Passed
INFO:  08/08/23 13:22:51: Assert 'Call to SDL_ConvertAudio(&cvt)': Passed
INFO:  08/08/23 13:22:51: Assert 'Expected SDL_ConvertAudio to succeed.': Passed
ERROR: 08/08/23 13:22:51: Assert 'Expected output length 9600000, got 8820000.': Failed
INFO:  08/08/23 13:22:51: Assert 'Cleanup of test files completed': Passed
ERROR: 08/08/23 13:22:51: >>> Test 'audio_resampleLoss': Failed (Aborted)
INFO:  08/08/23 13:22:51: Total Test runtime: 0.2 sec
ERROR: 08/08/23 13:22:51: >>> Test 'audio_resampleLoss': Failed

smcv avatar Aug 08 '23 12:08 smcv

I'm assuming this is the same bug as SDL3 has right now; I'll leave this open until I verify, but this likely doesn't need code changes to sdl2-compat.

icculus avatar Aug 09 '23 02:08 icculus

audio_resampeLoss in SDL3 got fixed, but this is still present in sdl2-compat.

madebr avatar Aug 30 '23 12:08 madebr

I'm still seeing this, when using the same more fully described test setup as in #101. The copies of audio_resampleLoss in SDL 3 https://github.com/libsdl-org/SDL/commit/4db2b968 and SDL 2 https://github.com/libsdl-org/SDL/commit/9772d051 are now successful (although some other tests in SDL 2 are failing), but sdl2-compat https://github.com/libsdl-org/sdl2-compat/commit/52d96367eb41532f628757b38110f21a8daba7ec still fails.

smcv avatar Sep 28 '23 10:09 smcv

In sdl2-compat 439ecae with SDL3 libsdl-org/SDL@bec1b8f I can no longer reproduce this failure.

smcv avatar Jan 08 '24 16:01 smcv

Huh, no, still failing when I try to do this in a container (see #125 for steps).

smcv avatar Jan 08 '24 18:01 smcv

Still the same situation with SDL3 libsdl-org/SDL@82f2c4d and sdl2-compat 76ab1f9f, so recent SDL3 and test changes have not fixed this.

smcv avatar Jan 09 '24 12:01 smcv

This was largely fixed in sdl2-compat, in https://github.com/libsdl-org/sdl2-compat/commit/819d44b7377e81e5c23bacef90569d79660552b7, but we're getting 1 extra sample, which appears to be a bug in the SDL3 resampling code. @icculus, can you take a look?

slouken avatar Jan 09 '24 17:01 slouken

@madebr, we should be good to turn on testautomation in sdl2-compat CI now.

slouken avatar Aug 30 '24 14:08 slouken

In that case this seems like a good time for me to update the SDL3 and sdl2-compat snapshots in Debian experimental, and see what I can re-enable!

smcv avatar Aug 30 '24 14:08 smcv

In that case this seems like a good time for me to update the SDL3 and sdl2-compat snapshots in Debian experimental, and see what I can re-enable!

Hold off on that for a bit, we just merged the GPU API, and there are some memory leak fixes and general shakeout that needs to happen.

slouken avatar Aug 30 '24 15:08 slouken