title: How to record I2S audio microphone in Beaglebone AI
body: <p>I am trying to record in a Beaglebone AI from a Circular Microphone Board TIDA-01454. I have checked that the CMB's output is correct with an I2S DAC(I can hear the mics sound). However, I cant record in the Beaglebone AI, this is what happens when I try to arecord:</p>
  <blockquote>
  <p>arecord --device=&quot;hw:1,0&quot; -c2 -f S32_LE test.wav</p>
  <p>Recording WAVE 'test.wav' : Signed 32 bit Little Endian, Rate 8000 Hz,
  Stereo</p>
  <p>arecord: pcm_read:2145: read error: Input/output error</p>
  </blockquote>
  <p>I think the problem must be somewhere in my DTS file or ALSA configuration. But I dont really know, so if more information is needed, just ask for it.</p>
  <p>DTS(not complete):</p>
  <pre><code>pcm5102a: pcm5102a {
     #sound-dai-cells = &lt;0&gt;;
     compatible = &quot;ti,pcm5102a&quot;;
     status = &quot;okay&quot;;
  };
  
  
  sound {compatible = &quot;simple-audio-card&quot;;
          simple-audio-card,format = &quot;i2s&quot;;
          simple-audio-card,name = &quot;PCM5102a&quot;;
          simple-audio-card,bitclock-master = &lt;&amp;sound1_master&gt;;
          simple-audio-card,frame-master = &lt;&amp;sound1_master&gt;;
          simple-audio-card,bitclock-inversion;
          
          
          simple-audio-card,cpu {
                  sound-dai = &lt;&amp;mcasp1&gt;;
          };
          sound1_master: simple-audio-card,codec {
              #sound-dai-cells = &lt;0&gt;;
              sound-dai = &lt;&amp;pcm5102a&gt;;
              
          };
        };
  };
  &amp;mcasp1 {
      #sound-dai-cells = &lt;0&gt;;
      status = &quot;okay&quot;;
      pinctrl-names = &quot;default&quot;;  
      pinctrl-0 = &lt;&amp;mcasp1_pins&gt;;  
      op-mode = &lt;0&gt;;    /* MCASP_IIS_MODE */
      tdm-slots = &lt;2&gt;;
      num-serializer = &lt;4&gt;;
      /* 16 serializers */
      serial-dir = &lt; /* 1 TX 2 RX 0 unused */
               2 0 0 0
          &gt;;
      rx-num-evt = &lt;1&gt;;
      tx-num-evt = &lt;1&gt;;
  };
  </code></pre>
  <p>asound.conf:</p>
  <pre><code>pcm.onboard{
      type hw
      card 0
  }
  ctl.onboard {
      type hw
      card 0
  }
  
  ### Dsnoop splited channels
  pcm.onboard_capture_left {
       type dsnoop
       ipc_key 32
       slave {
           pcm &quot;onboard&quot;
           channels 2
       rate 48000
           format S32_LE
       }
       bindings.0  0
  }
  pcm.onboard_playback_left {
       type dmix
       ipc_key 33
       slave {
           pcm &quot;onboard&quot;
           channels 2
       }
       bindings.0  0
  }
  
  
  pcm.onboard_capture_right {
       type dsnoop
       ipc_key 32
       slave {
           pcm &quot;onboard&quot;
           channels 2
       rate 48000
       format S32_LE
       }
       bindings.0  1
  }
  pcm.onboard_playback_right {
       type dmix
       ipc_key 33
       slave {
           pcm &quot;onboard&quot;
           channels 2
       }
       bindings.0  1
  }
  
  
  ### PLUGS ##
  ### used with darkice
  ### device = plug:plug_onboard_left
  pcm.plug_onboard_capture_left{
          type plug
          slave.pcm &quot;onboard_capture_left&quot;
  }
  pcm.plug_onboard_playback_left{
          type plug
          slave.pcm &quot;onboard_playback_left&quot;
  }
  
  pcm.!default {
      type asym
      playback.pcm &quot;plug_onboard_playback_left&quot;
      capture.pcm &quot;plug_onboard_capture_left&quot;
  }
  </code></pre>