All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurence Darby <ldarby@tuffmail.com>
To: alsa-devel@alsa-project.org
Subject: [PATCH] stop setup_dig_out_stream() causing clicks
Date: Thu, 4 Oct 2012 21:20:08 +0100	[thread overview]
Message-ID: <20121004212008.dd604566.ldarby@tuffmail.com> (raw)


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@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

             reply	other threads:[~2012-10-04 20:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-04 20:20 Laurence Darby [this message]
2012-10-08 12:38 ` [PATCH] stop setup_dig_out_stream() causing clicks Takashi Iwai
2012-11-01  2:53   ` [PATCH v2] " Laurence Darby
2012-11-02  9:04     ` Takashi Iwai
2012-11-03 17:00       ` [PATCH v3] " Laurence Darby
2012-11-04  8:17         ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121004212008.dd604566.ldarby@tuffmail.com \
    --to=ldarby@tuffmail.com \
    --cc=alsa-devel@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.