[alsa-devel] [PATCH] stop setup_dig_out_stream() causing clicks

Laurence Darby ldarby at tuffmail.com
Thu Oct 4 22:20:08 CEST 2012


Starting audio or seeking in various music players causes
setup_dig_out_stream() to be called, which resets the SPDIF stream,
which caused one DAC (but not another) to make a clicking noise every
time.

This patch turns off codec->spdif_status_reset after one reset which
stops further clicks.  One reset is still necessary to initialise the
codec properly.

Signed-off-by: Laurence Darby <ldarby at tuffmail.com>
---
2nd attempt at this, I hope I'm not doing anything wrong this time.

 sound/pci/hda/hda_codec.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 1c65cc5..7742a77 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -4731,9 +4731,11 @@ static void setup_dig_out_stream(struct hda_codec *codec, hda_nid_t nid,
 						   format);
 	}
 	/* turn on again (if needed) */
-	if (codec->spdif_status_reset && (spdif->ctls & AC_DIG1_ENABLE))
+	if (codec->spdif_status_reset && (spdif->ctls & AC_DIG1_ENABLE)) {
 		set_dig_out_convert(codec, nid,
 				    spdif->ctls & 0xff, -1);
+		codec->spdif_status_reset = 0;
+	}
 }
 
 static void cleanup_dig_out_stream(struct hda_codec *codec, hda_nid_t nid)
-- 
1.7.12



More information about the Alsa-devel mailing list