I want to create a custom board based on i.MX6 which needs to use the three ssi ports connected to the audmux which is connecing to 3 audio sources via 3 external ports. My doubtful areas are:
1. How to configure the three ssi??
Do we need to make 3 structure of struct mxc_audio_platform_data instances for the three ssi in the board info file like
static struct mxc_audio_platform_data mx6_audio1_data = {
.ssi_num= 3, (is this the total number of ssi used or the ssi port used)
.src_port = 5, // Port5: AUD5
.ext_port = 2, // Port2: ssi-2
.hp_gpio = -1,
};
(do we need 3 structures like this???)
2. How to configure the audmux
3. I want to connect 2 i2s audio input( obtained from another board as audio samples) and one sgtl5000 codec. can i use imx6 as slave for the 2 i2s input and master for sgtl5000 codec?. If yes how is the configuration done?
Thanks in advance,
Sebi
Solved! Go to Solution.
Hello,Sebi,
Let me explain this structure at first .
(1)Explanation of data structure
#define SABRESD_HEADPHONE_DET IMX_GPIO_NR(7, 8)
static struct mxc_audio_platform_data mx6_audio1_data = {
.ssi_num= 1,// (Which SSI will be used, SSI0,SSI1 or SSI2, here means we will use SSI1 )
.src_port = 2, // Internal connection is SSI1 to Port 2 of AUDMUX
.ext_port = 5, // External port of AUDMUX is No.5(AUD5). For i.mx6 cpu, AUD3,AUD4,AUD5 and AUD6 can be muxed to PADs to connect with external deivce)
.hp_gpio = SABRESD_HEADPHONE_DET,//here is a gpio used to detect if Headphone is input.
}
The following is diagram for SSIx and AUDMUX, you can see in reference manual:
SSI1/SSI2/SSI3 in diagram are SSI0/SSI1/SSI2 in BSP.
(2)Using 3 SSIs of I.MX6
In addition, From reference manual of I.MX6DQ, SDMA can access SSI0,SSI1 and SSI2 module, So they can be used to transimit High-bandwidth data. But on our evaluation board, we don't use 3 SSIs to connect 3 different devices. So we don't have corresponding experience to share with you. and not recommend you use 3 I2S of I.MX6 simultaneously.
(3) The following solution is recomended to you.(Using a audio code with 3 I2S Interfaces, such as WM8958)
Driver of WM895 has been supported in linux BSP, this can help you to save development time. The following is an example schematic. MCLK can be 24MHz that output from GPIO_0 on CPU.
I think maybe wm8958 can be suitable for your requirement.
Regards,
Weidong
Hello,Sebi,
Let me explain this structure at first .
(1)Explanation of data structure
#define SABRESD_HEADPHONE_DET IMX_GPIO_NR(7, 8)
static struct mxc_audio_platform_data mx6_audio1_data = {
.ssi_num= 1,// (Which SSI will be used, SSI0,SSI1 or SSI2, here means we will use SSI1 )
.src_port = 2, // Internal connection is SSI1 to Port 2 of AUDMUX
.ext_port = 5, // External port of AUDMUX is No.5(AUD5). For i.mx6 cpu, AUD3,AUD4,AUD5 and AUD6 can be muxed to PADs to connect with external deivce)
.hp_gpio = SABRESD_HEADPHONE_DET,//here is a gpio used to detect if Headphone is input.
}
The following is diagram for SSIx and AUDMUX, you can see in reference manual:
SSI1/SSI2/SSI3 in diagram are SSI0/SSI1/SSI2 in BSP.
(2)Using 3 SSIs of I.MX6
In addition, From reference manual of I.MX6DQ, SDMA can access SSI0,SSI1 and SSI2 module, So they can be used to transimit High-bandwidth data. But on our evaluation board, we don't use 3 SSIs to connect 3 different devices. So we don't have corresponding experience to share with you. and not recommend you use 3 I2S of I.MX6 simultaneously.
(3) The following solution is recomended to you.(Using a audio code with 3 I2S Interfaces, such as WM8958)
Driver of WM895 has been supported in linux BSP, this can help you to save development time. The following is an example schematic. MCLK can be 24MHz that output from GPIO_0 on CPU.
I think maybe wm8958 can be suitable for your requirement.
Regards,
Weidong
Hi weidong.sun
Can you share the wm8958 driver file with BT audio support.
I'm using Android 6.0.1, i don't have wm8958 driver with BT audio support.
Thanks & Regards,
Aravinth
Hello,Weidong
>From reference manual of I.MX6DQ, SDMA can access SSI0,SSI1 and SSI2 module, So they can be used to transimit High-bandwidth data.
I want to capture raw data from SSI1,but I don't know how to do it.
Could you give me some suggests.
Thank you very much!
ZongbiaoLiao
Hello Weidong,
Thanks for the reply.
I have few more questions based on your answer.
1. Since the internal ports are hard wired(cannot be changed) to the corresponding ssi what is the use in giving .ssi_num and .src_port?. anyway the SSI1 is connected to Internal port 2 right??. What if i give .ssi_num = 0 and .src_port = 2.
2. Sorry to tell you My design is fixed and i want to use the 3 SSI. If I am writing a driver for driving these audio inputs(2 I2s not sgtl500), how can i configure the SSI port and DMA engine?
My question seems confusing for me too. Please don't hesitate to answer because of that.
Thanks
Sebi
Hello,Sebi,
>>1. Since the internal ports are hard wired(cannot be changed) to the corresponding ssi what is the use in giving .ssi_num and .src_port?. anyway the SSI1 is connected to Internal port 2 right??. What if i give .ssi_num = 0 and .src_port = 2.
Yes, SSI1-->Port2 of AUDUMX (port2 is called internal port), here SSI1 should be SSI2 in diagram.
If you set .ssi_num=0, SSI1 in diagram should be used. but in BPS it's number is SSI0. it's src_port is 1. (means it is connected to port 1 of AUDMUX)
>>2. Sorry to tell you My design is fixed and i want to use the 3 SSI. If I am writing a driver for driving these audio inputs(2 I2s not sgtl500), how can i configure the SSI port and DMA engine?
SSI driver and SDMA code are at path "linux/sound/soc/imx/" , you will have to add corresponding code to orignal ssi driver and usage of SDMA released by freescale.
>>Linux ALSA SoC driver
Linux ALSA SoC driver is audio driver architecture, it is composed of 3 parts:
(1)codec driver (audio codec connetect to I2S port)
such as "sound/soc/codecs/sgtl5000.c"
(2)platform driver ( i.mx ssi driver)
such as "linux/sound/soc/imx/imx-ssi.c"
(3)machine driver (sound card driver)
such as "linux/sound/soc/imx/imx-sgtl5000.c"
So for your every device connected to SSI0--SS2, you will have to write a driver for every one according to above rules(ALSA SoC driver).
I just give you these advice and thoughts, Main work is still needed to do by yourself.
regards,
Weidong
Hello Weidong,
Thanks for the reply,
I am not getting fully. My remaining doubts are:
1. Since .ssi_num = 0(SSI1 in the figure) should be connected to port1(.src_port = 1), what if i give .src_port = 2 or 7 (SSI2 or SSI3)in the structure, will there be any error??...
2. I do not want to link this i2s data to the alsa(no need to playback or record). I just need this audio data as audio bytes to a buffer. For that will a simple DMA from the ssi buffer enough?
Once again thanks for your reply.
I know i am disturbing you but please give an answer for the above questions.
Thanks
Sebi
S.M.
Had your issue got resolved? If yes, we are going to close the discussion in 3 days. If you still need help, please feel
free to reply with an update to this discussion.
Thanks,
Yixing
Thanks, SM. I will close the DI.
Yixing