Skip to contentSkip to conversation

ALSA: fix excessive background noise introduced by OSS emulation rate shrink

PATCH Steve Chen 2 participants 2 messages Feb 21, 2009 – Feb 23, 2009 Sound

lore
Share & tools
lore

Steve Chen

author
#0 lore raw

Incorrect variable was used to get the next sample which caused S2 to be stuck with the same value resulting in loud background noise.

Signed-off-by Steve Chen <schen at mvista.com>
sound/core/oss/rate.c +1 -1
index a466443..2fa9299 100644
@@ -157,7 +157,7 @@ static void resample_shrink(struct snd_pcm_plugin *plugin,
 		while (dst_frames1 > 0) {
 			S1 = S2;
 			if (src_frames1-- > 0) {
-				S1 = *src;
+				S2 = *src;
 				src += src_step;
 			}
 			if (pos & ~R_MASK) {
#1 lore raw

At Sat, 21 Feb 2009 08:05:04 -0600,

Quoted 6 lines · Steve Chen

Incorrect variable was used to get the next sample which caused S2 to be stuck with the same value resulting in loud background noise.

Signed-off-by Steve Chen <schen at mvista.com>

Oh what a long-living bug.
Applied now. Thanks!

Takashi

Quoted 16 lines
sound/core/oss/rate.c +1 -1
index a466443..2fa9299 100644
@@ -157,7 +157,7 @@ static void resample_shrink(struct snd_pcm_plugin *plugin,
 		while (dst_frames1 > 0) {
 			S1 = S2;
 			if (src_frames1-- > 0) {
-				S1 = *src;
+				S2 = *src;
 				src += src_step;
 			}
 			if (pos & ~R_MASK) {