Re: [hatari-devel] STe DMA sound

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


----- On Apr 13, 2018, at 1:18 AM, Nicolas Pomarède wrote:

> Le 13/04/2018 à 09:31, Vincent Rivière a écrit :
>> Hello.
>> 
>> I'm not really satisfied of Hatari DMA sound emulation.
>> Basically, Hatari lacks a low-pass filter, which is a key signature of
>> STe DMA sound at low frequencies such as 6 or 12 KHz.
>> This can particularly be heard in Lethal Xcess. Digidrums are very
>> bass-boosted on real hardware. On the other hand, on Hatari (emulating
>> sound at 44 KHz), we can hear some bogus-treeble sound. This is typical
>> of samples upscaled with "nearest" algorithm, without filter.
>> 
>> I played Lethal Xcess with Effects only, and I recorded the sound with
>> Hatari feature. See explosion sound as attachment.
>> 
>> I looked at it with Audacity.
>> 
>> First, see audacity1.png. We can see big stairs effect, which is typical
>> of upscaling with "nearest" algorithm.
>> But if you look closely, there are big peaks at the beginning of each
>> step. This is particularly visible when zooming more, see audacity2.png.
>> 
>> That's a complete nonsense. I can't understand where such peaks come
>> from. They cause the apparition of bogus high frequencies, even more
>> than standard upscaling. On the contrary, a normal low-pass filter would
>> smooth such transitions. While currently, Hatari does the opposite,
>> degrading the sound instead of improving it.
>> 
>> Definitely, Hatari STe sound can be improved.
>> I don't hear such problem in Steem.
> 
> Hi
> 
> Hatari has a low pass filter for STE DMA sound, see the functions
> DmaSnd_LowPassFilterLeft and DmaSnd_LowPassFilterRight in dmaSnd.c
> 
> But the filter is enabled only if the DMA sample freq is above the
> output freq of the audio card. As most PC will default to 44.1 kHz, this
> means that low pass only applies when STE sound is at 50 kHz.
> 
> This part was written by David Savinkoff, he might tell the reason for
> this choice. Maybe some fine tuning would be needed based on some real
> wav recording on an STE at different freq to get closer results to real HW.
> 
> In dmaSnd.c at line 530, can you force "DmaSnd_LowPass = true" to see if
> the sound is better according to you ?
> 
> Nicolas

I just looked at Vincent's audacity2.png. It looks like the first sample of each
pulse is treated differently than the rest. This could be:
1) Correct samples the STe application is generating.
2) Your STe LMC1992 has the treble turned way up.
3) A new symptom of DMA or bus timing.
4) A regression in anything since the last time the sound was good.
5) Maybe an existing problem has just been heard.

Please try previous versions of Hatari on some STe DMA sound applications.
We need to find where the problem is.

David



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