Commit 3dc86429 authored by Anssi Hannula's avatar Anssi Hannula Committed by Takashi Iwai

ALSA: hda - Always allow basic audio irrespective of ELD info

Commit bbbe3390 added functionality to restrict PCM parameters
based on ELD info (derived from EDID data) of the audio sink.

However, according to CEA-861-D no SAD is needed for basic audio
(32/44.1/48kHz stereo 16-bit audio), which is instead indicated with a
basic audio flag in the CEA EDID Extension.

The flag is not present in ELD. However, as all audio capable sinks are
required to support basic audio, we can assume it to be always
available.

Fix allowed audio formats with sinks that have SADs (Short Audio
Descriptors) which do not completely overlap with the basic audio
formats (there are no reports of affected devices so far) by always
assuming that basic audio is supported.
Reported-by: default avatarStephen Warren <swarren@nvidia.com>
Signed-off-by: default avatarAnssi Hannula <anssi.hannula@iki.fi>
Cc: stable@kernel.org
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 4b0dbdb1
...@@ -598,21 +598,19 @@ void hdmi_eld_update_pcm_info(struct hdmi_eld *eld, struct hda_pcm_stream *pcm, ...@@ -598,21 +598,19 @@ void hdmi_eld_update_pcm_info(struct hdmi_eld *eld, struct hda_pcm_stream *pcm,
{ {
int i; int i;
pcm->rates = 0; /* assume basic audio support (the basic audio flag is not in ELD;
pcm->formats = 0; * however, all audio capable sinks are required to support basic
pcm->maxbps = 0; * audio) */
pcm->channels_max = 0; pcm->rates = SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000;
pcm->formats = SNDRV_PCM_FMTBIT_S16_LE;
pcm->maxbps = 16;
pcm->channels_max = 2;
for (i = 0; i < eld->sad_count; i++) { for (i = 0; i < eld->sad_count; i++) {
struct cea_sad *a = &eld->sad[i]; struct cea_sad *a = &eld->sad[i];
pcm->rates |= a->rates; pcm->rates |= a->rates;
if (a->channels > pcm->channels_max) if (a->channels > pcm->channels_max)
pcm->channels_max = a->channels; pcm->channels_max = a->channels;
if (a->format == AUDIO_CODING_TYPE_LPCM) { if (a->format == AUDIO_CODING_TYPE_LPCM) {
if (a->sample_bits & AC_SUPPCM_BITS_16) {
pcm->formats |= SNDRV_PCM_FMTBIT_S16_LE;
if (pcm->maxbps < 16)
pcm->maxbps = 16;
}
if (a->sample_bits & AC_SUPPCM_BITS_20) { if (a->sample_bits & AC_SUPPCM_BITS_20) {
pcm->formats |= SNDRV_PCM_FMTBIT_S32_LE; pcm->formats |= SNDRV_PCM_FMTBIT_S32_LE;
if (pcm->maxbps < 20) if (pcm->maxbps < 20)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment