Re: [hatari-devel] STe DMA sound |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel <hatari-devel@xxxxxxxxxxxxxxxxxxx>
- Subject: Re: [hatari-devel] STe DMA sound
- From: David Savinkoff <dsavnkff@xxxxxxxxx>
- Date: Sat, 14 Apr 2018 12:54:45 -0600 (MDT)
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telus.net; s=neo; t=1523732085; bh=3GQtGx/IR3YiTdyqPCIdlh0RJRtBIRdbec4BuYCS1uM=; h=Date:From:To:In-Reply-To:Subject; b=y+FLZ68UeHU3jhR4SYslOFsINclGU7mQRbJ0fDbQ3oe2DAuokWpUQkKEd+ZwYARtS EmzcaBMnvAQrmML+YW74v7JdxwgTZsq7N8WR4SpkYMGngSA8BCvbs3dmqsbKA88IO3 Xkdqz5bEpcDYIG27CqdmcRr35gOWT9rB8CDm3OHAOIlI2v+ieNei3gzZ8jB8YWbXQu HbUzn0mxhNK/20kxQnk8Uve86tpTF7x6anK9u1oGxMluScZMjfZOiGzs/qQhl+vG/T NaWumt5CiL0q5zwoRwqtZjO46a+BuaexAhCIQRQpzoenXJj8jdxDDCChV+o6pzNinm hBkC4TTq9RC0Q==
- Thread-index: Y6vc9y5itlnC8iLyeysNlYya8dwVoQ==
- Thread-topic: STe DMA sound
----- 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.