ALSA: hda - Avoid invalid formats and rates with shared SPDIF
Check whether formats and rates don't result in zero due to the restriction of SPDIF sharing. If any of them can be zero, disable the SPDIF sharing mode instead. Otherwise it will lead to a PCM configuration error. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Родитель
aa202455ee
Коммит
022b466fc3
|
@ -3470,10 +3470,16 @@ int snd_hda_multi_out_analog_open(struct hda_codec *codec,
|
||||||
}
|
}
|
||||||
mutex_lock(&codec->spdif_mutex);
|
mutex_lock(&codec->spdif_mutex);
|
||||||
if (mout->share_spdif) {
|
if (mout->share_spdif) {
|
||||||
runtime->hw.rates &= mout->spdif_rates;
|
if ((runtime->hw.rates & mout->spdif_rates) &&
|
||||||
runtime->hw.formats &= mout->spdif_formats;
|
(runtime->hw.formats & mout->spdif_formats)) {
|
||||||
if (mout->spdif_maxbps < hinfo->maxbps)
|
runtime->hw.rates &= mout->spdif_rates;
|
||||||
hinfo->maxbps = mout->spdif_maxbps;
|
runtime->hw.formats &= mout->spdif_formats;
|
||||||
|
if (mout->spdif_maxbps < hinfo->maxbps)
|
||||||
|
hinfo->maxbps = mout->spdif_maxbps;
|
||||||
|
} else {
|
||||||
|
mout->share_spdif = 0;
|
||||||
|
/* FIXME: need notify? */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
mutex_unlock(&codec->spdif_mutex);
|
mutex_unlock(&codec->spdif_mutex);
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче