[alsa-devel] [PATCH] ASoC: Intel: hdac_hdmi: Add sampling frequencies constraint

Zhi, Yong yong.zhi at intel.com
Tue Aug 7 17:36:12 CEST 2018


Hi, Takashi,

Thanks for the review.

> -----Original Message-----
> From: Takashi Iwai [mailto:tiwai at suse.de]
> Sent: Tuesday, August 7, 2018 10:23 AM
> To: Zhi, Yong <yong.zhi at intel.com>
> Cc: broonie at kernel.org; pierre-louis.bossart at linux.intel.com; alsa-
> devel at alsa-project.org; N, Harshapriya <harshapriya.n at intel.com>;
> vkoul at kernel.org; M, Naveen <naveen.m at intel.com>; Kale, Sanyog R
> <sanyog.r.kale at intel.com>
> Subject: Re: [alsa-devel] [PATCH] ASoC: Intel: hdac_hdmi: Add sampling
> frequencies constraint
> 
> On Tue, 07 Aug 2018 16:56:05 +0200,
> Yong Zhi wrote:
> >
> > Playback of 44.1Khz contents with HDMI plugged returns "Invalid pipe
> > config".
> 
> Why?  Is it a limitation of i915 graphics side?
> If it's a generic issue, we'd need to fix also in the legacy HDMI driver, too.
> 

The HDMI paths in DFW topology are configured for 48Khz operation.

> (snip)
> ....
> > +
> > +			sad_rates = sad_sample_rates_lpcm(sad);
> > +			/* Filter out 44.1, 88.2 and 176.4Khz */
> > +			for (j = 0; j < 7; j += 2)
> > +				if (sad_rates & BIT(j))
> > +					rates |= cea_sampling_freqs[j];
> > +
> > +			snd_pcm_hw_constraint_mask64(runtime,
> > +
> SNDRV_PCM_HW_PARAM_RATE,
> > +						     rates);
> 
> The whole changes are too complex.  You don't have to reduce the list
> dynamically, but just need to tell the all possible rates with a static array.
> 
> Or, even simpler, just filter the rates bits in
> hdac_hdmi_create_dais() from the beginning like below.
> 
> 
> thanks,
> 
> Takashi
> 

Ack, will make changes in hdac_hdmi_create_dais() thanks!!


> --- a/sound/soc/codecs/hdac_hdmi.c
> +++ b/sound/soc/codecs/hdac_hdmi.c
> @@ -1410,6 +1410,12 @@ static int hdac_hdmi_create_dais(struct
> hdac_device *hdev,
>  		if (ret)
>  			return ret;
> 
> +		/* Filter out 44.1, 88.2 and 176.4Khz */
> +		rates &= ~(SNDRV_PCM_RATE_44100 |
> SNDRV_PCM_RATE_88200 |
> +			   SNDRV_PCM_RATE_176400);
> +		if (!rates)
> +			return -EINVAL;
> +
>  		sprintf(dai_name, "intel-hdmi-hifi%d", i+1);
>  		hdmi_dais[i].name = devm_kstrdup(&hdev->dev,
>  					dai_name, GFP_KERNEL);


More information about the Alsa-devel mailing list