Re: [hatari-devel] Re: Interesting sound problems with Hatari?

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


Hi,

Thanks Nicolas for this analysis.


> Playing zero byte will certainly remove the noise effect you noticed, 
but it might also add some small "crack" each time a zero byte is played.


That's exactly the case (Zeroing is necessary to avoid sound looping when the DSP is stopped for example) (in the real machine, if the DSP is stopped, it won't transfer sound, but if we don't zero the datas we've just used, they stay in the dac buffer and are played in loop)/

With this patch, we still have the little "crack" sometimes (and sometimes not).

So, that's why I applied the zeroing patch Doug sent and I still want to find why we sometimes get these cracks.


Another remark :

In Racer, I initialise the sound only once before the main menu.

After this, the mods are started, played and stopped, and another mod is started, played and stopped, ...
but the crossbar parameters don't change (I'll verify this again tonight, but I already verified if I remember well).

This means that there's no frequency change after a mod starts or stop or inbeetween 2 modules.
The crossbar stays at the same state during the whole game (from menu to the last race before exiting).

And sometimes modules plays well and sometimes not (but never the same modules and never the same order)

With crossbar traces, I can see only the start DMA playing command and stop DMA playing command.
(Plus the DSP->DAC transfers that I'll remove from the traces tonight to be sure there's no crossbar reconfiguration).

Maybe something to have a look into the start DMA command.

Regards,

Laurent



----- Mail original -----
De: "Nicolas Pomarède" <npomarede@xxxxxxxxxxxx>
À: hatari-devel@xxxxxxxxxxxxxxxxxxx
Cc: "Laurent Sallafranque" <laurent.sallafranque@xxxxxxx>
Envoyé: Mardi 6 Mai 2014 10:25:33
Objet: Re: [hatari-devel] Re: Interesting sound problems with Hatari?

Le 06/05/2014 00:15, Laurent Sallafranque a écrit :
> Hi,
>
> I've patched hatari to enable the zeroing of the dac only when n > 0 (as
> Doug suggested) and I'm zeroing all the values between the current
> position and the next one (if n > 1).

Hi, this might hide the bug because you will play empty sample in that 
case, but the real problem will remain "why those bytes don't have their 
'real' sound value ?".
Playing zero byte will certainly remove the noise effect you noticed, 
but it might also add some small "crack" each time a zero byte is played.

> Something I noticed tonight : when I launch racer (current developping
> release ;)  and I get the noisy music, I press F12 to go to hatari GUI,
> then I change the sound to another frequency and the noise seems to
> disapear (I get a clean music). If I return to the original frequency
> (50 khz for my settings), the sound stays clean.
>
> This may mean that the problem is not into the crossbar emulation (as I
> just press F12 (hatari gui) and return to emulation, there's no crossbar
> settings involved here), but it may comes from a SDL sound synchro problem ?
>

I don't think it's related to SDL, if it was just about some sync 
problem between Hatari and OS, we would see it too in STF/STE mode.

What might happen is that when you change freq, you change your 
step/ratio used to increment the sound counter, possibly resetting a 
value that was overflowing.

But maybe it can give you a hint on what is causing the problem : try to 
find  all variables that depend on sound freq and dump them when a sound 
problem happens, you might be able to see some out of limit values.

Nicolas



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