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

Dominique Dumont domi at komarr.grenoble.hp.com
Thu Apr 5 10:47:52 CEST 2007

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

OTOH the switch would occur for *all* HDA chips which may not be what
you want.

> 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).

> +	/* 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) ?

I've did not have time to test the last patch you sent. 

Cheers & Thanks 

Dominique Dumont 
"Delivering successful solutions requires giving people what they
need, not what they want." Kurt Bittner

More information about the Alsa-devel mailing list