[hatari-devel] STE sound breakage with lower sound frequencies

Eero Tamminen oak at helsinkinet.fi
Mon Feb 14 20:16:10 CET 2011


Hi,

On maanantai 14 helmikuu 2011, Nicolas Pomarède wrote:
> looking at the code in change.c, I see that when audio freq is changed
> this doesn't call Audio_SetOutputAudioFreq, but only Audio_Init (with
> Audio_Uninit being called just before).
> 
> This explains why we get STE sound when starting at 44.1 kHz and going
> to 16 kHz : DmaSnd_Init_Bass_and_Treble_Tables is not called, so we keep
> a working 44.1 kHz IIR table.
> If we start at 16 kHz, we create a 16 kHz IIR table and never change it
> if we go to 44.1 kHz later.
> 
> Could you modify change.c to also call Audio_SetOutputAudioFreq ? (as it
> is already the case when using --sound)

Currently it's called by Configuration_Apply() which is called from:
- main.c after config & options are parsed at startup
- configuration.c when memory state is restored
- change.c when configuration is changed

I.e. it already does that.

The problem seems to be be that Configuration_Apply() is called between
Audio_UnInit() and Audio_Init() *and* DmaSnd_Init_Bass_and_Treble_Tables()
is called from Audio_SetOutputAudioFreq() only if audio is enabled.

-> I think Audio_SetOutputAudioFreq() should be called from Audio_Init().

If a separate function wouldn't be needed for memory snapshot restore,
that functionality could be in Audio_Init() itself (and then would be only
two lines).


	- Eero



More information about the hatari-devel mailing list