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

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


Le 06/05/2014 12:17, laurent.sallafranque@xxxxxxx a écrit :
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).


A small remark regarding sound : playing the same byte in a loop is not a problem, you don't have to force buffer to 0.
What produces sound is the transition from one value to another value.

If you play a buffer with only 1000 0x66 bytes or 1000 0x98 bytes or 1000 0x00 bytes, result will be the same, you won't hear sound, because there's no transition.

What I mean is that the problem is not that you play the same byte in a loop in the DAC buffer when DSP is off, the problem seems to be that this byte changes in a random way, and create noise sound.

Instead of zeroing, you could force byte to 0xff or 0x88, as long as it's always the same value, it will work.

You should try to find where those "random" bytes values are coming from and why they're stillchanging when DSP is off.

Nicolas



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