ALSA: hda - Add full rates/formats support for Nvidia HDMI
Allow Nvidia HDMI to support more possible sample rates and formats. At best, the really supported rates and formats should be determined together with the negotiation with the HDMI receiver, but it's currently not implemented yet (Nvidia stuff seems incompatible with HDMI 1.3 standard in this regard). As a compromise, we enable all bits, assuming that all recent devices do support such rates/formats. Tested-by: Alan Alan <alanwww1@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
defb5ab2e0
commit
f0613d5752
|
@ -29,6 +29,9 @@
|
||||||
#include "hda_codec.h"
|
#include "hda_codec.h"
|
||||||
#include "hda_local.h"
|
#include "hda_local.h"
|
||||||
|
|
||||||
|
/* define below to restrict the supported rates and formats */
|
||||||
|
#define LIMITED_RATE_FMT_SUPPORT
|
||||||
|
|
||||||
struct nvhdmi_spec {
|
struct nvhdmi_spec {
|
||||||
struct hda_multi_out multiout;
|
struct hda_multi_out multiout;
|
||||||
|
|
||||||
|
@ -60,6 +63,22 @@ static struct hda_verb nvhdmi_basic_init[] = {
|
||||||
{} /* terminator */
|
{} /* terminator */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef LIMITED_RATE_FMT_SUPPORT
|
||||||
|
/* support only the safe format and rate */
|
||||||
|
#define SUPPORTED_RATES SNDRV_PCM_RATE_48000
|
||||||
|
#define SUPPORTED_MAXBPS 16
|
||||||
|
#define SUPPORTED_FORMATS SNDRV_PCM_FMTBIT_S16_LE
|
||||||
|
#else
|
||||||
|
/* support all rates and formats */
|
||||||
|
#define SUPPORTED_RATES \
|
||||||
|
(SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |\
|
||||||
|
SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 |\
|
||||||
|
SNDRV_PCM_RATE_192000)
|
||||||
|
#define SUPPORTED_MAXBPS 24
|
||||||
|
#define SUPPORTED_FORMATS \
|
||||||
|
(SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE)
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Controls
|
* Controls
|
||||||
*/
|
*/
|
||||||
|
@ -258,9 +277,9 @@ static struct hda_pcm_stream nvhdmi_pcm_digital_playback_8ch = {
|
||||||
.channels_min = 2,
|
.channels_min = 2,
|
||||||
.channels_max = 8,
|
.channels_max = 8,
|
||||||
.nid = Nv_Master_Convert_nid,
|
.nid = Nv_Master_Convert_nid,
|
||||||
.rates = SNDRV_PCM_RATE_48000,
|
.rates = SUPPORTED_RATES,
|
||||||
.maxbps = 16,
|
.maxbps = SUPPORTED_MAXBPS,
|
||||||
.formats = SNDRV_PCM_FMTBIT_S16_LE,
|
.formats = SUPPORTED_FORMATS,
|
||||||
.ops = {
|
.ops = {
|
||||||
.open = nvhdmi_dig_playback_pcm_open,
|
.open = nvhdmi_dig_playback_pcm_open,
|
||||||
.close = nvhdmi_dig_playback_pcm_close_8ch,
|
.close = nvhdmi_dig_playback_pcm_close_8ch,
|
||||||
|
@ -273,9 +292,9 @@ static struct hda_pcm_stream nvhdmi_pcm_digital_playback_2ch = {
|
||||||
.channels_min = 2,
|
.channels_min = 2,
|
||||||
.channels_max = 2,
|
.channels_max = 2,
|
||||||
.nid = Nv_Master_Convert_nid,
|
.nid = Nv_Master_Convert_nid,
|
||||||
.rates = SNDRV_PCM_RATE_48000,
|
.rates = SUPPORTED_RATES,
|
||||||
.maxbps = 16,
|
.maxbps = SUPPORTED_MAXBPS,
|
||||||
.formats = SNDRV_PCM_FMTBIT_S16_LE,
|
.formats = SUPPORTED_FORMATS,
|
||||||
.ops = {
|
.ops = {
|
||||||
.open = nvhdmi_dig_playback_pcm_open,
|
.open = nvhdmi_dig_playback_pcm_open,
|
||||||
.close = nvhdmi_dig_playback_pcm_close_2ch,
|
.close = nvhdmi_dig_playback_pcm_close_2ch,
|
||||||
|
|
Loading…
Reference in New Issue