2

I am trying to capture sound from a Circular Microphone Board (TIDA-01454) in a Beaglebone AI. I have succesfully configured the ADCs of the CMB via I2C, and checked that the I2S output is working correctly with an external DAC.

However my next step is to capture this I2S into my Beaglebone AI in order to process it later. I think I have configured the pins correctly following this guide and this document. So my show-pins is like this:

sudo show-pins

And my DTS file is like this:

#include "am5729-beagleboneai.dts"  
// make it easy to determine which dtb you're currently running on  
// (via /proc/device-tree/chosen/)  
/ {  
 chosen {  
  base_dtb = "am5729-beagleboneai-custom.dts";  
  base_dtb_timestamp = __TIMESTAMP__;  
 };  
};  
// eventually these should be available in a header  
#define P9_14  (0x3400 + 4 * 107)  
#define P9_16  (0x3400 + 4 * 108)  
#define P9_19a (0x3400 + 4 * 16)  
#define P9_19b (0x3400 + 4 * 95)  
#define P9_20a (0x3400 + 4 * 17)  
#define P9_20b (0x3400 + 4 * 94)  
#define P9_12  (0x3400 + 4 * 171) 
#define P9_27b (0x3400 + 4 * 172)
#define P9_18b (0x3400 + 4 * 173)
// 
/{

pcm5102a: pcm5102a {
   #sound-dai-cells = <0>;
   compatible = "ti,pcm5102a";
   status = "okay";
};


sound {compatible = "simple-audio-card";
        simple-audio-card,format = "i2s";
        simple-audio-card,name = "PCM5102a";
        simple-audio-card,bitclock-master = <&sound1_master>;
        simple-audio-card,frame-master = <&sound1_master>;
        simple-audio-card,bitclock-inversion;
        
        
        simple-audio-card,cpu {
                sound-dai = <&mcasp1>;
        };
        sound1_master: simple-audio-card,codec {
            #sound-dai-cells = <0>;
            sound-dai = <&pcm5102a>;
            
        };
      };
};

// enable i2c-3 on P9.19 (scl) + P9.20 (sda)  
&i2c4 {  
 status = "okay";  
 clock-frequency = <400000>;  
 pinctrl-names = "default";  
 pinctrl-0 = <&i2c4_pins>;  

};

&mcasp1 {
    #sound-dai-cells = <0>;
    status = "okay";
    pinctrl-names = "default";  
    pinctrl-0 = <&mcasp1_pins>;  
    op-mode = <0>;    /* MCASP_IIS_MODE */
    tdm-slots = <2>;
    num-serializer = <4>;
    /* 16 serializers */
    serial-dir = < /* 1 TX 2 RX 0 unused */
             2 0 0 0
        >;
    rx-num-evt = <1>;
    tx-num-evt = <1>;
};  




&dra7_pmx_core {  
 i2c4_pins: i2c4 {  
  pinctrl-single,pins = <  
   DRA7XX_CORE_IOPAD( P9_19a, PIN_INPUT_PULLUP | MUX_MODE7  )  // scl  
   DRA7XX_CORE_IOPAD( P9_19b, PIN_INPUT_PULLUP | MUX_MODE14 )  // (shared pin)  
   DRA7XX_CORE_IOPAD( P9_20a, PIN_INPUT_PULLUP | MUX_MODE7  )  // sda  
   DRA7XX_CORE_IOPAD( P9_20b, PIN_INPUT_PULLUP | MUX_MODE14 )  // (shared pin)  
  >;  
 };
 mcasp1_pins: mcasp1_pins {
  pinctrl-single,pins = <
   DRA7XX_CORE_IOPAD(P9_12, PIN_INPUT_PULLDOWN | MUX_MODE0) // 12 0  mcasp1_aclkr  BIT CLOCK      BCLK
   DRA7XX_CORE_IOPAD(P9_27b, PIN_INPUT | MUX_MODE0) // 27b 0  mcasp1_fsr    FRAME SYNC            LRCLK
   DRA7XX_CORE_IOPAD(P9_18b, PIN_INPUT | MUX_MODE0) // 18b 0  mcasp1_axr0   I2S INPUT             DATA
  >;
 };  
};  
// enable pwm-2 on P9.14 (out-A) + P9.16 (out-B)  
&epwmss2 {  
 status = "okay";  
};  
&ehrpwm2 {  
 status = "okay";  
 pinctrl-names = "default";  
 pinctrl-0 = <&ehrpwm2_pins>;  
};  
&dra7_pmx_core {  
 ehrpwm2_pins: ehrpwm2 {  
  pinctrl-single,pins = <  
   DRA7XX_CORE_IOPAD( P9_14, PIN_OUTPUT_PULLDOWN | MUX_MODE10 )  // out A  
   DRA7XX_CORE_IOPAD( P9_16, PIN_OUTPUT_PULLDOWN | MUX_MODE10 )  // out B  
  >;  
 };  
};  
  

However I think it doesn't detect it as a capture device. Since the grep and arecord command return this:

debian@beaglebone:/var/lib/cloud9$ dmesg |grep sound                                                      
[    1.385258] asoc-simple-card sound: pcm5102a-hifi <-> 48460000.mcasp mapping ok
debian@beaglebone:/var/lib/cloud9$ arecord -l
**** List of CAPTURE Hardware Devices ****
debian@beaglebone:/var/lib/cloud9$

I think there might be a problem with ALSA configuration, but I am new into this and I dont know how to do it.

My ALSA version is: Advanced Linux Sound Architecture Driver Version k4.14.108-ti-r143.

And my sound cards are:

cat /proc/asound/cards
 0 [Black          ]: TI_BeagleBone_B - TI BeagleBone Black
                      TI BeagleBone Black

So the card is not detected? Is it ALSA or driver problem? How can I do it?

Mikel
  • 40
  • 1
  • 9

0 Answers0