[alsa-devel] [PATCH 0/5] OMAPDSS: HDMI audio compliance fixes
I have rebased these patches from ti-linux-3.14.y on top of Linux 4.0.0. I tested them briefly on OMAP4 and OMAP5 in my environment, but I could not test any channel count beyond stereo. However, there were no conflicts in the rebase and each fix makes sense when looking at the chip TRM and the relevant HDMI specs.
All the changes are really minor, but most of them apply to OMAPDSS side, so it is probably best to merge them trough there.
Best regards, Jyri
Misael Lopez Cruz (5): OMAPDSS: HDMI4: Set correct CC for 8-channels layout OMAPDSS: HDMI5: Set valid sample order OMAPDSS: HDMI5: Fix AUDICONF3 bitfield offsets ASoC: omap-hdmi-audio: Force channel allocation only for OMAP4 ASoC: omap-hdmi-audio: Fix invalid combination of DM_INH and CA
drivers/video/fbdev/omap2/dss/hdmi4_core.c | 12 +++++++++++- drivers/video/fbdev/omap2/dss/hdmi5_core.c | 5 ++++- sound/soc/omap/omap-hdmi-audio.c | 12 +++++++----- 3 files changed, 22 insertions(+), 7 deletions(-)
From: Misael Lopez Cruz misael.lopez@ti.com
OMAP4 HDMI IP uses the 8-channel layout with 8-channel speaker allocation mask when transmitting more than two channels. But the channel count field (CC) of the Audio InfoFrame's DB1 is not updated for 8-channels.
As per HDMI Compliance Test 7.31 "Audio InfoFrame", CC = 7 is required for 8-channels CA masks (0x13 and 0x1F).
Signed-off-by: Misael Lopez Cruz misael.lopez@ti.com Signed-off-by: Jyri Sarha jsarha@ti.com --- drivers/video/fbdev/omap2/dss/hdmi4_core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/omap2/dss/hdmi4_core.c b/drivers/video/fbdev/omap2/dss/hdmi4_core.c index 7eafea5..2b8bd22 100644 --- a/drivers/video/fbdev/omap2/dss/hdmi4_core.c +++ b/drivers/video/fbdev/omap2/dss/hdmi4_core.c @@ -795,7 +795,9 @@ int hdmi4_audio_config(struct hdmi_core_data *core, struct hdmi_wp_data *wp,
/* * the HDMI IP needs to enable four stereo channels when transmitting - * more than 2 audio channels + * more than 2 audio channels. Similarly, the channel count in the + * Audio InfoFrame has to match the sample_present bits (some channels + * are padded with zeroes) */ if (channel_count == 2) { audio_format.stereo_channels = HDMI_AUDIO_STEREO_ONECHANNEL; @@ -807,6 +809,7 @@ int hdmi4_audio_config(struct hdmi_core_data *core, struct hdmi_wp_data *wp, HDMI_AUDIO_I2S_SD1_EN | HDMI_AUDIO_I2S_SD2_EN | HDMI_AUDIO_I2S_SD3_EN; acore.layout = HDMI_AUDIO_LAYOUT_8CH; + audio->cea->db1_ct_cc = 7; }
acore.en_spdif = false;
From: Misael Lopez Cruz misael.lopez@ti.com
As per TRM, HDMI_WP_AUDIO_CFG[2] LEFT_BEFORE = 0 is reserved, so it must always be set to 1 (the first sample is the left).
Signed-off-by: Misael Lopez Cruz misael.lopez@ti.com Signed-off-by: Jyri Sarha jsarha@ti.com --- drivers/video/fbdev/omap2/dss/hdmi5_core.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/video/fbdev/omap2/dss/hdmi5_core.c b/drivers/video/fbdev/omap2/dss/hdmi5_core.c index a3cfe3d..7a80beb 100644 --- a/drivers/video/fbdev/omap2/dss/hdmi5_core.c +++ b/drivers/video/fbdev/omap2/dss/hdmi5_core.c @@ -870,6 +870,7 @@ int hdmi5_audio_config(struct hdmi_core_data *core, struct hdmi_wp_data *wp, audio_format.samples_per_word = HDMI_AUDIO_ONEWORD_TWOSAMPLES; audio_format.sample_size = HDMI_AUDIO_SAMPLE_16BITS; audio_format.justification = HDMI_AUDIO_JUSTIFY_LEFT; + audio_format.sample_order = HDMI_AUDIO_SAMPLE_LEFT_FIRST;
/* only LPCM atm */ audio_format.type = HDMI_AUDIO_TYPE_LPCM;
From: Misael Lopez Cruz misael.lopez@ti.com
Downmix inhibit in HDMI_CORE_FC_AUDICONF3 register is in bit 4 while CEA861_AUDIO_INFOFRAME_DB5_DM_INH sets bit 7.
Signed-off-by: Misael Lopez Cruz misael.lopez@ti.com Signed-off-by: Jyri Sarha jsarha@ti.com --- drivers/video/fbdev/omap2/dss/hdmi5_core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/omap2/dss/hdmi5_core.c b/drivers/video/fbdev/omap2/dss/hdmi5_core.c index 7a80beb..c3286bd 100644 --- a/drivers/video/fbdev/omap2/dss/hdmi5_core.c +++ b/drivers/video/fbdev/omap2/dss/hdmi5_core.c @@ -790,7 +790,9 @@ static void hdmi5_core_audio_infoframe_cfg(struct hdmi_core_data *core,
hdmi_write_reg(base, HDMI_CORE_FC_AUDICONF1, info_aud->db2_sf_ss); hdmi_write_reg(base, HDMI_CORE_FC_AUDICONF2, info_aud->db4_ca); - hdmi_write_reg(base, HDMI_CORE_FC_AUDICONF3, info_aud->db5_dminh_lsv); + hdmi_write_reg(base, HDMI_CORE_FC_AUDICONF3, + (info_aud->db5_dminh_lsv & CEA861_AUDIO_INFOFRAME_DB5_DM_INH) >> 3 | + (info_aud->db5_dminh_lsv & CEA861_AUDIO_INFOFRAME_DB5_LSV)); }
int hdmi5_audio_config(struct hdmi_core_data *core, struct hdmi_wp_data *wp,
From: Misael Lopez Cruz misael.lopez@ti.com
There is a constraint in the OMAP4 HDMI IP that requires to use the 8-channel code when transmitting more than two channels.
The constraint doesn't apply for OMAP5 so don't force the channel allocation in the sound driver as it can be done specifically for OMAP4 later in the hdmi4 core.
Signed-off-by: Misael Lopez Cruz misael.lopez@ti.com Signed-off-by: Jyri Sarha jsarha@ti.com --- drivers/video/fbdev/omap2/dss/hdmi4_core.c | 7 +++++++ sound/soc/omap/omap-hdmi-audio.c | 6 ++---- 2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/video/fbdev/omap2/dss/hdmi4_core.c b/drivers/video/fbdev/omap2/dss/hdmi4_core.c index 2b8bd22..fa72e73 100644 --- a/drivers/video/fbdev/omap2/dss/hdmi4_core.c +++ b/drivers/video/fbdev/omap2/dss/hdmi4_core.c @@ -654,6 +654,13 @@ static void hdmi_core_audio_infoframe_cfg(struct hdmi_core_data *core, hdmi_write_reg(av_base, HDMI_CORE_AV_AUD_DBYTE(2), info_aud->db3); sum += info_aud->db3;
+ /* + * The OMAP HDMI IP requires to use the 8-channel channel code when + * transmitting more than two channels. + */ + if (info_aud->db4_ca != 0x00) + info_aud->db4_ca = 0x13; + hdmi_write_reg(av_base, HDMI_CORE_AV_AUD_DBYTE(3), info_aud->db4_ca); sum += info_aud->db4_ca;
diff --git a/sound/soc/omap/omap-hdmi-audio.c b/sound/soc/omap/omap-hdmi-audio.c index 4775da4..8df303f 100644 --- a/sound/soc/omap/omap-hdmi-audio.c +++ b/sound/soc/omap/omap-hdmi-audio.c @@ -210,12 +210,10 @@ static int hdmi_dai_hw_params(struct snd_pcm_substream *substream,
cea->db3 = 0; /* not used, all zeros */
- /* - * The OMAP HDMI IP requires to use the 8-channel channel code when - * transmitting more than two channels. - */ if (params_channels(params) == 2) cea->db4_ca = 0x0; + else if (params_channels(params) == 6) + cea->db4_ca = 0xb; else cea->db4_ca = 0x13;
On Wed, Apr 22, 2015 at 04:23:00PM +0300, Jyri Sarha wrote:
From: Misael Lopez Cruz misael.lopez@ti.com
There is a constraint in the OMAP4 HDMI IP that requires to use the 8-channel code when transmitting more than two channels.
Acked-by: Mark Brown broonie@kernel.org
From: Misael Lopez Cruz misael.lopez@ti.com
DM_INH = 1 (stereo downmix prohibited) and CA = 0x00 (Channel Allocation: FR, FL) is an invalid combination according to the HDMI Compliance Test 7.31 "Audio InfoFrame".
Signed-off-by: Misael Lopez Cruz misael.lopez@ti.com Signed-off-by: Jyri Sarha jsarha@ti.com --- sound/soc/omap/omap-hdmi-audio.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/sound/soc/omap/omap-hdmi-audio.c b/sound/soc/omap/omap-hdmi-audio.c index 8df303f..aeef25c 100644 --- a/sound/soc/omap/omap-hdmi-audio.c +++ b/sound/soc/omap/omap-hdmi-audio.c @@ -217,7 +217,11 @@ static int hdmi_dai_hw_params(struct snd_pcm_substream *substream, else cea->db4_ca = 0x13;
- cea->db5_dminh_lsv = CEA861_AUDIO_INFOFRAME_DB5_DM_INH_PROHIBITED; + if (cea->db4_ca == 0x00) + cea->db5_dminh_lsv = CEA861_AUDIO_INFOFRAME_DB5_DM_INH_PERMITTED; + else + cea->db5_dminh_lsv = CEA861_AUDIO_INFOFRAME_DB5_DM_INH_PROHIBITED; + /* the expression is trivial but makes clear what we are doing */ cea->db5_dminh_lsv |= (0 & CEA861_AUDIO_INFOFRAME_DB5_LSV);
On Wed, Apr 22, 2015 at 04:23:01PM +0300, Jyri Sarha wrote:
From: Misael Lopez Cruz misael.lopez@ti.com
DM_INH = 1 (stereo downmix prohibited) and CA = 0x00 (Channel Allocation: FR, FL) is an invalid combination according to the HDMI Compliance Test 7.31 "Audio InfoFrame".
Acked-by: Mark Brown broonie@kernel.org
Hi,
On 22/04/15 16:22, Jyri Sarha wrote:
I have rebased these patches from ti-linux-3.14.y on top of Linux 4.0.0. I tested them briefly on OMAP4 and OMAP5 in my environment, but I could not test any channel count beyond stereo. However, there were no conflicts in the rebase and each fix makes sense when looking at the chip TRM and the relevant HDMI specs.
All the changes are really minor, but most of them apply to OMAPDSS side, so it is probably best to merge them trough there.
Best regards, Jyri
Misael Lopez Cruz (5): OMAPDSS: HDMI4: Set correct CC for 8-channels layout OMAPDSS: HDMI5: Set valid sample order OMAPDSS: HDMI5: Fix AUDICONF3 bitfield offsets ASoC: omap-hdmi-audio: Force channel allocation only for OMAP4 ASoC: omap-hdmi-audio: Fix invalid combination of DM_INH and CA
drivers/video/fbdev/omap2/dss/hdmi4_core.c | 12 +++++++++++- drivers/video/fbdev/omap2/dss/hdmi5_core.c | 5 ++++- sound/soc/omap/omap-hdmi-audio.c | 12 +++++++----- 3 files changed, 22 insertions(+), 7 deletions(-)
I've queued these for 4.2.
Tomi
participants (3)
-
Jyri Sarha
-
Mark Brown
-
Tomi Valkeinen