Page 1 of 1

sama5d2 + tlv32aic33

Posted: Sat Mar 31, 2018 9:40 am
by A09353
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 = <???>;
	};
}

Re: sama5d2 + tlv32aic33

Posted: Tue May 08, 2018 1:39 pm
by A09353
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?

Re: sama5d2 + tlv32aic33

Posted: Wed May 09, 2018 10:11 pm
by blue_z
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

Re: sama5d2 + tlv32aic33

Posted: Thu May 10, 2018 12:10 pm
by A09353
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.

Re: sama5d2 + tlv32aic33

Posted: Sun Oct 07, 2018 9:37 pm
by serwus123
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

Re: sama5d2 + tlv32aic33

Posted: Tue Oct 09, 2018 3:11 am
by blue_z
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