Re: [PATCH 06/15] ALSA: pcm: Add DRM helper to set constraint for format

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 01 Dec 2015 18:47:02 +0100,
Subhransu S. Prusty wrote:
> 
> +static int eld_limit_formats(struct snd_pcm_runtime *runtime, void *eld)
> +{
> +	u64 formats = SNDRV_PCM_FMTBIT_S16_LE;
> +	int i;
> +	const u8 *sad, *eld_buf = eld;
> +
> +	sad = drm_eld_sad(eld_buf);
> +	if (!sad)
> +		goto format_constraint;
> +
> +	for (i = drm_eld_sad_count(eld_buf); i > 0; i--, sad += 3) {
> +		if (sad_format(sad) == 1) { /* AUDIO_CODING_TYPE_LPCM */
> +
> +			/* 20 bit */
> +			if (sad_sample_bits_lpcm(sad) & 0x2)
> +				formats |= SNDRV_PCM_FMTBIT_S32_LE;
> +
> +			/* 24 bit */
> +			if (sad_sample_bits_lpcm(sad) & 0x4)
> +				formats |= SNDRV_PCM_FMTBIT_S24_LE;

Does it work correctly with HD-audio...?


Takashi
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux