This converts audio on the fly during callback when using SDL2 only. The issue with the current version is that SDL2 does not honor the requested audio parameters, so when the callback function writes into the stream, the format that Oricutron assumes is being used is not actually correct (or not necessarily).
Nice find!
If there is no other reason I'll suggest to keep 'cvt' variable visible only in 8912.c i.e.:
static SDL_AudioCVT cvt;
and no changes in 8912.h.
This converts audio on the fly during callback when using SDL2 only. The issue with the current version is that SDL2 does not honor the requested audio parameters, so when the callback function writes into the stream, the format that Oricutron assumes is being used is not actually correct (or not necessarily).