Since RFC version of the patch set:
- Split callbacks removal patch away from "Integrated ASoC DAI
component driver implementation" patches for easier reading
This set of patches fixes OMAP4+ HDMI audio. The structure of the
implementatin looks a bit different than before. Instead of creating a
driver specific API for a separate ASoC component driver to connect
to, this implementation integrates an the component driver into the
HDMI driver.
The idea is to use an existing ASoC component driver API instead of
creating a new custom API for each HDMI IP and to avoid splitting the
driver to half for separate video and audio parts connected with the
API.
The new implementation also uses simple-audio-card for a machine
driver instead of having its own HW specific machine driver.
The patches are based on 3.15-rc2 merged with
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
and
git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux.git work/dss-dt-omap5
Everything is pushed here here:
git://git.ti.com/~jyrisarha/ti-linux-kernel/jyrisarhas-audio-video-linux-feature-tree.git omap-hdmi-audio
Best regards,
Jyri
Jyri Sarha (19):
ASoC: omap-pcm: Move omap-pcm under include/sound
OMAPDSS: hdmi-common: Add hdmi_dss_audio_from_hw_params()
OMAPDSS: hdmi4: Remove callbacks for an external ASoC DAI driver
OMAPDSS: hdmi4: Integrated ASoC DAI component driver implementation
OMAPDSS: Kconfig: Add depencies and help section to
OMAP4_DSS_HDMI_AUDIO
OMAPDSS: hdmi.h: Add HDMI_AUDIO_LAYOUT_6CH enum value
OMAPDSS: hdmi5_core: Fix compilation with OMAP5_DSS_HDMI_AUDIO
OMAPDSS: hdmi5: Remove callbacks for an external ASoC DAI driver
OMAPDSS: hdmi5: Integrated ASoC DAI component driver implementation
OMAPDSS: Kconfig: Add depencies and help section to
OMAP5_DSS_HDMI_AUDIO
ASoC: omap: Remove obsolete HDMI audio code and Kconfig options
OMAPDSS: Remove obsolete audio code
ARM: omap4.dtsi: Add audio related parametes to hdmi node
ARM: omap4-panda-common.dtsi: Add HDMI audio nodes
ARM: omap5.dtsi: Add audio related parameters to hdmi node
ARM: omap5-uevm.dts: Add hdmi audio related nodes
ARM: omap2plus_defconfig: Build DSS HDMI support for OMAP4 in kernel
ARM: omap2plus_defconfig: Enable OMAP5 HDMI support
ARM: omap2plus_defconfig: Enable OMAP4+ HDMI audio support
.../devicetree/bindings/video/ti,omap4-dss.txt | 4 +
.../devicetree/bindings/video/ti,omap5-dss.txt | 4 +
arch/arm/boot/dts/omap4-panda-common.dtsi | 21 +-
arch/arm/boot/dts/omap4.dtsi | 2 +
arch/arm/boot/dts/omap5-uevm.dts | 19 +
arch/arm/boot/dts/omap5.dtsi | 2 +
arch/arm/configs/omap2plus_defconfig | 20 +-
.../fbdev/omap2/displays-new/connector-hdmi.c | 99 ------
.../fbdev/omap2/displays-new/encoder-tpd12s015.c | 56 ---
drivers/video/fbdev/omap2/dss/Kconfig | 19 +-
drivers/video/fbdev/omap2/dss/hdmi.h | 8 +-
drivers/video/fbdev/omap2/dss/hdmi4.c | 216 ++++++++----
drivers/video/fbdev/omap2/dss/hdmi5.c | 216 ++++++++----
drivers/video/fbdev/omap2/dss/hdmi5_core.c | 2 +-
drivers/video/fbdev/omap2/dss/hdmi_common.c | 117 ++++++-
include/sound/omap-pcm.h | 30 ++
include/video/omapdss.h | 31 --
sound/soc/davinci/davinci-mcasp.c | 2 +-
sound/soc/omap/Kconfig | 13 -
sound/soc/omap/Makefile | 4 -
sound/soc/omap/omap-dmic.c | 2 +-
sound/soc/omap/omap-hdmi-card.c | 87 -----
sound/soc/omap/omap-hdmi.c | 364 --------------------
sound/soc/omap/omap-hdmi.h | 38 --
sound/soc/omap/omap-mcbsp.c | 2 +-
sound/soc/omap/omap-mcpdm.c | 2 +-
sound/soc/omap/omap-pcm.h | 30 --
27 files changed, 540 insertions(+), 870 deletions(-)
create mode 100644 include/sound/omap-pcm.h
delete mode 100644 sound/soc/omap/omap-hdmi-card.c
delete mode 100644 sound/soc/omap/omap-hdmi.c
delete mode 100644 sound/soc/omap/omap-hdmi.h
delete mode 100644 sound/soc/omap/omap-pcm.h
--
1.7.9.5
@@ -40,9 +40,9 @@#include<sound/pcm_params.h>#include<sound/soc.h>#include<sound/dmaengine_pcm.h>+#include<sound/omap-pcm.h>#include"omap-mcpdm.h"-#include"omap-pcm.h"structmcpdm_link_config{u32link_mask;/* channel mask for the direction */
@@ -1,30 +0,0 @@-/*- * omap-pcm.h - OMAP PCM driver- *- * Copyright (C) 2014 Texas Instruments, Inc.- *- * Author: Peter Ujfalusi <peter.ujfalusi@ti.com>- *- * This program is free software; you can redistribute it and/or- * modify it under the terms of the GNU General Public License- * version 2 as published by the Free Software Foundation.- *- * This program is distributed in the hope that it will be useful, but- * WITHOUT ANY WARRANTY; without even the implied warranty of- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU- * General Public License for more details.- */--#ifndef __OMAP_PCM_H__-#define __OMAP_PCM_H__--#if IS_ENABLED(CONFIG_SND_OMAP_SOC)-int omap_pcm_platform_register(struct device *dev);-#else-static inline int omap_pcm_platform_register(struct device *dev)-{- return 0;-}-#endif /* CONFIG_SND_OMAP_SOC */--#endif /* __OMAP_PCM_H__ */
@@ -463,4 +469,113 @@ int hdmi_compute_acr(u32 pclk, u32 sample_freq, u32 *n, u32 *cts)return0;}++inthdmi_dss_audio_from_hw_params(structsnd_pcm_hw_params*params,+structomap_dss_audio*dss_audio,+structsnd_soc_dai*dai)+{+structsnd_aes_iec958*iec=dss_audio->iec;+structsnd_cea_861_aud_if*cea=dss_audio->cea;++/*+*filltheIEC-60958channelstatusword+*/+/* initialize the word bytes */+memset(iec->status,0,sizeof(iec->status));++/* specify IEC-60958-3 (commercial use) */+iec->status[0]&=~IEC958_AES0_PROFESSIONAL;++/* specify that the audio is LPCM*/+iec->status[0]&=~IEC958_AES0_NONAUDIO;++iec->status[0]|=IEC958_AES0_CON_NOT_COPYRIGHT;++iec->status[0]|=IEC958_AES0_CON_EMPHASIS_NONE;++iec->status[0]|=IEC958_AES1_PRO_MODE_NOTID;++iec->status[1]=IEC958_AES1_CON_GENERAL;++iec->status[2]|=IEC958_AES2_CON_SOURCE_UNSPEC;++iec->status[2]|=IEC958_AES2_CON_CHANNEL_UNSPEC;++switch(params_rate(params)){+case32000:+iec->status[3]|=IEC958_AES3_CON_FS_32000;+break;+case44100:+iec->status[3]|=IEC958_AES3_CON_FS_44100;+break;+case48000:+iec->status[3]|=IEC958_AES3_CON_FS_48000;+break;+case88200:+iec->status[3]|=IEC958_AES3_CON_FS_88200;+break;+case96000:+iec->status[3]|=IEC958_AES3_CON_FS_96000;+break;+case176400:+iec->status[3]|=IEC958_AES3_CON_FS_176400;+break;+case192000:+iec->status[3]|=IEC958_AES3_CON_FS_192000;+break;+default:+dev_err(dai->dev,"rate not supported!\n");+return-EINVAL;+}++/* specify the clock accuracy */+iec->status[3]|=IEC958_AES3_CON_CLOCK_1000PPM;++/*+*specifythewordlength.Thesamewordlengthvaluecanmean+*twodifferentlengths.Hence,weneedtospecifythemaximum+*wordlengthaswell.+*/+switch(params_format(params)){+caseSNDRV_PCM_FORMAT_S16_LE:+iec->status[4]|=IEC958_AES4_CON_WORDLEN_20_16;+iec->status[4]&=~IEC958_AES4_CON_MAX_WORDLEN_24;+break;+caseSNDRV_PCM_FORMAT_S24_LE:+iec->status[4]|=IEC958_AES4_CON_WORDLEN_24_20;+iec->status[4]|=IEC958_AES4_CON_MAX_WORDLEN_24;+break;+default:+dev_err(dai->dev,"format not supported!\n");+return-EINVAL;+}++/*+*FilltheCEA-861audioinfoframe(seespecfordetails)+*/++cea->db1_ct_cc=(params_channels(params)-1)+&CEA861_AUDIO_INFOFRAME_DB1CC;+cea->db1_ct_cc|=CEA861_AUDIO_INFOFRAME_DB1CT_FROM_STREAM;++cea->db2_sf_ss=CEA861_AUDIO_INFOFRAME_DB2SF_FROM_STREAM;+cea->db2_sf_ss|=CEA861_AUDIO_INFOFRAME_DB2SS_FROM_STREAM;++cea->db3=0;/* not used, all zeros */++/*+*TheOMAPHDMIIPrequirestousethe8-channelchannelcodewhen+*transmittingmorethantwochannels.+*/+if(params_channels(params)=2)+cea->db4_ca=0x0;+else+cea->db4_ca=0x13;++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);++return0;+}#endif
Removes the OMAP4 HDMI audio callbacks for an external audio driver and
the old external DAI driver does not work anymore after this patch.
Signed-off-by: Jyri Sarha <redacted>
---
drivers/video/fbdev/omap2/dss/hdmi4.c | 113 ---------------------------------
1 file changed, 113 deletions(-)
@@ -107,6 +107,10 @@ Required properties: - clocks: handles to fclk and pll clock - clock-names: "fck", "sys_clk"+Required properties if hdmi audio support is enabled:+- dmas: DMA controller phandle for HDMI audio output+- dma-names: "audio_tx"+ Optional nodes: - Video port for HDMI output
@@ -509,6 +526,182 @@ static int hdmi_read_edid(struct omap_dss_device *dssdev,returnr;}+#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)+staticinthdmi_dai_startup(structsnd_pcm_substream*substream,+structsnd_soc_dai*dai)+{+intret;+/*+*MakesurethattheperiodbytesaremultipleoftheDMApacketsize.+*Largestpacketsizeweuseis3232-bitwords=128bytes+*/+ret=snd_pcm_hw_constraint_step(substream->runtime,0,+SNDRV_PCM_HW_PARAM_PERIOD_BYTES,128);+if(ret<0){+dev_err(dai->dev,"could not apply constraint\n");+returnret;+}++mutex_lock(&hdmi.lock);+ret=hdmi_mode_has_audio(hdmi.cfg.cm.mode);+mutex_unlock(&hdmi.lock);+if(!ret){+dev_err(dai->dev,"audio not supported\n");+return-ENODEV;+}++snd_soc_dai_set_dma_data(dai,substream,&hdmi.dma_data);++return0;+}++staticinthdmi_dai_prepare(structsnd_pcm_substream*substream,+structsnd_soc_dai*dai)+{+intr;++mutex_lock(&hdmi.lock);++if(!hdmi_mode_has_audio(hdmi.cfg.cm.mode)){+r=-EPERM;+gotoerr;+}++r=hdmi_wp_audio_enable(&hdmi.wp,true);++err:+mutex_unlock(&hdmi.lock);+returnr;+}++staticinthdmi_dai_hw_params(structsnd_pcm_substream*substream,+structsnd_pcm_hw_params*params,+structsnd_soc_dai*dai)+{+interr;++switch(params_format(params)){+caseSNDRV_PCM_FORMAT_S16_LE:+hdmi.dma_data.maxburst=16;+break;+caseSNDRV_PCM_FORMAT_S24_LE:+hdmi.dma_data.maxburst=32;+break;+default:+dev_err(dai->dev,"format not supported!\n");+return-EINVAL;+}++hdmi.dss_audio.iec=&hdmi.iec;+hdmi.dss_audio.cea=&hdmi.cea;+err=hdmi_dss_audio_from_hw_params(params,&hdmi.dss_audio,dai);+if(err)+returnerr;++mutex_lock(&hdmi.lock);++if(!hdmi_mode_has_audio(hdmi.cfg.cm.mode)){+err=-EPERM;+gotoerr;+}++err=hdmi4_audio_config(&hdmi.core,&hdmi.wp,&hdmi.dss_audio,+hdmi.cfg.timings.pixelclock);+err:+mutex_unlock(&hdmi.lock);+returnerr;+}++staticinthdmi_dai_trigger(structsnd_pcm_substream*substream,intcmd,+structsnd_soc_dai*dai)+{+interr=0;++switch(cmd){+caseSNDRV_PCM_TRIGGER_START:+caseSNDRV_PCM_TRIGGER_RESUME:+caseSNDRV_PCM_TRIGGER_PAUSE_RELEASE:+err=hdmi4_audio_start(&hdmi.core,&hdmi.wp);+break;+caseSNDRV_PCM_TRIGGER_STOP:+caseSNDRV_PCM_TRIGGER_SUSPEND:+caseSNDRV_PCM_TRIGGER_PAUSE_PUSH:+hdmi4_audio_stop(&hdmi.core,&hdmi.wp);+break;+default:+err=-EINVAL;+}+returnerr;+}++staticvoidhdmi_dai_shutdown(structsnd_pcm_substream*substream,+structsnd_soc_dai*dai)+{+hdmi_wp_audio_enable(&hdmi.wp,false);+}++staticconststructsnd_soc_dai_opshdmi_dai_ops={+.startup=hdmi_dai_startup,+.hw_params=hdmi_dai_hw_params,+.prepare=hdmi_dai_prepare,+.trigger=hdmi_dai_trigger,+.shutdown=hdmi_dai_shutdown,+};++staticstructsnd_soc_dai_driveromap_hdmi_dai={+.playback={+.channels_min=2,+.channels_max=8,+.rates=(SNDRV_PCM_RATE_32000|SNDRV_PCM_RATE_44100|+SNDRV_PCM_RATE_48000|SNDRV_PCM_RATE_88200|+SNDRV_PCM_RATE_96000|SNDRV_PCM_RATE_176400|+SNDRV_PCM_RATE_192000),+.formats=SNDRV_PCM_FMTBIT_S16_LE|SNDRV_PCM_FMTBIT_S24_LE,+},+.ops=&hdmi_dai_ops,+};++staticconststructsnd_soc_component_driveromap_hdmi_component={+.name="omapdss_hdmi",+};++staticinthdmi_audio_init(structplatform_device*pdev)+{+structresource*res;+intret;+res=platform_get_resource_byname(pdev,IORESOURCE_MEM,"wp");+if(!res){+dev_err(&pdev->dev,"Cannot obtain IORESOURCE_MEM l4\n");+return-ENODEV;+}+hdmi.dma_data.addr=res->start+HDMI_WP_AUDIO_DATA;+hdmi.dma_data.filter_data="audio_tx";+hdmi.dma_data.addr_width=DMA_SLAVE_BUSWIDTH_4_BYTES;++ret=snd_soc_register_component(&pdev->dev,&omap_hdmi_component,+&omap_hdmi_dai,1);+if(ret)+returnret;++returnomap_pcm_platform_register(&pdev->dev);+}++staticvoidhdmi_audio_remove(structplatform_device*pdev)+{+snd_soc_unregister_component(&pdev->dev);+}++#else+staticinthdmi_audio_init(structplatform_device*pdev)+{+return0;+}++staticvoidhdmi_audio_remove(structplatform_device*pdev)+{+}+#endif+staticconststructomapdss_hdmi_opshdmi_ops={.connect=hdmi_connect,.disconnect=hdmi_disconnect,
@@ -619,6 +812,10 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)returnr;}+r=hdmi_audio_init(pdev);+if(r)+returnr;+pm_runtime_enable(&pdev->dev);hdmi_init_output(pdev);
@@ -632,6 +829,8 @@ static int __exit omapdss_hdmihw_remove(struct platform_device *pdev){hdmi_uninit_output(pdev);+hdmi_audio_remove(pdev);+pm_runtime_disable(&pdev->dev);return0;
The OMAP5 HDMI audio implementation needs HDMI_AUDIO_LAYOUT_6CH in
hdmi_core_audio_layout enum. I found the correct value from ti-linux
3.8 tree.
Signed-off-by: Jyri Sarha <redacted>
---
drivers/video/fbdev/omap2/dss/hdmi.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Removes the OMAP5 HDMI audio callbacks for an external audio driver and
the old external DAI driver does not work anymore after this patch.
Signed-off-by: Jyri Sarha <redacted>
---
drivers/video/fbdev/omap2/dss/hdmi5.c | 113 ---------------------------------
1 file changed, 113 deletions(-)
@@ -88,6 +88,10 @@ Required properties: - clocks: handles to fclk and pll clock - clock-names: "fck", "sys_clk"+Required properties if hdmi audio support is enabled:+- dmas: DMA controller phandle for HDMI audio output+- dma-names: "audio_tx"+ Optional nodes: - Video port for HDMI output
@@ -534,6 +551,182 @@ static int hdmi_read_edid(struct omap_dss_device *dssdev,returnr;}+#if defined(CONFIG_OMAP5_DSS_HDMI_AUDIO)+staticinthdmi_dai_startup(structsnd_pcm_substream*substream,+structsnd_soc_dai*dai)+{+intret;+/*+*MakesurethattheperiodbytesaremultipleoftheDMApacketsize.+*Largestpacketsizeweuseis3232-bitwords=128bytes+*/+ret=snd_pcm_hw_constraint_step(substream->runtime,0,+SNDRV_PCM_HW_PARAM_PERIOD_BYTES,128);+if(ret<0){+dev_err(dai->dev,"could not apply constraint\n");+returnret;+}++mutex_lock(&hdmi.lock);+ret=hdmi_mode_has_audio(hdmi.cfg.cm.mode);+mutex_unlock(&hdmi.lock);+if(!ret){+dev_err(dai->dev,"audio not supported\n");+return-ENODEV;+}++snd_soc_dai_set_dma_data(dai,substream,&hdmi.dma_data);++return0;+}++staticinthdmi_dai_prepare(structsnd_pcm_substream*substream,+structsnd_soc_dai*dai)+{+intr;++mutex_lock(&hdmi.lock);++if(!hdmi_mode_has_audio(hdmi.cfg.cm.mode)){+r=-EPERM;+gotoerr;+}++r=hdmi_wp_audio_enable(&hdmi.wp,true);++err:+mutex_unlock(&hdmi.lock);+returnr;+}++staticinthdmi_dai_hw_params(structsnd_pcm_substream*substream,+structsnd_pcm_hw_params*params,+structsnd_soc_dai*dai)+{+interr;++switch(params_format(params)){+caseSNDRV_PCM_FORMAT_S16_LE:+hdmi.dma_data.maxburst=16;+break;+caseSNDRV_PCM_FORMAT_S24_LE:+hdmi.dma_data.maxburst=32;+break;+default:+dev_err(dai->dev,"format not supported!\n");+return-EINVAL;+}++hdmi.dss_audio.iec=&hdmi.iec;+hdmi.dss_audio.cea=&hdmi.cea;+err=hdmi_dss_audio_from_hw_params(params,&hdmi.dss_audio,dai);+if(err)+returnerr;++mutex_lock(&hdmi.lock);++if(!hdmi_mode_has_audio(hdmi.cfg.cm.mode)){+err=-EPERM;+gotoerr;+}++err=hdmi5_audio_config(&hdmi.core,&hdmi.wp,&hdmi.dss_audio,+hdmi.cfg.timings.pixelclock);+err:+mutex_unlock(&hdmi.lock);+returnerr;+}++staticinthdmi_dai_trigger(structsnd_pcm_substream*substream,intcmd,+structsnd_soc_dai*dai)+{+interr=0;++switch(cmd){+caseSNDRV_PCM_TRIGGER_START:+caseSNDRV_PCM_TRIGGER_RESUME:+caseSNDRV_PCM_TRIGGER_PAUSE_RELEASE:+err=hdmi_wp_audio_core_req_enable(&hdmi.wp,true);+break;+caseSNDRV_PCM_TRIGGER_STOP:+caseSNDRV_PCM_TRIGGER_SUSPEND:+caseSNDRV_PCM_TRIGGER_PAUSE_PUSH:+hdmi_wp_audio_core_req_enable(&hdmi.wp,false);+break;+default:+err=-EINVAL;+}+returnerr;+}++staticvoidhdmi_dai_shutdown(structsnd_pcm_substream*substream,+structsnd_soc_dai*dai)+{+hdmi_wp_audio_enable(&hdmi.wp,false);+}++staticconststructsnd_soc_dai_opshdmi_dai_ops={+.startup=hdmi_dai_startup,+.hw_params=hdmi_dai_hw_params,+.prepare=hdmi_dai_prepare,+.trigger=hdmi_dai_trigger,+.shutdown=hdmi_dai_shutdown,+};++staticstructsnd_soc_dai_driveromap_hdmi_dai={+.playback={+.channels_min=2,+.channels_max=8,+.rates=(SNDRV_PCM_RATE_32000|SNDRV_PCM_RATE_44100|+SNDRV_PCM_RATE_48000|SNDRV_PCM_RATE_88200|+SNDRV_PCM_RATE_96000|SNDRV_PCM_RATE_176400|+SNDRV_PCM_RATE_192000),+.formats=SNDRV_PCM_FMTBIT_S16_LE,+},+.ops=&hdmi_dai_ops,+};++staticconststructsnd_soc_component_driveromap_hdmi_component={+.name="omapdss_hdmi",+};++staticinthdmi_audio_init(structplatform_device*pdev)+{+structresource*res;+intret;+res=platform_get_resource_byname(pdev,IORESOURCE_MEM,"wp");+if(!res){+dev_err(&pdev->dev,"Cannot obtain IORESOURCE_MEM l4\n");+return-ENODEV;+}+hdmi.dma_data.addr=res->start+HDMI_WP_AUDIO_DATA;+hdmi.dma_data.filter_data="audio_tx";+hdmi.dma_data.addr_width=DMA_SLAVE_BUSWIDTH_4_BYTES;++ret=snd_soc_register_component(&pdev->dev,&omap_hdmi_component,+&omap_hdmi_dai,1);+if(ret)+returnret;++returnomap_pcm_platform_register(&pdev->dev);+}++staticvoidhdmi_audio_remove(structplatform_device*pdev)+{+snd_soc_unregister_component(&pdev->dev);+}++#else+staticinthdmi_audio_init(structplatform_device*pdev)+{+return0;+}++staticvoidhdmi_audio_remove(structplatform_device*pdev)+{+}+#endif+staticconststructomapdss_hdmi_opshdmi_ops={.connect=hdmi_connect,.disconnect=hdmi_disconnect,
@@ -644,6 +837,10 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)returnr;}+r=hdmi_audio_init(pdev);+if(r)+returnr;+pm_runtime_enable(&pdev->dev);hdmi_init_output(pdev);
@@ -657,6 +854,8 @@ static int __exit omapdss_hdmihw_remove(struct platform_device *pdev){hdmi_uninit_output(pdev);+hdmi_audio_remove(pdev);+pm_runtime_disable(&pdev->dev);return0;
@@ -12,9 +12,6 @@ config SND_OMAP_SOC_MCBSPconfigSND_OMAP_SOC_MCPDMtristate-configSND_OMAP_SOC_HDMI-tristate-configSND_OMAP_SOC_N810tristate"SoC Audio support for Nokia N810"depends onSND_OMAP_SOC&&MACH_NOKIA_N810&&I2C
@@ -100,16 +97,6 @@ config SND_OMAP_SOC_OMAP_ABE_TWL6040-PandaBoard(4430)-PandaBoardES(4460)-configSND_OMAP_SOC_OMAP_HDMI-tristate"SoC Audio support for Texas Instruments OMAP HDMI"-depends onSND_OMAP_SOC&&OMAP4_DSS_HDMI&&OMAP2_DSS-selectSND_OMAP_SOC_HDMI-selectSND_SOC_HDMI_CODEC-selectOMAP4_DSS_HDMI_AUDIO-help-SayYifyouwanttoaddsupportforSoCHDMIaudioonTexasInstruments-OMAP4chips-configSND_OMAP_SOC_OMAP3_PANDORAtristate"SoC Audio support for OMAP3 Pandora"depends onTWL4030_CORE&&SND_OMAP_SOC&&MACH_OMAP3_PANDORA
@@ -1,87 +0,0 @@-/*- * omap-hdmi-card.c- *- * OMAP ALSA SoC machine driver for TI OMAP HDMI- * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/- * Author: Ricardo Neri <ricardo.neri@ti.com>- *- * This program is free software; you can redistribute it and/or- * modify it under the terms of the GNU General Public License- * version 2 as published by the Free Software Foundation.- *- * This program is distributed in the hope that it will be useful, but- * WITHOUT ANY WARRANTY; without even the implied warranty of- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU- * General Public License for more details.- *- * You should have received a copy of the GNU General Public License- * along with this program; if not, write to the Free Software- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA- * 02110-1301 USA- *- */--#include <linux/module.h>-#include <sound/pcm.h>-#include <sound/soc.h>-#include <asm/mach-types.h>-#include <video/omapdss.h>--#define DRV_NAME "omap-hdmi-audio"--static struct snd_soc_dai_link omap_hdmi_dai = {- .name = "HDMI",- .stream_name = "HDMI",- .cpu_dai_name = "omap-hdmi-audio-dai",- .platform_name = "omap-hdmi-audio-dai",- .codec_name = "hdmi-audio-codec",- .codec_dai_name = "hdmi-hifi",-};--static struct snd_soc_card snd_soc_omap_hdmi = {- .name = "OMAPHDMI",- .owner = THIS_MODULE,- .dai_link = &omap_hdmi_dai,- .num_links = 1,-};--static int omap_hdmi_probe(struct platform_device *pdev)-{- struct snd_soc_card *card = &snd_soc_omap_hdmi;- int ret;-- card->dev = &pdev->dev;-- ret = snd_soc_register_card(card);- if (ret) {- dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret);- card->dev = NULL;- return ret;- }- return 0;-}--static int omap_hdmi_remove(struct platform_device *pdev)-{- struct snd_soc_card *card = platform_get_drvdata(pdev);-- snd_soc_unregister_card(card);- card->dev = NULL;- return 0;-}--static struct platform_driver omap_hdmi_driver = {- .driver = {- .name = DRV_NAME,- .owner = THIS_MODULE,- },- .probe = omap_hdmi_probe,- .remove = omap_hdmi_remove,-};--module_platform_driver(omap_hdmi_driver);--MODULE_AUTHOR("Ricardo Neri <ricardo.neri@ti.com>");-MODULE_DESCRIPTION("OMAP HDMI machine ASoC driver");-MODULE_LICENSE("GPL");-MODULE_ALIAS("platform:" DRV_NAME);
@@ -1,38 +0,0 @@-/*- * omap-hdmi.h- *- * Definitions for OMAP ALSA SoC DAI driver for HDMI audio on OMAP4 processors.- * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com/- * Authors: Jorge Candelaria <jorge.candelaria@ti.com>- * Ricardo Neri <ricardo.neri@ti.com>- *- * This program is free software; you can redistribute it and/or- * modify it under the terms of the GNU General Public License- * version 2 as published by the Free Software Foundation.- *- * This program is distributed in the hope that it will be useful, but- * WITHOUT ANY WARRANTY; without even the implied warranty of- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU- * General Public License for more details.- *- * You should have received a copy of the GNU General Public License- * along with this program; if not, write to the Free Software- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA- * 02110-1301 USA- *- */--#ifndef __OMAP_HDMI_H__-#define __OMAP_HDMI_H__--#define OMAP_HDMI_AUDIO_DMA_PORT 0x8c--#define OMAP_HDMI_RATES (SNDRV_PCM_RATE_32000 | \- 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 OMAP_HDMI_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \- SNDRV_PCM_FMTBIT_S24_LE)--#endif
Removes all code related to external audio driver callbacks. There is
no need for those now that sound/soc/omap/omap-hdmi.c is removed.
Signed-off-by: Jyri Sarha <redacted>
---
.../fbdev/omap2/displays-new/connector-hdmi.c | 99 --------------------
.../fbdev/omap2/displays-new/encoder-tpd12s015.c | 56 -----------
include/video/omapdss.h | 31 ------
3 files changed, 186 deletions(-)
@@ -170,98 +170,6 @@ static bool hdmic_detect(struct omap_dss_device *dssdev)returnin->ops.hdmi->detect(in);}-staticinthdmic_audio_enable(structomap_dss_device*dssdev)-{-structpanel_drv_data*ddata=to_panel_data(dssdev);-structomap_dss_device*in=ddata->in;-intr;--/* enable audio only if the display is active */-if(!omapdss_device_is_enabled(dssdev))-return-EPERM;--r=in->ops.hdmi->audio_enable(in);-if(r)-returnr;--dssdev->audio_state=OMAP_DSS_AUDIO_ENABLED;--return0;-}--staticvoidhdmic_audio_disable(structomap_dss_device*dssdev)-{-structpanel_drv_data*ddata=to_panel_data(dssdev);-structomap_dss_device*in=ddata->in;--in->ops.hdmi->audio_disable(in);--dssdev->audio_state=OMAP_DSS_AUDIO_DISABLED;-}--staticinthdmic_audio_start(structomap_dss_device*dssdev)-{-structpanel_drv_data*ddata=to_panel_data(dssdev);-structomap_dss_device*in=ddata->in;-intr;--/*-*Noneedtocheckthepanelstate.Itwascheckedwhentrasitioning-*toAUDIO_ENABLED.-*/-if(dssdev->audio_state!=OMAP_DSS_AUDIO_ENABLED)-return-EPERM;--r=in->ops.hdmi->audio_start(in);-if(r)-returnr;--dssdev->audio_state=OMAP_DSS_AUDIO_PLAYING;--return0;-}--staticvoidhdmic_audio_stop(structomap_dss_device*dssdev)-{-structpanel_drv_data*ddata=to_panel_data(dssdev);-structomap_dss_device*in=ddata->in;--in->ops.hdmi->audio_stop(in);--dssdev->audio_state=OMAP_DSS_AUDIO_ENABLED;-}--staticboolhdmic_audio_supported(structomap_dss_device*dssdev)-{-structpanel_drv_data*ddata=to_panel_data(dssdev);-structomap_dss_device*in=ddata->in;--if(!omapdss_device_is_enabled(dssdev))-returnfalse;--returnin->ops.hdmi->audio_supported(in);-}--staticinthdmic_audio_config(structomap_dss_device*dssdev,-structomap_dss_audio*audio)-{-structpanel_drv_data*ddata=to_panel_data(dssdev);-structomap_dss_device*in=ddata->in;-intr;--/* config audio only if the display is active */-if(!omapdss_device_is_enabled(dssdev))-return-EPERM;--r=in->ops.hdmi->audio_config(in,audio);-if(r)-returnr;--dssdev->audio_state=OMAP_DSS_AUDIO_CONFIGURED;--return0;-}-staticstructomap_dss_driverhdmic_driver={.connect=hdmic_connect,.disconnect=hdmic_disconnect,
@@ -629,19 +629,6 @@ struct omapdss_hdmi_ops {int(*read_edid)(structomap_dss_device*dssdev,u8*buf,intlen);bool(*detect)(structomap_dss_device*dssdev);--/*-*Note:Thesefunctionsmightsleep.Donotcallwhile-*holdingaspinlock/readlock.-*/-int(*audio_enable)(structomap_dss_device*dssdev);-void(*audio_disable)(structomap_dss_device*dssdev);-bool(*audio_supported)(structomap_dss_device*dssdev);-int(*audio_config)(structomap_dss_device*dssdev,-structomap_dss_audio*audio);-/* Note: These functions may not sleep */-int(*audio_start)(structomap_dss_device*dssdev);-void(*audio_stop)(structomap_dss_device*dssdev);};structomapdss_dsi_ops{
@@ -848,24 +835,6 @@ struct omap_dss_driver {int(*read_edid)(structomap_dss_device*dssdev,u8*buf,intlen);bool(*detect)(structomap_dss_device*dssdev);--/*-*Fordisplaydriversthatsupportaudio.Thisencompasses-*HDMIandDisplayPortatthemoment.-*/-/*-*Note:Thesefunctionsmightsleep.Donotcallwhile-*holdingaspinlock/readlock.-*/-int(*audio_enable)(structomap_dss_device*dssdev);-void(*audio_disable)(structomap_dss_device*dssdev);-bool(*audio_supported)(structomap_dss_device*dssdev);-int(*audio_config)(structomap_dss_device*dssdev,-structomap_dss_audio*audio);-/* Note: These functions may not sleep */-int(*audio_start)(structomap_dss_device*dssdev);-void(*audio_stop)(structomap_dss_device*dssdev);-};enumomapdss_versionomapdss_get_version(void);
Adds a simple-card sound node for HDMI audio, the associated
hdmi-codec node, and sound-dai-cells propeties to the DAI nodes.
Signed-off-by: Jyri Sarha <redacted>
---
arch/arm/boot/dts/omap4-panda-common.dtsi | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
@@ -65,6 +65,24 @@"AFMR","Line In";};+sound@1{+compatible="simple-audio-card";++simple-audio-card,cpu{+sound-dai=<&hdmi>;+};++simple-audio-card,codec{+sound-dai=<&hdmi_audio>;+};+};++hdmi_audio:hdmi_audio@0{+#sound-dai-cells=<0>;+compatible="linux,hdmi-audio";+status="okay";+};+/* HS USB Port 1 Power */hsusb1_power:hsusb1_power_reg{compatible="regulator-fixed";
Adds a simple-card sound node for HDMI audio, the associated
hdmi-codec node, and sound-dai-cells propeties to the DAI nodes.
Signed-off-by: Jyri Sarha <redacted>
---
arch/arm/boot/dts/omap5-uevm.dts | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
This patch is here only as an example on how to enable HDMI video for
Panda board. In addition to this patch omapdss.def_disp=hdmi parameter
should be added to kernel command line in order to enable HDMI video.
Signed-off-by: Jyri Sarha <redacted>
---
arch/arm/configs/omap2plus_defconfig | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
This patch is here only as an example on how to enable HDMI video for
OMAP5 uEVM. Adds CONFIG_GPIO_PCA953X=y and CONFIG_OMAP5_DSS_HDMI=y.
Signed-off-by: Jyri Sarha <redacted>
---
arch/arm/configs/omap2plus_defconfig | 2 ++
1 file changed, 2 insertions(+)
This patch is here only as an example on how to enable HDMI audio for
OMAP4+ HW. Adds CONFIG_SND_SIMPLE_CARD=m and CONFIG_SND_SOC_HDMI_CODEC=m.
Also builds SND_OMAP_SOC in kernel to support in kernel built OMAPDSS
with integrated HDMI DAI driver.
Signed-off-by: Jyri Sarha <redacted>
---
arch/arm/configs/omap2plus_defconfig | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
From: Tony Lindgren <tony@atomide.com> Date: 2014-05-12 15:06:16
* Jyri Sarha [off-list ref] [140512 02:13]:
Since RFC version of the patch set:
- Split callbacks removal patch away from "Integrated ASoC DAI
component driver implementation" patches for easier reading
This set of patches fixes OMAP4+ HDMI audio. The structure of the
implementatin looks a bit different than before. Instead of creating a
driver specific API for a separate ASoC component driver to connect
to, this implementation integrates an the component driver into the
HDMI driver.
The idea is to use an existing ASoC component driver API instead of
creating a new custom API for each HDMI IP and to avoid splitting the
driver to half for separate video and audio parts connected with the
API.
The new implementation also uses simple-audio-card for a machine
driver instead of having its own HW specific machine driver.
Can you guys please post this split into the following separate
parts for the maintainers to merge:
- ASoC changes
- DSS changes
- DTS changes
And once those are all in, please post the defconfig changes.
Regards,
Tony
From: Mark Brown <broonie@kernel.org> Date: 2014-05-12 17:22:43
On Mon, May 12, 2014 at 12:12:22PM +0300, Jyri Sarha wrote:
Removes omap-hdmi DAI driver, omap-hdmi-card driver, the related
Kconfig options, and Makefile entries. The HDMI DAI drivers has been
integrated directly to OMAP4+ HDMI drivers and simple-card driver is
used instead of omap-hdmi-card driver.
From: Joachim Eastwood <hidden> Date: 2014-05-12 21:13:14
On 12 May 2014 11:12, Jyri Sarha [off-list ref] wrote:
Since RFC version of the patch set:
- Split callbacks removal patch away from "Integrated ASoC DAI
component driver implementation" patches for easier reading
This set of patches fixes OMAP4+ HDMI audio. The structure of the
implementatin looks a bit different than before. Instead of creating a
driver specific API for a separate ASoC component driver to connect
to, this implementation integrates an the component driver into the
HDMI driver.
The idea is to use an existing ASoC component driver API instead of
creating a new custom API for each HDMI IP and to avoid splitting the
driver to half for separate video and audio parts connected with the
API.
The new implementation also uses simple-audio-card for a machine
driver instead of having its own HW specific machine driver.
The patches are based on 3.15-rc2 merged with
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
and
git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux.git work/dss-dt-omap5
Everything is pushed here here:
git://git.ti.com/~jyrisarha/ti-linux-kernel/jyrisarhas-audio-video-linux-feature-tree.git omap-hdmi-audio
hey, this worked straight away :)
But there seems to be something wrong with the channel mapping.
For stereo (speaker-test -c 2) the mapping is correct.
But for -c 4 and -c 8 it gets weird:
speaker-test -c 4 -s X # where X is 1-4
1: Front Left is Rear Left
2: Front Right is Rear Right
3: Rear Right is Front Right
4: Rear Left is Front Left
speaker-test -c 8 -s X # where X is 1-8
1: Front Left is Rear Left
2: Center is Rear Left
3: Front Right is Rear Right
4: Side Right is Front Right
5: Rear Right is silent
6: Rear Left is Center
7: Side Left is Front Left
8: LFE - Rear Right
I think you need to check what channel order ALSA expects. I believe
speaker-test does the right thing on my HTPC normally connected to my
receiver.
Note: I am not 100% sure about the -c 8 results. I might have to do
the test again.
Tested on VAR-DVK-OM44 (OMAP4460) with Yamaha RX-A1030 Surround receiver.
regards
Joachim Eastwood
On 12 May 2014 11:12, Jyri Sarha [off-list ref] wrote:
...
hey, this worked straight away :)
But there seems to be something wrong with the channel mapping.
For stereo (speaker-test -c 2) the mapping is correct.
But for -c 4 and -c 8 it gets weird:
speaker-test -c 4 -s X # where X is 1-4
1: Front Left is Rear Left
2: Front Right is Rear Right
3: Rear Right is Front Right
4: Rear Left is Front Left
speaker-test -c 8 -s X # where X is 1-8
1: Front Left is Rear Left
2: Center is Rear Left
3: Front Right is Rear Right
4: Side Right is Front Right
5: Rear Right is silent
6: Rear Left is Center
7: Side Left is Front Left
8: LFE - Rear Right
I think you need to check what channel order ALSA expects. I believe
speaker-test does the right thing on my HTPC normally connected to my
receiver.
I checked the implementation and there was indeed something weird there,
but the implementation can not explain the FL and FR channels jumping
around. FL and FL should always be the first two channels in all
configurations and the implementation does not touch them.
The implementation uses 8ch HDMI setup for anything above 2ch with
"Audio InfoFrame Data Byte 4" set to 0x13. According to CEA-861 specs
this means following channel order: FL, FR, LFE, FC, RL, RR, RLC, RRC
This is a closest match to ALSA 8ch mapping (according to
sound/core/pcm_lib.c) which is: FL, FR, FC, LFE, RL, RR, SL, SR
Current implementation has FLE and FC channels correctly swapped, but it
shifts them to last two channels and RL, RR, SL, SR are shifted down to
fill the place. This is all wrong and I'll try to come up with a fix for
that. Unfortunately I can not test anything beyond 2 ch myself so I
would need someone to volunteer to test my patch.
Best regards,
Jyri
From: Joachim Eastwood <hidden> Date: 2014-05-14 16:25:47
On 14 May 2014 12:02, Jyri Sarha [off-list ref] wrote:
On 05/13/2014 12:13 AM, Joachim Eastwood wrote:
quoted
On 12 May 2014 11:12, Jyri Sarha [off-list ref] wrote:
...
quoted
hey, this worked straight away :)
But there seems to be something wrong with the channel mapping.
For stereo (speaker-test -c 2) the mapping is correct.
But for -c 4 and -c 8 it gets weird:
speaker-test -c 4 -s X # where X is 1-4
1: Front Left is Rear Left
2: Front Right is Rear Right
3: Rear Right is Front Right
4: Rear Left is Front Left
speaker-test -c 8 -s X # where X is 1-8
1: Front Left is Rear Left
2: Center is Rear Left
3: Front Right is Rear Right
4: Side Right is Front Right
5: Rear Right is silent
6: Rear Left is Center
7: Side Left is Front Left
8: LFE - Rear Right
I think you need to check what channel order ALSA expects. I believe
speaker-test does the right thing on my HTPC normally connected to my
receiver.
I checked the implementation and there was indeed something weird there, but
the implementation can not explain the FL and FR channels jumping around. FL
and FL should always be the first two channels in all configurations and the
implementation does not touch them.
The implementation uses 8ch HDMI setup for anything above 2ch with "Audio
InfoFrame Data Byte 4" set to 0x13. According to CEA-861 specs this means
following channel order: FL, FR, LFE, FC, RL, RR, RLC, RRC
This is a closest match to ALSA 8ch mapping (according to
sound/core/pcm_lib.c) which is: FL, FR, FC, LFE, RL, RR, SL, SR
hm, okey. I haven't look at the code but it do seem strange. But with
speaker-test -c 4 the front and back are surely swapped here.
I'll do some more testing and also check with my HTPC. btw, I only
have a 5.1 setup over here so I can't test all the discrete channels.
Current implementation has FLE and FC channels correctly swapped, but it
shifts them to last two channels and RL, RR, SL, SR are shifted down to fill
the place. This is all wrong and I'll try to come up with a fix for that.
Unfortunately I can not test anything beyond 2 ch myself so I would need
someone to volunteer to test my patch.
I have the dev kit setup up over here so I can test your patches.
regards
Joachim Eastwood
From: Tomi Valkeinen <hidden> Date: 2014-05-16 11:04:44
On 12/05/14 12:12, Jyri Sarha wrote:
quoted hunk
Adds a simple-card sound node for HDMI audio, the associated
hdmi-codec node, and sound-dai-cells propeties to the DAI nodes.
Signed-off-by: Jyri Sarha <redacted>
---
arch/arm/boot/dts/omap4-panda-common.dtsi | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
@@ -65,6 +65,24 @@"AFMR","Line In";};+sound@1{+compatible="simple-audio-card";++simple-audio-card,cpu{+sound-dai=<&hdmi>;+};++simple-audio-card,codec{+sound-dai=<&hdmi_audio>;+};+};++hdmi_audio:hdmi_audio@0{+#sound-dai-cells=<0>;+compatible="linux,hdmi-audio";+status="okay";+};+/* HS USB Port 1 Power */hsusb1_power:hsusb1_power_reg{compatible="regulator-fixed";
Maybe this is how this has to be done, but I'll still ask:
Considering that the HDMI audio is basically inseparable part of the
OMAP HDMI video, and if a board has HDMI video connector connected to
the SoC's HDMI, then it has HDMI audio.
So all of the above .dts changes are already implied when we have HDMI
video on the board. Is there no way to prevent every board needing to
add those exact same nodes to get HDMI audio?
Tomi
From: Mark Brown <broonie@kernel.org> Date: 2014-05-16 11:08:50
On Fri, May 16, 2014 at 02:04:44PM +0300, Tomi Valkeinen wrote:
So all of the above .dts changes are already implied when we have HDMI
video on the board. Is there no way to prevent every board needing to
add those exact same nodes to get HDMI audio?
You can always instantiate devices directly from the HDMI controller
code, there's no need to put things in DT at all.
From: Joachim Eastwood <hidden> Date: 2014-05-17 08:51:53
On 14 May 2014 18:25, Joachim Eastwood [off-list ref] wrote:
On 14 May 2014 12:02, Jyri Sarha [off-list ref] wrote:
quoted
On 05/13/2014 12:13 AM, Joachim Eastwood wrote:
quoted
On 12 May 2014 11:12, Jyri Sarha [off-list ref] wrote:
...
quoted
hey, this worked straight away :)
But there seems to be something wrong with the channel mapping.
For stereo (speaker-test -c 2) the mapping is correct.
But for -c 4 and -c 8 it gets weird:
speaker-test -c 4 -s X # where X is 1-4
1: Front Left is Rear Left
2: Front Right is Rear Right
3: Rear Right is Front Right
4: Rear Left is Front Left
speaker-test -c 8 -s X # where X is 1-8
1: Front Left is Rear Left
2: Center is Rear Left
3: Front Right is Rear Right
4: Side Right is Front Right
5: Rear Right is silent
6: Rear Left is Center
7: Side Left is Front Left
8: LFE - Rear Right
I think you need to check what channel order ALSA expects. I believe
speaker-test does the right thing on my HTPC normally connected to my
receiver.
I checked the implementation and there was indeed something weird there, but
the implementation can not explain the FL and FR channels jumping around. FL
and FL should always be the first two channels in all configurations and the
implementation does not touch them.
The implementation uses 8ch HDMI setup for anything above 2ch with "Audio
InfoFrame Data Byte 4" set to 0x13. According to CEA-861 specs this means
following channel order: FL, FR, LFE, FC, RL, RR, RLC, RRC
This is a closest match to ALSA 8ch mapping (according to
sound/core/pcm_lib.c) which is: FL, FR, FC, LFE, RL, RR, SL, SR
hm, okey. I haven't look at the code but it do seem strange. But with
speaker-test -c 4 the front and back are surely swapped here.
I'll do some more testing and also check with my HTPC. btw, I only
have a 5.1 setup over here so I can't test all the discrete channels.
quoted
Current implementation has FLE and FC channels correctly swapped, but it
shifts them to last two channels and RL, RR, SL, SR are shifted down to fill
the place. This is all wrong and I'll try to come up with a fix for that.
Unfortunately I can not test anything beyond 2 ch myself so I would need
someone to volunteer to test my patch.
I have the dev kit setup up over here so I can test your patches.
I did some more testing over here.
My HTPC (nVidia ION2 based) works good with speaker-test and all
channels are where they are suppose to be.
On the OMAP4 board I tried doing: "while true; do speaker-test -c 4 -s
1; done" and this had an interesting effect.
Most of the time FL (Front Left) is swapped with BL (Back Left) but
about every 10th time the sound comes out in the FL speaker... So
there something weird going on here. Same story for the right channel.
I also noticed that HDMI doesn't always work on boot up, it sometimes fail with:
[ 193.985565] omapdss_hdmi 58006000.encoder: audio not supported
[ 193.985565] omapdss_hdmi 58006000.encoder: ASoC: can't open
interface 58006000.encoder: -19
But after replugging the HDMI connector a couple of times it starts to work.
I'll see if I can try with an old TI OMAP4 kernel (3.4) and see how that works.
regards
Joachim Eastwood
From: Joachim Eastwood <hidden> Date: 2014-05-17 09:16:15
On 17 May 2014 10:51, Joachim Eastwood [off-list ref] wrote:
On 14 May 2014 18:25, Joachim Eastwood [off-list ref] wrote:
quoted
On 14 May 2014 12:02, Jyri Sarha [off-list ref] wrote:
quoted
On 05/13/2014 12:13 AM, Joachim Eastwood wrote:
quoted
On 12 May 2014 11:12, Jyri Sarha [off-list ref] wrote:
...
quoted
hey, this worked straight away :)
But there seems to be something wrong with the channel mapping.
For stereo (speaker-test -c 2) the mapping is correct.
But for -c 4 and -c 8 it gets weird:
speaker-test -c 4 -s X # where X is 1-4
1: Front Left is Rear Left
2: Front Right is Rear Right
3: Rear Right is Front Right
4: Rear Left is Front Left
speaker-test -c 8 -s X # where X is 1-8
1: Front Left is Rear Left
2: Center is Rear Left
3: Front Right is Rear Right
4: Side Right is Front Right
5: Rear Right is silent
6: Rear Left is Center
7: Side Left is Front Left
8: LFE - Rear Right
I think you need to check what channel order ALSA expects. I believe
speaker-test does the right thing on my HTPC normally connected to my
receiver.
I checked the implementation and there was indeed something weird there, but
the implementation can not explain the FL and FR channels jumping around. FL
and FL should always be the first two channels in all configurations and the
implementation does not touch them.
The implementation uses 8ch HDMI setup for anything above 2ch with "Audio
InfoFrame Data Byte 4" set to 0x13. According to CEA-861 specs this means
following channel order: FL, FR, LFE, FC, RL, RR, RLC, RRC
This is a closest match to ALSA 8ch mapping (according to
sound/core/pcm_lib.c) which is: FL, FR, FC, LFE, RL, RR, SL, SR
hm, okey. I haven't look at the code but it do seem strange. But with
speaker-test -c 4 the front and back are surely swapped here.
I'll do some more testing and also check with my HTPC. btw, I only
have a 5.1 setup over here so I can't test all the discrete channels.
quoted
Current implementation has FLE and FC channels correctly swapped, but it
shifts them to last two channels and RL, RR, SL, SR are shifted down to fill
the place. This is all wrong and I'll try to come up with a fix for that.
Unfortunately I can not test anything beyond 2 ch myself so I would need
someone to volunteer to test my patch.
I have the dev kit setup up over here so I can test your patches.
I did some more testing over here.
My HTPC (nVidia ION2 based) works good with speaker-test and all
channels are where they are suppose to be.
On the OMAP4 board I tried doing: "while true; do speaker-test -c 4 -s
1; done" and this had an interesting effect.
Most of the time FL (Front Left) is swapped with BL (Back Left) but
about every 10th time the sound comes out in the FL speaker... So
there something weird going on here. Same story for the right channel.
I also noticed that HDMI doesn't always work on boot up, it sometimes fail with:
[ 193.985565] omapdss_hdmi 58006000.encoder: audio not supported
[ 193.985565] omapdss_hdmi 58006000.encoder: ASoC: can't open
interface 58006000.encoder: -19
But after replugging the HDMI connector a couple of times it starts to work.
I'll see if I can try with an old TI OMAP4 kernel (3.4) and see how that works.
On the 3.4 Variscite kernel:
Linux version 3.4.0-1489-omap4 (uri@pluto) (gcc version 4.6.3
(Ubuntu/Linaro 4.6.3-1ubuntu5) ) #27 SMP PREEMPT Sun Apr 7 13:27:10
IDT 2013
git://dev.omapzoom.org/pub/scm/integration/kernel-ubuntu.git +
Variscite vendor patches
Both speaker-test -c 4 and -c 8 works. All channels are where they are
suppose to be.
Hot plugging is broken, though. So the HDMI must be connected on boot,
but that might be the Variscite board setup.
regards
Joachim Eastwood
On 17 May 2014 10:51, Joachim Eastwood [off-list ref] wrote:
quoted
On 14 May 2014 18:25, Joachim Eastwood [off-list ref] wrote:
...
quoted
I did some more testing over here.
My HTPC (nVidia ION2 based) works good with speaker-test and all
channels are where they are suppose to be.
On the OMAP4 board I tried doing: "while true; do speaker-test -c 4 -s
1; done" and this had an interesting effect.
Most of the time FL (Front Left) is swapped with BL (Back Left) but
about every 10th time the sound comes out in the FL speaker... So
there something weird going on here. Same story for the right channel.
I also noticed that HDMI doesn't always work on boot up, it sometimes fail with:
[ 193.985565] omapdss_hdmi 58006000.encoder: audio not supported
[ 193.985565] omapdss_hdmi 58006000.encoder: ASoC: can't open
interface 58006000.encoder: -19
But after replugging the HDMI connector a couple of times it starts to work.
That is weird I can not reproduce this problem. I rebooted my panda
several times and the audio device was always there. Could it be that
the connector is in DVI mode or something?
quoted
I'll see if I can try with an old TI OMAP4 kernel (3.4) and see how that works.
On the 3.4 Variscite kernel:
Linux version 3.4.0-1489-omap4 (uri@pluto) (gcc version 4.6.3
(Ubuntu/Linaro 4.6.3-1ubuntu5) ) #27 SMP PREEMPT Sun Apr 7 13:27:10
IDT 2013
git://dev.omapzoom.org/pub/scm/integration/kernel-ubuntu.git +
Variscite vendor patches
Both speaker-test -c 4 and -c 8 works. All channels are where they are
suppose to be.
Hot plugging is broken, though. So the HDMI must be connected on boot,
but that might be the Variscite board setup.
I checked the ubuntu branch implementation and found that it is quite
different in many places, but the one place that affects the i2s channel
mapping to HDMI looks exactly the same. So there must be a bug some
where else and there is no point trying to fix it by changing the
mapping (it would be impossible anyway). I'll compare the
implementations further when I have time.
Thanks for your testing. Now I at least now where the bug is not.
Best regards,
Jyri
From: Tomi Valkeinen <hidden> Date: 2014-05-23 11:02:37
On 12/05/14 18:06, Tony Lindgren wrote:
* Jyri Sarha [off-list ref] [140512 02:13]:
quoted
Since RFC version of the patch set:
- Split callbacks removal patch away from "Integrated ASoC DAI
component driver implementation" patches for easier reading
This set of patches fixes OMAP4+ HDMI audio. The structure of the
implementatin looks a bit different than before. Instead of creating a
driver specific API for a separate ASoC component driver to connect
to, this implementation integrates an the component driver into the
HDMI driver.
The idea is to use an existing ASoC component driver API instead of
creating a new custom API for each HDMI IP and to avoid splitting the
driver to half for separate video and audio parts connected with the
API.
The new implementation also uses simple-audio-card for a machine
driver instead of having its own HW specific machine driver.
Can you guys please post this split into the following separate
parts for the maintainers to merge:
- ASoC changes
- DSS changes
- DTS changes
And once those are all in, please post the defconfig changes.
Tony, this series will get delayed until 3.17, but I'd like to merge the
HDMI DMA channel changes to omap4/omap5.dtsi already to 3.16. They are
patches 13 and 15.
Those are very trivial, but I'd rather have acks from you for all the
.dts changes I'll be sending.
Tomi
From: Tony Lindgren <tony@atomide.com> Date: 2014-05-23 14:46:17
* Tomi Valkeinen [off-list ref] [140523 04:03]:
On 12/05/14 18:06, Tony Lindgren wrote:
quoted
* Jyri Sarha [off-list ref] [140512 02:13]:
quoted
Since RFC version of the patch set:
- Split callbacks removal patch away from "Integrated ASoC DAI
component driver implementation" patches for easier reading
This set of patches fixes OMAP4+ HDMI audio. The structure of the
implementatin looks a bit different than before. Instead of creating a
driver specific API for a separate ASoC component driver to connect
to, this implementation integrates an the component driver into the
HDMI driver.
The idea is to use an existing ASoC component driver API instead of
creating a new custom API for each HDMI IP and to avoid splitting the
driver to half for separate video and audio parts connected with the
API.
The new implementation also uses simple-audio-card for a machine
driver instead of having its own HW specific machine driver.
Can you guys please post this split into the following separate
parts for the maintainers to merge:
- ASoC changes
- DSS changes
- DTS changes
And once those are all in, please post the defconfig changes.
Tony, this series will get delayed until 3.17, but I'd like to merge the
HDMI DMA channel changes to omap4/omap5.dtsi already to 3.16. They are
patches 13 and 15.
Those are very trivial, but I'd rather have acks from you for all the
.dts changes I'll be sending.
OK fine with me:
Acked-by: Tony Lindgren <tony@atomide.com>