Hello,

I was able to get the audio codec on Bela Mini to play and record audio using the Bela IDE, but i'd really like to be able to use ALSA to access the same capabilities, aplay, arecord etc.

When i try aplay -l the following is output.
root@bela:~# aplay -l
* List of PLAYBACK Hardware Devices *

From reading other posts, the driver exposes a RAW MIDI driver, which it does
root@bela:/# cat /proc/asound/cards
0 [fmidi ]: MIDI Gadget - f_midi
MIDI Gadget

I'm wondering how do I get access to a "normal?" ALSA driver/configuration. Sorry, I don't know a whole lot about how ALSA works.

From reading other posts, it looks like the regular Bela + Beagle bone black has the same problem, for which you need to load the BB-BONE-AUDI-02 overlay.
https://forum.bela.io/d/834-output-to-pulseaudio

Is there a similar overlay for Pocket Beagle. If there is, how do I go about loading it?

Thanks!

The Bela and BelaMini capes can be used with ALSA using the BB-BONE-AUDI-02 overlay. This requires:

  • installing one of the images provided by beagleboard.org
  • load the BB-BONE-AUDI-02 overlay, using whatever instructions they provide (this normally requires editing (carefully) the /boot/uEnv.txt file).

My post here explains how to do it on a BeagleBone Black. Hopefully it is not too different on a PocketBeagle.

Note that this way you will not have access to Bela's IDE and you will not be able to run Bela programs. You'd have to use "stock" software instead, and if you are writing some C++ code, you'll have to manually connect to ALSA. If you want to access Bela's analog ins and outs from C/C++, you can use the example code here.

Thanks so much. I downloaded the Debian 9.9 IoT image from beaglebone's web site, was able to get the OS to boot up, and i changed the uEnv.txt file, then rebooted, but the device driver did not load.

debian@beaglebone:/$ cat /proc/asound/devices
33: : timer

Are you sure the BB-BONE-AUDI-02-00A0 will work with the pocket beagle? I'm thinking it wont load because the compatible string does not contain PB, right?

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

Also, i'm not sure if the pinmux would be the same on these devices vs PB.

Thanks for the help!

you can have a look at dmesg and it will tell you why it failed. I suspect it's a matter of disabling some of the cape_universal pins. I can have a look tomorrow.

Oh shoot yah, sorry i looked through earlier but missed this:

[ 1.137017] tlv320aic3x-codec 2-0018: 2-0018 supply IOVDD not found, using dummy regulator
[ 1.137119] tlv320aic3x-codec 2-0018: 2-0018 supply DVDD not found, using dummy regulator
[ 1.137183] tlv320aic3x-codec 2-0018: 2-0018 supply AVDD not found, using dummy regulator
[ 1.137252] tlv320aic3x-codec 2-0018: 2-0018 supply DRVDD not found, using dummy regulator
[ 1.137322] tlv320aic3x-codec 2-0018: Invalid supply voltage(s) AVDD: -22, DVDD: -22
[ 1.139273] pinctrl-single 44e10800.pinmux: pin PIN100 already requested by ocp😛1_36_pinmux; cannot claim for 48038000.mcasp
[ 1.151531] pinctrl-single 44e10800.pinmux: pin-100 (48038000.mcasp) status -22
[ 1.159144] pinctrl-single 44e10800.pinmux: could not request pin 100 (PIN100) from group pinmux_bone_audio_cape_audio_pins on device pinctrl-single
[ 1.172738] davinci-mcasp 48038000.mcasp: Error applying setting, reverse things back
[ 1.180768] davinci-mcasp: probe of 48038000.mcasp failed with error -22

    Hey, I was able to get everything up and working on the pocket beagle + bela mini.

    PB-I2C1-TLV320AIC3104 with some tweaks should be used instead of BB-BONE-AUDI-02-00A0.dts for the pocket beagle.

    Here are the steps that I took to get it working.

    1. edit PB-I2C1-TLV320AIC3104.dts
      Change:
      target = <&i2c1>;
      to:
      target = <&i2c2>;

    also, change:
    PB-I2C1-TLV320AIC3104 = TIMESTAMP;
    to:
    PB-I2C2-TLV320AIC3104 = TIMESTAMP;

    rename PB-I2C1-TLV320AIC3104.dts to PB-I2C2-TLV320AIC3104.dts

    compile PB-I2C2-TLV320AIC3104.dts to PB-I2C2-TLV320AIC3104.dtb

    1. upload dtb to device (/home/debian/audio_test directory for my test

    2. edit uEnv.txt
      All fields that are not commented out:
      uname_r=4.14.108-ti-r113
      enable_uboot_overlays=1
      uboot_overlay_addr4=/home/debian/audio_test/PB-I2C2-TLV320AIC3104.dtb
      disable_uboot_overlay_emmc=1
      disable_uboot_overlay_video=1
      disable_uboot_overlay_audio=1
      disable_uboot_overlay_wireless=1
      disable_uboot_overlay_adc=1
      uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo
      enable_uboot_cape_universal=0
      cmdline=coherent_pool=1M net.ifnames=0 rng_core.default_quality=100 quiet

    1. reboot
    2. verify the driver loaded

    dmesg
    aplay -l
    arecord -l
    cat /proc/asound/device

    ksmith197 [ 1.139273] pinctrl-single 44e10800.pinmux: pin PIN100 already requested by ocp😛1_36_pinmux; cannot claim for 48038000.mcasp
    [ 1.151531] pinctrl-single 44e10800.pinmux: pin-100 (48038000.mcasp) status -22
    [ 1.159144] pinctrl-single 44e10800.pinmux: could not request pin 100 (PIN100) from group pinmux_bone_audio_cape_audio_pins on device pinctrl-single

    this would be one of the issues, it's probably a matter of adding something like this to the BB-BONE-AUDI-02 overlay:

    	fragment@0 {
    		target = <&ocp>;
    		__overlay__ {
    			P2_09_pinmux { status = "disabled"; }; 
    			P2_11_pinmux { status = "disabled"; }; 
    			P2_26_pinmux { status = "disabled"; };
    			P2_30_pinmux { status = "disabled"; };
    			P2_32_pinmux { status = "disabled"; };
    			P2_34_pinmux { status = "disabled"; };
    			P1_05_pinmux { status = "disabled"; };
    			P1_06_pinmux { status = "disabled"; };
    			P1_08_pinmux { status = "disabled"; };
    			P1_09_pinmux { status = "disabled"; };
    			P1_10_pinmux { status = "disabled"; };
    			P1_11_pinmux { status = "disabled"; };
    			P1_12_pinmux { status = "disabled"; };
    			P1_26_pinmux { status = "disabled"; };
    			P1_28_pinmux { status = "disabled"; };
    			P1_29_pinmux { status = "disabled"; };
    			P1_33_pinmux { status = "disabled"; };
    			P1_36_pinmux { status = "disabled"; };
    			P9_25_pinmux { status = "disabled"; }; /* mcasp0_ahclkx */
    			P9_28_pinmux { status = "disabled"; }; /* mcasp0_axr2 */
    			P9_29_pinmux { status = "disabled"; }; /* mcasp0_fsx */
    			P9_31_pinmux { status = "disabled"; }; /* mcasp0_ahclk */
    			P9_30_pinmux { status = "disabled"; }; /* mcasp0_axr0 */
    		};
    	};

    (or actually a subset thereof, the above are the ones set by the Bela cape overlay).

    Great that it works for you and thanks for sharing your instructions.

      2 years later

      giuliomoro Hello, as mentioned in the other thread, with the help of BB image maintaner Robert Nelson, we figured out that in order to get the codec recognized, disabled pinmux was:

                      __overlay__ {
                              P1_29_pinmux { status = "disabled"; };
                              P1_33_pinmux { status = "disabled"; };
                              P1_36_pinmux { status = "disabled"; };
                              P2_02_pinmux { status = "disabled"; };
                              P2_30_pinmux { status = "disabled"; };
                              P2_32_pinmux { status = "disabled"; };
                      };

      However, my issues with voltage errors in dmesg still prevail. I'm gonna try the @ksmith197 's suggestion and try another dts.