Greetings,
We are having a hard time to make McAsp working properly to capture the audio from a ITE HDMI receiver.
We first create a dummy hdmi-driver, which we believe has hooked with mcasp correctly, cuz when inserting it I will get
"asoc: HDMI-DAI-CODEC <-> davinci-mcasp.2 mapping ok" message.
here is the dummy driver:
static struct snd_soc_codec_driver soc_codec_hdmi;
/* Dummy dai driver for HDMI */
static struct snd_soc_dai_driver ti81xx_dai = {
.name = "HDMI-DAI-CODEC",
.playback = {
.stream_name = "Playback",
.channels_min = 2,
.channels_max = 2,
.rates = SNDRV_PCM_RATE_48000,
.formats =SNDRV_PCM_FMTBIT_S32_LE ,
},
.capture = {
.stream_name = "Capture",
.channels_min = 2,
.channels_max = 2,
.rates = SNDRV_PCM_RATE_48000,
.formats =SNDRV_PCM_FMTBIT_S32_LE,
},
.symmetric_rates = 1,
};
static int hdmi_codec_probe(struct platform_device *pdev)
{
int ret;
ret = snd_soc_register_codec(&pdev->dev, &soc_codec_hdmi,
&ti81xx_dai, 1);
if (ret < 0)
printk(KERN_INFO " HDMI Codec Register Failed\n");
return ret;
}
static int hdmi_codec_remove(struct platform_device *pdev)
{
snd_soc_unregister_codec(&pdev->dev);
return 0;
}
static struct platform_driver hdmi_codec_driver = {
.probe = hdmi_codec_probe,
.remove = hdmi_codec_remove,
.driver = {
.name = "hdmi-dummy-codec",
.owner = THIS_MODULE,
},
};
static int __init hdmi_modinit(void)
{
int ret=0;
ret=platform_driver_probe(&hdmi_codec_driver,hdmi_codec_probe);
printk("return ret=================%d\n",ret);
return ret;
//platform_driver_register(&hdmi_codec_driver);
}
static void __exit hdmi_exit(void)
{
platform_driver_unregister(&hdmi_codec_driver);
}
module_init(hdmi_modinit);
module_exit(hdmi_exit);
Audio will be encoded as stanadard stereo I2S by HDMI RX and by default McAsp working at DSP_B mode, so we changed the audio format inside davinci-evm.c to I2S mode.
//#define AUDIO_FORMAT (SND_SOC_DAIFMT_DSP_B | \
// SND_SOC_DAIFMT_CBM_CFM | SND_SOC_DAIFMT_IB_NF)
#define AUDIO_FORMAT (SND_SOC_DAIFMT_I2S | \
SND_SOC_DAIFMT_CBM_CFM | SND_SOC_DAIFMT_NB_IF)
And we set the Receive bit delay of RFMT register RDATDLY=01 //mcasp_mod_bits(dev->base + DAVINCI_MCASP_RXFMT_REG,FSRDLY(0x01), FSRDLY(0x11)).
After all the changes, we still get one channel full of noise and the other channel is better but not clean sound.
Now we stuck here, could anyone point out us what we are missing here.
Regards,
Jun