This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

problem in ti81xx_hdmi_dai ()

Hi  everyone,

  I already have a chip for playback ,.And then I want to add an HDMI (sii9233a) audio collection.

Problem:

       1.The .cpu_dai_name is the same, Is this OK ?

       2.  Run arcord appear the following error:

root@ti81xx:~# arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: SOUND0 [TI81XX ETV SOUND0], device 0: AIF1 rt5640-aif1-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: SOUND1 [TI81XX ETV SOUND1], device 1: HIFI_9233 HDMI-SII9233A-ADUIO-1 []
Subdevices: 1/1
Subdevice #0: subdevice #0

run:     arecord -D plughw:1,1 -d 20 -c 2 -t wav -r 16000 -f "Signed 16 bit Little Endian" /mnt/ti8168/test.wav

davinci_pcm_open():
1:davinci_pcm_open:channel:0; chan:0
substream->stream == 1 (0=playback)
3:davinci_pcm_open:channel:0; chan:0
start:davinci_pcm_dma_request:channel:0; chan:0
davinci_runtime_data *prtd davinci_pcm_dma_request:channel:-16; chan:0
end:davinci_pcm_dma_request:channel:0; chan:0
davinci_pcm_dma_request:edma_alloc_channel fail
davinci_pcm: Failed to get dma channels
asoc: can't open platform davinci-pcm-audio
Wrapper disabled...
arecord: main:682: audio open error: Device or resource busy

Hope to get help,  thanks!

The following code:

---------------

Machine:  

--------------

static struct snd_soc_dai_link ti81xx_hdmi_dai[] = {
{
.name = "HDMI_SOC_LINK",
.stream_name = "hdmi",
.cpu_dai_name = "hdmi-dai",
.platform_name = "davinci-pcm-audio",
.codec_dai_name = "HDMI-DAI-CODEC", /* DAI name */
.codec_name = "hdmi-dummy-codec",
},

{

.name = "HDMI_SII9233A_AUDIO",
.stream_name = "HIFI_9233",
.cpu_dai_name = "hdmi-dai",
//.cpu_dai_name = "davinci-mcasp.0",
.platform_name = "davinci-pcm-audio",
.codec_dai_name = "HDMI-SII9233A-ADUIO",
.codec_name = "hdmi-dummy-codec",

},

};

--------------

Codec:

--------------

#include <sound/initval.h>

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
| SNDRV_PCM_RATE_32000
| SNDRV_PCM_RATE_44100
| SNDRV_PCM_RATE_96000
| SNDRV_PCM_RATE_192000 ,
.formats = SNDRV_PCM_FMTBIT_S16_LE
| SNDRV_PCM_FMTBIT_S32_LE
| SNDRV_PCM_FMTBIT_S24_LE,
},
},
{
.name = "HDMI-SII9233A-ADUIO",
.capture = {
.stream_name = "capture",
.channels_min = 1,
.channels_max = 3,
.rates = SNDRV_PCM_RATE_48000
| SNDRV_PCM_RATE_32000
| SNDRV_PCM_RATE_44100
| SNDRV_PCM_RATE_96000
| SNDRV_PCM_RATE_192000 ,
.formats = SNDRV_PCM_FMTBIT_S16_LE
| SNDRV_PCM_FMTBIT_S32_LE
| SNDRV_PCM_FMTBIT_S24_LE,
},
},
};

-------------------------------

Platform:

-------------------------------

void __init ti8168_hdmi_mclk_init_9233a(void)
{
int ret = 0;
struct clk *parent, *child;

/* modify the clk name from list to use different clk source */
parent = clk_get(NULL, "sysclk20_ck");
if (IS_ERR(parent))
pr_err("Unable to get [sysclk20_ck] clk\n");

/* get HDMI dev clk*/
child = clk_get(NULL, "hdmi_i2s_ck");
if (IS_ERR(child))
pr_err("Unable to get [hdmi_i2s_ck] clk\n");

ret = clk_set_parent(child, parent);
if (ret < 0)
pr_err("Unable to set parent [hdmi_ck] clk\n");

pr_debug("\n\nHDMI: 9233a Audio MCLK setup complete!\n\n");

}

---

void __init ti8168_hdmi_mclk_init(void)
{
int ret = 0;
struct clk *parent, *child;

/* modify the clk name from list to use different clk source */
parent = clk_get(NULL, "sysclk22_ck");
if (IS_ERR(parent))
pr_err("Unable to get [sysclk22_ck] clk\n");

/* get HDMI dev clk*/
child = clk_get(NULL, "hdmi_i2s_ck");
if (IS_ERR(child))
pr_err("Unable to get [hdmi_i2s_ck] clk\n");

ret = clk_set_parent(child, parent);
if (ret < 0)
pr_err("Unable to set parent [hdmi_ck] clk\n");

pr_debug("\n\n HDMI: Audio MCLK setup complete!\n\n");

----------------------