Re: [hatari-devel] Cracks in the sound (YM+DMA)

[ Thread Index | Date Index | More Archives ]

Le 24/02/2013 05:56, David Savinkoff a écrit :

dma @ atari-forum noted sound distortion in Hatari:

I found and solved the problem. YM + DMA sound samples
exceeded 16 bits at line 549 in dmaSnd.c (see code):

/* DMA and (YM2149 0 dB) mixing */
MixBuffer[nBufIdx][0] = MixBuffer[nBufIdx][0] + dma.FrameLeft * -((256*3/4)/2)/4;

A solution is to center the YM sound table with sound.c.overflow.diff
A side effect of centering the sound table is an audible click when
cold-starting hatari (power cycling on a real Atari).

I also made a patch to do efficient clipping instead of overflow for
LMC1992 distortion.



I tried the patch, and it's true the click on the start is not very nice.

Instead of centering the ym sound, can't we just found a maximum value for YM_OUTPUT_LEVEL that doesn't create the observed overflow ? Sound level will be lower, but the user can still adjust the output volume on his PC (ratio between dma and ym would also need to be adjusted when mixing both if we lower YM_OUTPUT_LEVEL)


Mail converted by MHonArc 2.6.19+