This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM437x TLV320AIC3100 Detected but not able to play audio file

Other Parts Discussed in Thread: TLV320AIC3100

HI Team,

We are using processor sdk-02.00.02.11 & integrated tlv320aic3100 codec with mcasp1.

We have only speaker output no headphone Jack.

The following are the changes in dts file.

sound { 
                compatible = "simple-audio-card";                       
                simple-audio-card,name = "AM437x-SK-EVM";               
                simple-audio-card,widgets =                             
                        "Speaker", "Speaker";                           
                simple-audio-card,routing =
                        "Speaker" , "SPK";
                simple-audio-card,format = "i2s";
                simple-audio-card,bitclock-master = <&sound_master>;
                simple-audio-card,frame-master = <&sound_master>;       
                simple-audio-card,bitclock-inversion;
        
                simple-audio-card,cpu {                                 
                        sound-dai = <&mcasp1>;                          
                        system-clock-frequency = <24000000>;                           
                };                                                      
                
                sound_master: simple-audio-card,codec {                 
                        sound-dai = <&tlv320aic3100>;                   
                        system-clock-frequency = <24000000>;            
                };
};

tlv320aic3100: tlv320aic3100@18 {
                #sound-dai-cells = <0>;
                compatible = "ti,tlv320aic3100";
                reg = <0x18>;
                status = "okay";

                pinctrl-names = "default";
                pinctrl-0 = <&clkout1_pin_default>;

                /* Regulators */
                AVDD-supply = <&dcdc4>;
                IOVDD-supply = <&dcdc4>;
                DVDD-supply = <&ldo1>;
                SPRVDD-supply = <&vbat>; /* vbat */
                SPLVDD-supply = <&vbat>; /* vbat */
};

&mcasp1 {
        #sound-dai-cells = <0>;
        pinctrl-names = "default", "sleep";
        pinctrl-0 = <&mcasp1_pins_default>;
        pinctrl-1 = <&mcasp1_pins_sleep>;

        status = "okay";

        op-mode = <0>;
        tdm-slots = <2>;
        serial-dir = <
                /*0 0 1 2*/
                1 2 0 0
                0 0 0 0
                0 0 0 0
                0 0 0 0 
        >;

        tx-num-evt = <32>;
        rx-num-evt = <32>; 
};

The sound card got detected in the dmesg output as shown below.

[    0.447337] Advanced Linux Sound Architecture Driver Initialized.
[    2.105013] asoc-simple-card sound: tlv320aic31xx-hifi <-> 4803c000.mcasp mapping ok
[    2.222052] ALSA device list:
[    2.225160]   #0: AM437x-SK-EVM

amixer Settings is also done properly

amixer sset 'DAC' 127
amixer sset 'Speaker Analog' 127
amixer sset 'Speaker Driver' 0 on

When we play the audio file, we are getting the following error.

mplayer /home/file.mp3

MPlayer 1.0rc4-4.8.2 (C) 2000-2010 MPlayer Team

Playing /home/file.mp3.
Audio only file format detected.
Clip info:
 Title: 
 Artist: 
 Album: 
 Year: 2016
 Comment: 
 Genre: Blues
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
[AO OSS] audio_setup: Can't open audio device /dev/dsp: No such file or directory
AO: [alsa] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A:   0.0 (00.0) of 1.0 (01.0) ??,?% $<50>

kindly suggest us solution to proceed further.

Thanks & Regards,

Arun Nehru A.V.

  • I will forward this to the software team. they will reply directly here.
  • Hi Arun,

    Are you able to get audio with aplay?

    Best Regards,
    Yordan
  • Hi Yordan,

    Thanks for quick response.

    No, i'm not getting audio through aplay also.

    while using aplay, it waits for 10 seconds and throws the following error.

    # aplay -D hw:0,0 /home/file.wav 
    
     Playing WAVE '/home/file.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
     aplay: pcm_write:1710: write error: Input/output error

  • Hi,

    I think the I/O error might be related to the following message from the MPlayer log:
    [AO OSS] audio_setup: Can't open audio device /dev/dsp: No such file or directory

    Can you share the dai link structure of your codec from sound/soc/davinci/davinci-evm.c? Do you use

    .dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_CBM_CFM |
    SND_SOC_DAIFMT_IB_NF,

    Try setting I2S format, i.e. change SND_SOC_DAIFMT_DSP_B to SND_SOC_DAIFMT_I2S

    Best Regards,
    Yordan
  • HI Yordan,

    We are using davinci-mcasp.c as the mcasp driver for our AM437x board.

    dai_fmt can be configured in the dts file, as we are using processor-sdk-02.00.02.11

     sound {
                    compatible = "simple-audio-card";
                    simple-audio-card,name = "AM437x-SK-EVM";
                    simple-audio-card,format = "i2s";
                    //
                    //
                    //
    };
    
    

    For McASP configuration,

     mcasp1: mcasp@4803C000 {
                            compatible = "ti,am33xx-mcasp-audio";
                            ti,hwmods = "mcasp1";
                            //
                            //
                            //
     };

  • Hi Arun,

    Even in SDK02.00.02.11, it is needed to change the dai_fmt in the driver itself (davinci-mcasp.c), the dts configuration is not enough.

    Best Regards,
    Yordan