sama5d2 + tlv32aic33

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

A09353
Posts: 3
Joined: Fri Mar 30, 2018 5:20 pm

sama5d2 + tlv32aic33

Sat Mar 31, 2018 9:40 am

Hello,
i want to connect tlv320aic33 codec to sama5d2 xplained board through i2c. I have tlv320aic33evm-pdk evaluation module. Connect it to i2c of sama5d2.
I enable tlv320aic3x driver in linux kernel and edit the dts file

Code: Select all

i2c0: i2c@f8028000 {
				tlv320aic3x: tlv320aic3x@1b {
					compatible = "ti,tlv320aic3x";
					reg = <0x1b>;
				};
				...
			};
but i understand what i need to do aplay use this codec. Do I need add sound section in dts?
I try to do it use "simple-audio-card", but what do i need write in "simple-audio-card,cpu"? Or use something other than "simple-audio-card"?

Code: Select all

sound {
	compatible = "simple-audio-card";
	...
	simple-audio-card,codec {
		sound-dai = <&tlv320aic3x>;
		...
	};
	simple-audio-card,cpu {
		sound-dai = <???>;
	};
}
A09353
Posts: 3
Joined: Fri Mar 30, 2018 5:20 pm

Re: sama5d2 + tlv32aic33

Tue May 08, 2018 1:39 pm

I connected the codec (through i2c/i2s), I can play sound or record.
But when I simultaneously play and record, I get a continuous error:

Code: Select all

...
atmel_i2s f8050000.i2s: TX underrun on channel 1
atmel_i2s f8050000.i2s: TX underrun on channel 0
...
or

Code: Select all

...
atmel_i2s f8050000.i2s: RX overrun on channel 1
atmel_i2s f8050000.i2s: RX overrun on channel 0
...
What could be the problem?
blue_z
Location: USA
Posts: 2101
Joined: Thu Apr 19, 2007 10:15 pm

Re: sama5d2 + tlv32aic33

Wed May 09, 2018 10:11 pm

A09353 wrote:What could be the problem?
You neglect to provide any salient details such as sampling rates, sample sizes, and source and destination media.
You could be trying to exceed the bandwidth of the memory and/or storage media.

Regards
A09353
Posts: 3
Joined: Fri Mar 30, 2018 5:20 pm

Re: sama5d2 + tlv32aic33

Thu May 10, 2018 12:10 pm

blue_z wrote:
Wed May 09, 2018 10:11 pm
You neglect to provide any salient details such as sampling rates, sample sizes, and source and destination media.
You could be trying to exceed the bandwidth of the memory and/or storage media.

Regards
Tried different formats, last 16000Hz, 16-bit, mono for play (from wav file) and rec (to wav file or /dev/null). I rec file no more than 30 seconds.
Same error when starting pulseaudio.
serwus123
Posts: 1
Joined: Sun Oct 07, 2018 8:51 pm

Re: sama5d2 + tlv32aic33

Sun Oct 07, 2018 9:37 pm

Hello,

I have similar problem therefore, I will try in this thread,
I have custom board with sama5d27-som1 connected with wm8974 through i2s1:

Code: Select all

				
pinctrl_i2s1_default: i2s1_default {
			pinmux = <PIN_PA15__I2SC1_CK>,
					 <PIN_PA14__I2SC1_MCK>,
					 <PIN_PA16__I2SC1_WS>,
					 <PIN_PA17__I2SC1_DI0>,
					 <PIN_PA18__I2SC1_DO0>;
					bias-disable;
				};
I enable wm8974 driver in linux kernel and edit i2c0 node in dts file:

Code: Select all

i2c0: i2c@f8028000 {
...				
	wm8974: codec@1a {
			compatible = "wlf,wm8974";
			reg = <0x1a>;
			};
	...			
};
In sound section I add:

Code: Select all

		
sound {
		 compatible = "simple-audio-card";		 
		 pinctrl-names = "default";
		 simple-audio-card,name = "wm8974 Audio";
		 simple-audio-card,format = "i2s";
		 simple-audio-card,widgets = "Speaker", "Speakers";
		 simple-audio-card,routing = "Speakers", "Speaker";
		 simple-audio-card,bitclock-master = <&cpu_dai>;
		 simple-audio-card,frame-master = <&cpu_dai>;
							
		 codec_dai: simple-audio-card,codec {
					sound-dai = <&wm8974>;
					clocks = <&pck0>;
					clock-frequency = <12384000>;
			};
							
		cpu_dai: simple-audio-card,cpu {
							sound-dai = <&i2s1>;
		};
			 
	  };
	  
But ALSA always:

Code: Select all

ALSA device list:
  No soundcards found.
I will be grateful for any help
blue_z
Location: USA
Posts: 2101
Joined: Thu Apr 19, 2007 10:15 pm

Re: sama5d2 + tlv32aic33

Tue Oct 09, 2018 3:11 am

serwus123 wrote: I have similar problem therefore, I will try in this thread,
I have custom board with sama5d27-som1 connected with wm8974 through i2s1:
No, you do not have a "similar problem".
Since you have a custom board, what kind of testing have you performed on the interface with the WM8974?

Regards
egrande
Posts: 3
Joined: Thu May 16, 2019 3:01 pm

Re: sama5d2 + tlv32aic33

Tue Sep 24, 2019 8:42 pm

Hello
I am facing the same issue (continuos overruns/underruns messages) while reading an writting simultaneously.
I have a custom sama5d2 based board controlling a tlv320aic32x4 códec by I2S.
I am also using the smple-sound-card driver.
Did you solve the issue?
Thanks
GaneshK
Posts: 9
Joined: Fri Apr 12, 2019 6:11 pm

Re: sama5d2 + tlv32aic33

Tue Jul 14, 2020 12:24 pm

Could you please share devictree of audio.







A09353 wrote:
Tue May 08, 2018 1:39 pm
I connected the codec (through i2c/i2s), I can play sound or record.
But when I simultaneously play and record, I get a continuous error:

Code: Select all

...
atmel_i2s f8050000.i2s: TX underrun on channel 1
atmel_i2s f8050000.i2s: TX underrun on channel 0
...
or

Code: Select all

...
atmel_i2s f8050000.i2s: RX overrun on channel 1
atmel_i2s f8050000.i2s: RX overrun on channel 0
...
What could be the problem?
GaneshK
Posts: 9
Joined: Fri Apr 12, 2019 6:11 pm

Re: sama5d2 + tlv32aic33

Fri Jul 17, 2020 8:01 am

Hi Sir,

Could please share your devicetree of sound.

Thanks,
Reagrds.
GaneshK
Posts: 9
Joined: Fri Apr 12, 2019 6:11 pm

Re: sama5d2 + tlv32aic33

Sat Jul 25, 2020 9:42 am

Hello,

I am trying interface tlv320aic3007 on custom sama5d2 board. When i am playing audio i am getting below error.Please help me to do solve this error.

ERROR:

root@rugged-board-a5d2x-sd1:~# aplay demo.wav -v
Playing WAVE 'demo.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Mon
tlv320aic3x-codec 0-0018: Unable to sync registers 0x33-0x36. -121
Plug PCM: Route conversion PCM (sformat=S16_LE)
Transformation table:
0 <- 0
1 <- 0
Its setup is:
stream : PLAYBACK
access : RW_INTERLEAVED
format : S16_LE
subformat : STD
channels : 1
rate : 8000
exact rate : 8000 (8000/1)
msbits : 16
buffer_size : 4000
period_size : 1000
period_time : 125000
tstamp_mode : NONE
tstamp_type : MONOTONIC
period_step : 1
avail_min : 1000
period_event : 0
start_threshold : 4000
stop_threshold : 4000
silence_threshold: 0
silence_size : 0
boundary : 2097152000
Slave: Hardware PCM card 0 'Simple Audio' device 0 subdevice 0
Its setup is:
stream : PLAYBACK
access : MMAP_INTERLEAVED
format : S16_LE
subformat : STD
channels : 2
rate : 8000
exact rate : 8000 (8000/1)
msbits : 16
buffer_size : 4000
period_size : 1000
period_time : 125000
tstamp_mode : NONE
tstamp_type : MONOTONIC
period_step : 1
avail_min : 1000
period_event : 0
start_threshold : 4000
stop_threshold : 4000
silence_threshold: 0
silence_size : 0
boundary : 2097152000
appl_ptr : 0
hw_ptr : 0
^CAborted by signal Interrupt...
aplay: pcm_write:2051: write error: Interrupted system call
root@rugged-board-a5d2x-sd1:~#

Please have look on below device tree

i2c0: i2c@f8028000 {
dmas = <0>, <0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c0_default>;
status = "okay";

tlv320aic3007: tlv320aic3007@18 {
#sound-dai-cells = <0>;
compatible = "ti,tlv320aic3007";
reg = <0x18>;
AVDD-supply = <&reg_sound_3v3>;
IOVDD-supply = <&reg_sound_3v3>;
DRVDD-supply = <&reg_sound_3v3>;
DVDD-supply = <&reg_sound_1v8>;
status = "okay";
};



};

reg_sound_1v8: regulator-sound-1v8 {
compatible = "regulator-fixed";
regulator-name = "i2s-audio-1v8";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
status = "okay";
};

reg_sound_3v3: regulator-sound-3v3 {
compatible = "regulator-fixed";
regulator-name = "i2s-audio-3v3";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
status = "okay";
};

sound {
compatible = "simple-audio-card";
simple-audio-card,name = "Simple Audio";
simple-audio-card,format = "i2s";
simple-audio-card,bitclock-master = <&dailink_master>;
simple-audio-card,frame-master = <&dailink_master>;
bitclock-inversion = <1>;
/* simple-audio-card,mclk-fs = <256>;*/
simple-audio-card,widgets =
"Line", "Line In",
"Line", "Line Out",
"Speaker", "Speaker";
simple-audio-card,routing =
"Line Out", "LLOUT",
"Line Out", "RLOUT",
"Speaker", "SPOP",
"Speaker", "SPOM",
"LINE1L", "Line In",
"LINE1R", "Line In";

status = "okay";


simple-audio-card,cpu {
sound-dai = <&i2s0>;
bitclock-inversion = <0>;
};
dailink_master: simple-audio-card,codec {
sound-dai = <&tlv320aic3007 0>;
clocks =<&pck0>;
clock-frequency = <12384000>;
};
};

Return to “LINUX”

Who is online

Users browsing this forum: No registered users and 5 guests