IMX8MM - Multiple audio devices/channels

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IMX8MM - Multiple audio devices/channels

1,287 Views
crcn
Contributor I

Hi to all,

I'm developing a product with IMX8MM where I need to have 6 independent audio devices/channels.

I need each channel to be able to establish calls to one or several sip phones (like above image)

crcn_0-1660889083054.png

In A, i have an analogic microphone and speaker.

I find the PCM3168A codec, who have 6 inputs/8 outputs, I make a custom prototype with that codec, connected to J1001 connector of IMX8mm EVK (see schematic.pdf)

crcn_2-1660890069258.png

Based on https://bootlin.com/blog/eight-channels-audio-on-i-mx7-with-pcm3168/ I configured the device tree:

sound-pcm3168a {
compatible = "simple-audio-card";
simple-audio-card,name = "pcm3168a-audio";
simple-audio-card,widgets = "Speaker", "Channel1out",
"Speaker", "Channel2out",
"Speaker", "Channel3out",
"Speaker", "Channel4out",
"Speaker", "Channel5out",
"Speaker", "Channel6out",
"Microphone", "Channel1in",
"Microphone", "Channel2in",
"Microphone", "Channel3in",
"Microphone", "Channel4in",
"Microphone", "Channel5in",
"Microphone", "Channel6in";
simple-audio-card,routing = "Channel1out", "AOUT1L",
"Channel2out", "AOUT1R",
"Channel3out", "AOUT2L",
"Channel4out", "AOUT2R",
"Channel5out", "AOUT3L",
"Channel6out", "AOUT3R",
"Channel1in", "AIN1L",
"Channel2in", "AIN1R",
"Channel3in", "AIN2L",
"Channel4in", "AIN2R",
"Channel5in", "AIN3L",
"Channel6in", "AIN3R";
simple-audio-card,dai-link@1 {
format = "i2s";
bitclock-master = <&pcm3168_dac>;
frame-master = <&pcm3168_dac>;
cpu {
sound-dai = <&sai1>;
dai-tdm-slot-num = <8>;
dai-tdm-slot-width = <32>;
};
pcm3168_dac: codec {
sound-dai = <&pcm3168a 0>;
clocks = <&clk IMX8MM_CLK_SAI1_ROOT>;
};
};
simple-audio-card,dai-link@2 {
format = "i2s";

bitclock-master = <&pcm3168_adc>;
frame-master = <&pcm3168_adc>;
cpu {
sound-dai = <&sai1>;
dai-tdm-slot-num = <8>;
dai-tdm-slot-width = <32>;
};
pcm3168_adc: codec {
sound-dai = <&pcm3168a 1>;
clocks = <&clk IMX8MM_CLK_SAI1_ROOT>;
};
};
};

 

///I2C3

pcm3168a: audio-codec@44 {
compatible = "ti,pcm3168a";
#sound-dai-cells = <1>;
reg = <0x44>;
reset-gpios = <&gpio4 17 GPIO_ACTIVE_LOW>;
clocks = <&clk IMX8MM_CLK_SAI1_ROOT>;
clock-names = "scki";
VDD1-supply = <&supply3v3>;
VDD2-supply = <&supply3v3>;
VCCAD1-supply = <&supply5v0>;
VCCAD2-supply = <&supply5v0>;
VCCDA1-supply = <&supply5v0>;
VCCDA2-supply = <&supply5v0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pcm3168a>;
};

 

//iomux

pinctrl_pcm3168a: pinctrl_pcm3168a{
fsl,pins = <
MX8MM_IOMUXC_SAI1_TXD5_GPIO4_IO17 0x19 /*RESET*/
MX8MM_IOMUXC_SAI1_TXD6_GPIO4_IO18 0x19 /*OVF*/
MX8MM_IOMUXC_SAI1_TXD7_GPIO4_IO19 0x19 /*ZERO*/
>;
};

 

When loaded the device tree on EVK, I have:

[ 2.375321] debugfs: Directory '30010000.sai' with parent 'pcm3168a-audio' already present!
[ 2.383813] asoc-simple-card sound-pcm3168a: pcm3168a-dac <-> 30010000.sai mapping ok
[ 2.391733] asoc-simple-card sound-pcm3168a: pcm3168a-adc <-> 30010000.sai mapping ok
[ 2.399624] asoc-simple-card sound-pcm3168a: ASoC: no DMI vendor name!

[ 2.552554] ALSA device list:
[ 2.557548] #0: imx-spdif
[ 2.568080] #1: imx-audio-micfil
[ 2.571488] #2: pcm3168a-audio
[ 2.574717] #3: wm8524-audio

 

aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: imxspdif [imx-spdif], device 0: S/PDIF PCM snd-soc-dummy-dai-0 [S/PDIF PCM snd-soc-dummy-dai-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: pcm3168aaudio [pcm3168a-audio], device 0: 30010000.sai-pcm3168a-dac pcm3168a-dac-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 3: wm8524audio [wm8524-audio], device 0: 30030000.sai-wm8524-hifi wm8524-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0

 

arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: imxspdif [imx-spdif], device 0: S/PDIF PCM snd-soc-dummy-dai-0 [S/PDIF PCM snd-soc-dummy-dai-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: imxaudiomicfil [imx-audio-micfil], device 0: micfil hifi snd-soc-dummy-dai-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: pcm3168aaudio [pcm3168a-audio], device 1: 30010000.sai-pcm3168a-adc pcm3168a-adc-1 []
Subdevices: 1/1
Subdevice #0: subdevice #0

 

When tried to play a audio:

aplay -D hw:2,0 48000.wav    //PCM3168 don't work
Playing WAVE '48000.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
aplay: set_params:1339: Sample format S16_LE non available
Available formats:
- S24_LE

aplay -D hw:2,0 --format=S24_LE 48000.wav   //PCM3168 don't work
Warning: format is changed to S16_LE
Playing WAVE '48000.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
aplay: set_params:1339: Sample format S16_LE non available
Available formats:
- S24_LE

aplay -D hw:3,0 48000.wav  //wm8524 work
Playing WAVE '48000.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
^CAborted by signal Interrupt...

 

When try to record

arecord -D hw:2,0 sample.wav
arecord: main:828: audio open error: No such file or directory

 

So, my question are:

1-Can I use the PCM3168A to have the 6 independent audios?

2-If yes, has anyone managed to configure the pcm3168 with imx8mm? Anyone can help me with the device tree configuration?

2-If not, the solution can passed to using 6 simple codecs (like wm8960 that was on many imx evk)? There are other options (but simple to implement in this micro)?

 

Thanks to all.

0 Kudos
Reply
0 Replies