[alsa-devel] [PATCH] Re: iec958 switch uneffective while playing ac3 stream

Takashi Iwai tiwai at suse.de
Thu Apr 5 12:09:22 CEST 2007


At Thu, 05 Apr 2007 10:47:52 +0200,
Dominique Dumont wrote:
> 
> Takashi Iwai <tiwai at suse.de> writes:
> 
> > The patch is a bit dangerous because it unconditionally resets the
> > DIGI_CONVERT verb for each widget. 
> 
> Agreed.  We could also test the NID before switching on and off DigEn
> in the DIGI_CONVERT. 
> 
> OTOH the switch would occur for *all* HDA chips which may not be what
> you want.

I'm not 100% sure that this particular procedure is necessary for all
codecs.  So, I prefer having it in the hda-codec part rather in
hda-intel part.

> > The below is my modified version.
> > It doesn't turn off before the controller side reset as you did.  So,
> > if my version doesn't work, it implies that the SPDIF reset has to be
> > done before the controller reset.  Please give it a try.
> 
> It works also ! I've tested AC3 and 44KHz. I cannot test 96KHz or
> 196Khz (my amp is too old).

Good to hear.

> > +	/* turn off SPDIF once; otherwise the IEC958 bits won't be updated */
> 
> I had more the impression that the SPDIF stream is messed up if you
> change the stream format while the digital converter is working... 
> 
> 
> > +	if (codec->spdif_ctls & 1)
> 
> Shouldn't you use AC_DIG1_ENABLE for a proper patch ?
> 
>    	if (codec->spdif_ctls & AC_DIG1_ENABLE)
> 
> > +		snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_DIGI_CONVERT_1,
> > +				    codec->spdif_ctls & 0xfe);
> 
> likewise:  codec->spdif_ctls & 0xff & ~AC_DIG1_ENABLE ?
> 
> > +	snd_hda_codec_setup_stream(codec, nid, stream_tag, 0, format);
> > +	/* turn on again (if needed) */
> > +	if (codec->spdif_ctls & 1)
> 
> if (codec->spdif_ctls & AC_DIG1_ENABLE) ?

Yeah, that'd be better.  I'll fix and commit to the HG tree later.


thanks,

Takashi


More information about the Alsa-devel mailing list