Re: [hatari-devel] STe DMA sound

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


Le 14/04/2018 à 22:11, Vincent Rivière a écrit :
On 14/04/2018 at 20:55, Christian Zietz wrote:
One thing that changes for sure: When you stop reading, the FIFO isn't
refilled anymore, either. (Because it remains full.) This then means
that a program will never see the DMA sound output finish, i.e. no
interrupt occurs and the DMA sound control register never goes back to zero.

Exactly.

I have made further tests.

1) Whatever I do, the 7 KHz artifact is only present when DMA FIFO stuff is active. When I hack the code to avoid FIFO refilling, problem disappears. I didn't manage to understand how this can happen. I suspected generated interrupts in DmaSnd_EndOfFrameReached(), but after testing it does not seem to be related.

2) The 7 KHz artifact appears on YM voice C, not others (and not DMA!)
I checked that by hacking sound.c, keeping only the following code, and commenting out other voices.
         bt = ToneC_val | ToneC_force;
         bt = (bt | mixerTC) & (Noise_val | mixerNC);
         Tone3Voices |= ( bt & YM_MASK_1VOICE ) << 10;

I have no idea how such different parts of the code can interfere with each other... But definitely, it affects all Lethal Xcess musics (at least menu, level 1, level 2) on voice C. It does not happen with Hatari 2.0.
As Nicolas rewrote the YM code for 2.1, maybe he has an idea...

Sorry, I'm currently busy. I must give up debugging for now.


I will try to look at this when I have a little more free time, but this is clearly an example when trying to debug/improve by using the game instead of a separate test program makes things harder to understand.

As you say, it might look like "non logical" that it relates to voice C ; whereas with a separate test program we could really play dma sample and/or ym sound at the same time and/or lmc filters and see which part(s) is triggering the sound issue.

I will try to write such test program later, it will be much easier to compare results and to ensure everybody is using the same reference proceure.

Nicolas





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