From: Takashi Iwai Subject: Re: [PATCH] stop setup_dig_out_stream() causing clicks Date: Mon, 08 Oct 2012 14:38:05 +0200 Message-ID: References: <20121004212008.dd604566.ldarby@tuffmail.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 516C5261683 for ; Mon, 8 Oct 2012 14:38:05 +0200 (CEST) In-Reply-To: <20121004212008.dd604566.ldarby@tuffmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Laurence Darby Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Thu, 4 Oct 2012 21:20:08 +0100, Laurence Darby wrote: > > > 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. The flag isn't supposed to be changed in such a dynamic way. Certain codecs seem requiring resetting the SPDIF status bits, and this flag indicates that. That is, blindly clearing this flag is risky (and likely broken). One better option would be to do the SPDIF status reset only when the value is really changed. thanks, Takashi > > Signed-off-by: Laurence Darby > --- > 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 > > _______________________________________________ > Alsa-devel mailing list > Alsa-devel@alsa-project.org > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel >