External audio codec TLV320AIC3254 interface with IMX7D using SAI3 interface

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

External audio codec TLV320AIC3254 interface with IMX7D using SAI3 interface

1,617件の閲覧回数
PotturuVenkataPrasad
Contributor I

HI,

We are trying to interface TLV320AIC3254 audio codec with Colibri IMX7D module using SAI3 interface.

And we want to configure codec as slave, it means that processor should give all the clocks MCLK, BCLK and WCLK. In my case we are getting mclk as 24MHz and no BCLK and WCLK.

What should we do to get the BCLK and WCLK from processor, please have a look at below nodes of the dts file and let us know any changes required and help us to get the clocks.

imx7-colibri.dtsi :-

sound1 {
compatible = "simple-audio-card";
simple-audio-card,name = "tlv320aic3254";
simple-audio-card,format = "i2s";
simple-audio-card,bitclock-master = <&codec_dai>;
simple-audio-card,frame-master = <&codec_dai>;
simple-audio-card,widgets =
"Microphone", "Mic Jack",
"Line", "Line In",
"Line", "Line Out",
"Headphone", "Headphone Jack";
simple-audio-card,routing =
"IN1_L", "Line In",
"IN1_R", "Line In",
"IN3_R", "Mic Jack",
"CM_L", "Mic Jack",
"CM_R", "Mic Jack",
"Line Out", "LOL",
"Line Out", "LOR",
"Headphone Jack", "HPL",
"Headphone Jack", "HPR";
simple-audio-card,cpu {
sound-dai = <&sai3>;
};
codec_dai: simple-audio-card,codec {
sound-dai = <&codec1>;
clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>;
};
};

 

&i2c4 {
clock-frequency = <100000>;
pinctrl-names = "default", "gpio";
pinctrl-0 = <&pinctrl_i2c4>;
pinctrl-1 = <&pinctrl_i2c4_recovery>;
scl-gpios = <&gpio7 8 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
sda-gpios = <&gpio7 9 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;

codec1: tlv320aic3x54@18 {
compatible = "ti,tlv320aic32x4";
#sound-dai-cells = <0>;
reg = <0x18>;
clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>;
clock-names = "mclk";
pinctrl-names = "default";
status = "okay";
ldoin-supply = <&reg_module_3v3_avdd>;
iov-supply = <&reg_module_3v3_avdd>;
};

};

&sai3 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai3 &pinctrl_sai3_mclk>;
assigned-clocks = <&clks IMX7D_SAI3_ROOT_SRC>,
<&clks IMX7D_SAI3_ROOT_CLK>;
assigned-clock-parents = <&clks IMX7D_PLL_AUDIO_POST_DIV>;
//assigned-clock-rates = <0>, <36864000>;
status = "okay";
};

pinctrl_sai3: sai3-grp {
fsl,pins = <
MX7D_PAD_SD1_DATA1__SAI3_TX_BCLK 0x1f
MX7D_PAD_SD1_DATA2__SAI3_TX_SYNC 0x1f
MX7D_PAD_SD1_DATA3__SAI3_TX_DATA0 0x30
MX7D_PAD_SD1_DATA0__SAI3_RX_DATA0 0x1f
>;
};

pinctrl_sai3_mclk: sai3grp_mclk {
fsl,pins = <
MX7D_PAD_SD1_RESET_B__SAI3_MCLK 0x1f
>;
};

 

 

Thanks & Regards,
P. Venkata prasad.

 

0 件の賞賛
返信
4 返答(返信)

1,575件の閲覧回数
weidong_sun
NXP TechSupport
NXP TechSupport

Hi,

1. Show me linux booting log, please!

2. play a wav file, and show me playing log if it has.

 

Have a nice day!

B.R,

weidong

0 件の賞賛
返信

1,567件の閲覧回数
PotturuVenkataPrasad
Contributor I

Hi,

Please find the boot log below.

Starting kernel ...

[ 0.403559] fsl-sai 308a0000.sai: failed to get mclk0 clock: -2
[ 0.416826] fsl-sai 308c0000.sai: failed to get mclk0 clock: -2
[ 0.600354] debugfs: Directory '308c0000.sai' with parent 'tlv320aic3254' already present!

Welcome to TDX Wayland with XWayland 5.1.0-devel-202012+build.5 (dunfell)!

[ OK ] Created slice system-getty.slice.
[ OK ] Created slice system-serial\x2dgetty.slice.
[ OK ] Created slice system-weston.slice.
[ OK ] Created slice User and Session Slice.
[ OK ] Started Dispatch Password ��…ts to Console Directory Watch.
[ OK ] Started Forward Password R��…uests to Wall Directory Watch.
[ OK ] Reached target Host and Network Name Lookups.
[ OK ] Reached target Paths.
[ OK ] Reached target Remote File Systems.
[ OK ] Reached target Slices.
[ OK ] Reached target Swap.
[ OK ] Listening on RPCbind Server Activation Socket.
[ OK ] Reached target RPC Port Mapper.
[ OK ] Listening on Syslog Socket.
[ OK ] Listening on initctl Compatibility Named Pipe.
[ OK ] Listening on Journal Socket (/dev/log).
[ OK ] Listening on Journal Socket.
[ OK ] Listening on Network Service Netlink Socket.
[ OK ] Listening on udev Control Socket.
[ OK ] Listening on udev Kernel Socket.
Mounting POSIX Message Queue File System...
Mounting Kernel Debug File System...
Mounting Temporary Directory (/tmp)...
Starting Create list of st��…odes for the current kernel...
[ OK ] Started Hardware RNG Entropy Gatherer Daemon.
Starting RPC Bind...
Starting File System Check on Root Device...
Starting Journal Service...
Starting Load Kernel Modules...
Starting udev Coldplug all Devices...
[ OK ] Started RPC Bind.
[ OK ] Mounted POSIX Message Queue File System.
[ OK ] Mounted Kernel Debug File System.
[ OK ] Mounted Temporary Directory (/tmp).
[ OK ] Started Create list of sta��… nodes for the current kernel.
[ OK ] Started Load Kernel Modules.
Mounting FUSE Control File System...
Mounting Kernel Configuration File System...
Starting Apply Kernel Variables...
[ OK ] Mounted FUSE Control File System.
[ OK ] Started File System Check on Root Device.
[ OK ] Mounted Kernel Configuration File System.
[ OK ] Started Apply Kernel Variables.
[ OK ] Started Journal Service.
Starting Remount Root and Kernel File Systems...
[ OK ] Started Remount Root and Kernel File Systems.
Starting Flush Journal to Persistent Storage...
Starting Create Static Device Nodes in /dev...
[ OK ] Started Flush Journal to Persistent Storage.
[ OK ] Started Create Static Device Nodes in /dev.
[ OK ] Reached target Local File Systems (Pre).
Mounting /var/volatile...
Starting udev Kernel Device Manager...
[ OK ] Mounted /var/volatile.
Starting Load/Save Random Seed...
[ OK ] Started Load/Save Random Seed.
[ OK ] Started udev Kernel Device Manager.
[ OK ] Started udev Coldplug all Devices.
[ OK ] Created slice system-systemd\x2dbacklight.slice.
Starting Load/Save Screen ��…ness of backlight:backlight...
[ OK ] Started Load/Save Screen B��…htness of backlight:backlight.
[ 4.218825] debugfs: Directory '308a0000.sai' with parent 'imx7-sgtl5000' already present!
[ OK ] Listening on Load/Save RF ��…itch Status /dev/rfkill Watch.
[ OK ] Found device /dev/disk/by-label/BOOT.
Mounting Boot partition...
[ OK ] Mounted Boot partition.
[ OK ] Reached target Local File Systems.
Starting Create Volatile Files and Directories...
[ OK ] Started Create Volatile Files and Directories.
Starting Network Time Synchronization...
Starting Update UTMP about System Boot/Shutdown...
[ OK ] Started Update UTMP about System Boot/Shutdown.
[ OK ] Started Network Time Synchronization.
[ OK ] Reached target System Initialization.
[ OK ] Started Daily Cleanup of Temporary Directories.
[ OK ] Reached target System Time Set.
[ OK ] Reached target System Time Synchronized.
[ OK ] Reached target Timers.
[ OK ] Listening on Avahi mDNS/DNS-SD Stack Activation Socket.
[ OK ] Listening on D-Bus System Message Bus Socket.
[ OK ] Listening on dropbear.socket.
[ OK ] Listening on GPS (Global P��…ioning System) Daemon Sockets.
[ OK ] Reached target Sockets.
[ OK ] Reached target Basic System.
Starting Save/Restore Sound Card State...
[ OK ] Started Bluetooth Audio ALSA Backend.
[ OK ] Started Kernel Logging Service.
[ OK ] Started System Logging Service.
[ OK ] Started D-Bus System Message Bus.
Starting IPv6 Packet Filtering Framework...
Starting IPv4 Packet Filtering Framework...
Starting Telephony service...
Starting Login Service...
[ OK ] Started Timestamping service.
Starting Load default USB gadget schema g1.schema...
[ OK ] Started Save/Restore Sound Card State.
[ OK ] Started IPv6 Packet Filtering Framework.
[ OK ] Started IPv4 Packet Filtering Framework.
[ OK ] Reached target Network (Pre).
[ OK ] Reached target Sound Card.
Starting Connection service...
[ OK ] Started Telephony service.
[FAILED] Failed to start Load default USB gadget schema g1.schema.
See 'systemctl status usbg.service' for details.
Starting Network Service...
[ OK ] Started Connection service.
Starting Avahi mDNS/DNS-SD Stack...
[ OK ] Started Avahi mDNS/DNS-SD Stack.
Starting WPA supplicant...
[ OK ] Started Login Service.
[ OK ] Started WPA supplicant.
[ OK ] Started Network Service.
[ OK ] Reached target Network.
[ OK ] Started NFS status monitor for NFSv2/3 locking..
Starting Hostname Service...
Starting Permit User Sessions...
[ OK ] Started Permit User Sessions.
[ OK ] Started Getty on tty1.
[ OK ] Started Serial Getty on ttymxc0.
[ OK ] Reached target Login Prompts.
[ OK ] Started Weston Wayland Compositor.
Starting Start a wayland application...
[ OK ] Created slice User Slice of UID 0.
Starting User Runtime Directory /run/user/0...
[ OK ] Started User Runtime Directory /run/user/0.
Starting User Manager for UID 0...
[ OK ] Started Hostname Service.
[ OK ] Started User Manager for UID 0.
[ OK ] Started Session c1 of user root.
[ OK ] Started Start a wayland application.
[ OK ] Reached target Multi-User System.
[ OK ] Reached target Graphical Interface.
Starting Update UTMP about System Runlevel Changes...
[ OK ] Started Update UTMP about System Runlevel Changes.

TDX Wayland with XWayland 5.1.0-devel-202012+build.5 (dunfell) colibri-imx7-emmc ttymxc0
Colibri-iMX7-eMMC_Reference-Multimedia-Image

colibri-imx7-emmc login: root
Last login: Fri Feb 7 15:50:59 UTC 2020
root@colibri-imx7-emmc:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: tlv320aic3254 [tlv320aic3254], device 0: 308c0000.sai-tlv320aic32x4-hifi tlv320aic32x4-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: imx7sgtl5000 [imx7-sgtl5000], device 0: 308a0000.sai-sgtl5000 sgtl5000-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
root@colibri-imx7-emmc:~#
root@colibri-imx7-emmc:~# i2cdetect -y 3
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
root@colibri-imx7-emmc:~# i2cdetect -y 0
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- UU -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- UU -- -- --
30: -- -- -- UU -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
root@colibri-imx7-emmc:~# aplay -D hw:0,0 440hz_10s.wav
Playing WAVE '440hz_10s.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
aplay: pcm_write:2059: write error: Input/output error
root@colibri-imx7-emmc:~#

root@colibri-imx7-emmc:~# aplay -v -D hw:0,0 440hz_10s.wav
Playing WAVE '440hz_10s.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
Hardware PCM card 0 'tlv320aic3254' device 0 subdevice 0
Its setup is:
stream : PLAYBACK
access : RW_INTERLEAVED
format : S16_LE
subformat : STD
channels : 2
rate : 44100
exact rate : 44100 (44100/1)
msbits : 16
buffer_size : 16384
period_size : 4096
period_time : 92879
tstamp_mode : NONE
tstamp_type : MONOTONIC
period_step : 1
avail_min : 4096
period_event : 0
start_threshold : 16384
stop_threshold : 16384
silence_threshold: 0
silence_size : 0
boundary : 1073741824
appl_ptr : 0
hw_ptr : 0
aplay: pcm_write:2059: write error: Input/output error
root@colibri-imx7-emmc:~#

 

Thanks & Regards,
P. Venkata prasad.

0 件の賞賛
返信

1,596件の閲覧回数
weidong_sun
NXP TechSupport
NXP TechSupport

Hi,

&sai3 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai3 &pinctrl_sai3_mclk>;
assigned-clocks = <&clks IMX7D_SAI3_ROOT_SRC>,
<&clks IMX7D_SAI3_ROOT_CLK>;
assigned-clock-parents = <&clks IMX7D_PLL_AUDIO_POST_DIV>;
//assigned-clock-rates = <0>, <36864000>;
status = "okay";
};

 

36864000 is SAI3 ROOT CLOCK, you shouldn't comment it.

 

Have a nice day!

B.R,

weidong

 

0 件の賞賛
返信

1,587件の閲覧回数
PotturuVenkataPrasad
Contributor I

Hi,

We tried as you suggested, but still we not getting BCLK and WCLK.

What we need to do to get the clocks. Kindly suggest a solution for this.

Thanks & Regards,
P. Venkata prasad.

0 件の賞賛
返信