Beaglebone Black and tlv320aic32x4 No Audio Out or In

268 views
Skip to first unread message

ed

unread,
Jul 25, 2016, 11:37:18 AM7/25/16
to BeagleBoard

I am currently working on getting a board designed after the BBB to work with the tlv320aic3254 audio codec.  Currently i have the driver being recognized by alsa with the included overlay.  I modified the driver to use the 24.576 clock which we carried over from the BBB and when i hook up the device to our saleae logic analizer the bitclock, wordclock, and data look perfect when running speaker-test -t sine -f 1000.  As in the overlay the AM335x is the slave device TLV320AIC3254 and the output data is correct.  When using alsamixer i am able to configure the channels and the reg data changes but i get no sound out of either line out or headphone when the channels are enabled.  I suspect there is either an overlay or configuration issue preventing the output of audio data as when i do arecord with a 1khz sine wave as input i get no data out as well.  At this point i am at a loss as to why this is not working.  I have included for reference my overlay, the register dump while speaker-test is running for page one and two and the updated driver with the MCLK patch and my additional clocking entries.  Any help would be greatly appreciated


/*
 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/am33xx.h>

/ {
    compatible
= "ti,beaglebone", "ti,beaglebone-black", "ti,beaglebone-green";

   
/* identification */
    part
-number = "BB-BONE-AUDI-02";
    version
= "00A0", "A0";

   
/* state the resources this cape uses */
    exclusive
-use =
       
/* the pin header uses */
       
"P9.31",    /* mcasp0: mcasp0_aclkx */
       
"P9.29",    /* mcasp0: mcasp0_fsx */
       
"P9.28",    /* mcasp0: mcasp0_axr2 */
       
"P9.25",    /* mcasp0: mcasp0_ahclkx */
       
"P9.30",    /* mcasp0: mcasp0_axr0 */
       
/* the hardware ip uses */
       
"gpio3_21",
       
"mcasp0";

    fragment@0
{
        target
= <&am33xx_pinmux>;
        __overlay__
{
            bone_audio_cape_audio_pins
: pinmux_bone_audio_cape_audio_pins {
                pinctrl
-single,pins = <
                   
0x190 (PIN_INPUT_PULLDOWN | MUX_MODE0)    /* mcasp0_aclkx.mcasp0_aclkx */
                   
0x194 (PIN_INPUT_PULLDOWN | MUX_MODE0)    /* mcasp0_fsx.mcasp0_fsx, INPUT */
                   
0x198 (PIN_INPUT_PULLDOWN | MUX_MODE0)    /* mcasp0_axr0.mcasp0_axr0 */
                   
0x19c (PIN_INPUT_PULLDOWN | MUX_MODE2)    /* mcasp0_ahclkr.mcasp0_axr2 */
                   
0x1ac (PIN_INPUT_PULLDOWN | MUX_MODE0)    /* MCASP0_AHCLKX -> MCASP0_AHCLKX (I2S_MCLK_OUT)- in */
                   
0x06c ( PIN_OUTPUT_PULLUP | MUX_MODE7 ) /* mcasp0_axr1 GPIO1_27 | OUTPUT | PULLUP */
               
>;
           
};
       
};
   
};

    fragment@1
{
        target
= <&i2c0>;
        __overlay__
{
           
#address-cells = <1>;
           
#size-cells = <0>;
            clock
-frequency = <100000>;
            status
= "okay";
            pinctrl
-names = "default";
            pinctrl
-0 = <&i2c0_pins>;

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

    fragment@2
{
        target
= <&mcasp0>;
        __overlay__
{
           
#sound-dai-cells = <0>;
            compatible
= "ti,am33xx-mcasp-audio";
            pinctrl
-names = "default";
            pinctrl
-0 = <&bone_audio_cape_audio_pins>;
            status
= "okay";
            op
-mode = <0>;          /* MCASP_IIS_MODE */
            tdm
-slots = <2>;
            serial
-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
               
2 0 1 0
               
0 0 0 0
               
0 0 0 0
               
0 0 0 0
           
>;
            tx
-num-evt = <1>;
            rx
-num-evt = <1>;
       
};
   
};

    fragment@3
{
        target
-path="/";
        __overlay__
{
            sound
{
                compatible
= "simple-audio-card";
                simple
-audio-card,name = "Nyquist Dev Kit";
                simple
-audio-card,format = "dsp_b";
                simple
-audio-card,widgets =
                   
"Headphone", "Headphone Jack",
                   
"Line", "Line In",
                   
"Line", "Line Out";
                simple
-audio-card,routing =
                   
"Headphone Jack",       "HPL",
                   
"Headphone Jack",       "HPR",
                   
"Line Out",            "LOL",
                   
"Line Out",            "LOR",
                   
"IN1_L",               "Line In",
                   
"IN1_R",               "Line In",
                   
"IN2_L",               "Line In",
                   
"IN2_R",               "Line In",
                   
"IN3_L",               "Line In",
                   
"IN3_R",               "Line In";
                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 = <&mcasp0>;
               
};

                sound_master
: simple-audio-card,codec {
                    sound
-dai = <&tlv320aic32x4>;
                    clocks
= <&clk_mcasp0>;
                    clock
-names = "mclk";
               
};
           
};
       
};

   
};
};


Thanks
Ed
tlv320aic32x4.c
Reg Dump.txt

jithu...@gmail.com

unread,
Mar 22, 2018, 12:22:49 PM3/22/18
to BeagleBoard
Hi ed,
I am also trying to play audio on BBB using TLV320AIC23 CODEC on 9.3 Debian version. But it seems device tree overlay structure has changed a lot in recent images. ?sys/devices/platform/bone_capemgr/slots is not available in latest debian. on which debian version did u try and can you please guide how did you add the audio cape to device tree. waiting for your response.
Thanks in advance.
Jithu
Reply all
Reply to author
Forward
0 new messages