Re: [hatari-devel] STe DMA sound

[ Thread Index | Date Index | More Archives ]

----- On Apr 14, 2018, at 11:35 AM, Vincent Rivière vincent.riviere@xxxxxxxxxxx wrote:

> On 14/04/2018 at 18:56, Vincent Rivière wrote:
>> NB: The only sane possibility would be that DmaSnd_GenerateSamples() trashes
>> the YM sound by some side effect.
> Sherlock Holmes:
> "Once you eliminate the impossible, whatever remains, no matter how
> improbable, must be the truth."
> And he was again right.
> In dmaSnd.c, I have commented out all changes to MixBuffer().
> It results in no digidrums, but artifact still present.
> Near line 574:
> MonoByte = DmaSnd_FIFO_PullByte ();
> If I replace that to "MonoByte = 0", the artifact disappears.
> As I understand:
> - disabling DMA mixing does not change anything
> - but stopping *reading* DMA data fixes the issue
> How is it possible?
> --
> Vincent Rivière

I hope this solves it.

Here are a few of my preliminary thoughts on some matters.

I have not closely inspected the new sample frequency (Fs) changes.

Changing Fs will change  DmaSnd_LowPassFilterLeft() and
DmaSnd_LowPassFilterRight in dmaSnd.c 
This filter has three coefficients: 1,2,1 [Pascal's Triangle]
Maybe change it to seven coefficients: 1,6,15,20,15,6,1  [~125KHz/7 Fc]

Note that a real STe uses a 4th order lowpass switched capacitor filter
at ~20Khz cutoff frequency (Fc) ... look at the schematic (I can't remember
the part number) ... I did not want to encumber the CPU with high frequency,
high order filters (but maybe I better say something before the leap is made).

If the leap is made, there is absolutely no reason to support output below
44.1 KHz because the extra processing adds even more to the load on slower
CPUs to the point that 44.1KHz Fs is more efficient.
eg 125KHz->22.05KHz(harder) vs 125KHz->44.1KHz(easier)

I think this new problem should be at least partially solved before
making more big changes.

Mail converted by MHonArc 2.6.19+