Re: [hatari-devel] Bad sound in Monscape demo

[ Thread Index | Date Index | More Archives ]

Le 05/12/2022 à 21:22, Laurent Sallafranque a écrit :

As you're speaking of sound glitches, I have encountered another problem (it may be the same as you describe, but I prefer describing it as a new problem for now).

In my new code, I've made a sound mixer.

I've configured the Falcon to play 50066 hz mono 8bits sound.

I use 22050 hz samples.

When I feed my inner buffer (in my program, I take the 1st byte of the "sample1", then I copy the first byte of the "sample2", then the 2nd byte of the first sample, ...

The sound looks like : 12121212121212...

If I have only one sample, the sound looks like 1010101010...  I feed the "second sample" with zeros.

On the falcon, it sounds perfect, no problem (I know my samples are playing a bit slower than on my PC, but the sound is OK).

Under hatari, the sound plays OK, but after some times, it starts to glitch and crackle, and again, after some time, it becomes good again, ... It's a cyclic event (maybe a sinusoidal event, when sound goes from perfect to glitchy).

I think some Falcon demos with glitchy sound are using this 0 0 0 technic to mix.

I don't know if this tells something to anybody, and if there's a way to improve the emulation here.

I just share not to forget it later and in case this ring a bell to someone.




when doing the ym2149 clock improvement with no roundings for 2.4.1

I fixed some cases where floating point was used to replace them with integer math where errors is accumulated to keep it at the lowest level.

there're still many places in falcon crossbar where floating point math is used, I think they should be replaced too to improve sound quality.

Can't tell if this will fix the problem reported by you en Eero, but it's certainly a needed fix.

As for when I will do it, I don't know yet :)

Le 05/12/2022 à 20:06, Eero Tamminen a écrit :

I have bad sound in (Sommarhack 2022) "Monscape" demo:

With latest Hatari Git version.

Drums and bass in the music are very scratchy compared to the clean sound in the demo video:

This is not a regression, I hear same bad sound also with Hatari v2.3.1.

    - Eero

Mail converted by MHonArc 2.6.19+