Re: [hatari-devel] Gain too low in DmaSnd_LowPassFilter for STE ?

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


Hi,

Here is a patch that may solve the problem (untested).
--- hatari/src/dmaSnd.c	2016-08-06 10:07:17.000000000 -0700
+++ hatari/src/dmaSnd.c	2016-08-07 18:32:07.142586393 -0700
@@ -550,6 +550,11 @@
 			/* Increase freq counter */
 			frameCounter_float += FreqRatio;
 			n = frameCounter_float >> 32;				/* number of samples to skip */
+			if ( n == 0 )						/* advance filter at least once per iteration */
+			{
+				dma.FrameLeft  = DmaSnd_LowPassFilterLeft( (Sint16)MonoByte );
+				dma.FrameRight = DmaSnd_LowPassFilterRight( (Sint16)MonoByte );
+			}
 			while ( n > 0 )						/* pull as many bytes from the FIFO as needed */
 			{
 				MonoByte = DmaSnd_FIFO_PullByte ();
@@ -594,6 +599,11 @@
 			/* Increase freq counter */
 			frameCounter_float += FreqRatio;
 			n = frameCounter_float >> 32;				/* number of samples to skip */
+			if ( n == 0 )						/* advance filter at least once per iteration */
+			{
+				dma.FrameLeft  = DmaSnd_LowPassFilterLeft( (Sint16)LeftByte );
+				dma.FrameRight = DmaSnd_LowPassFilterRight( (Sint16)RightByte );
+			}
 			while ( n > 0 )						/* pull as many bytes from the FIFO as needed */
 			{
 				LeftByte = DmaSnd_FIFO_PullByte ();


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