Re: [hatari-devel] DSP bug found (and maybe solved)

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

On 15.4.2024 12.50, Andreas Grabher wrote:
Am 14.04.2024 um 23:48 schrieb Laurent Sallafranque <laurent.sallafranque@xxxxxxx>:
I suggest the following fix in the function :
static void dsp_update_rn_modulo(uint32_t numreg, int16_t modifier)

Line 1694 :
replace
     if (abs_modifier>modulo) {
by
     if (abs_modifier>modulo-1) {


In line 1673, modulo is added +1 for buffer boundaries computing.
But I think modulo should be -1 when tested with modifier.

At least, Audio Fun Machine sound becomes good with this patch, but DSP programs should be tested for non regression.
I've tested 2 or 3 of them, but not all of them.

@eero, could you test my patch and tell me if AFM works well for you ?

Great discovery! Obviously the special case where abs_modifier equals modulo was not handled. I think the more logical solution would be
if (abs_modifier>=modulo)

Tested Andreas version and it does indeed fix the AFM sound when equalizer is used!

Sonolumineszenz demo still shows (about 6k of) these warnings:
Dsp: Modulo addressing result unpredictable

I tested quite a few other demos and couple of apps & games, and things still seem to work as before, so it may be safe to commit before release.


	- Eero



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/