Getting Started with a custom Audio Cape

Next pins

dmesg | grep pinctrl-single
[    0.920765] pinctrl-single 44e10800.pinmux: 142 pins, size 568
[    1.131798] pinctrl-single 44e10800.pinmux: pin PIN107 already requested by ocp:P1_29_pinmux; cannot claim for 48038000.mcasp
[    1.143455] pinctrl-single 44e10800.pinmux: pin-107 (48038000.mcasp) status -22
[    1.150891] pinctrl-single 44e10800.pinmux: could not request pin 107 (PIN107) from group pinmux_bone_audio_cape_audio_pins  on device pinctrl-single

and fixed! :wink: i think one more…

looking forward to!

[    0.921007] pinctrl-single 44e10800.pinmux: 142 pins, size 568
[    1.129717] pinctrl-single 44e10800.pinmux: pin PIN27 already requested by ocp:P2_02_pinmux; cannot claim for 48038000.mcasp
[    1.141252] pinctrl-single 44e10800.pinmux: pin-27 (48038000.mcasp) status -22
[    1.148596] pinctrl-single 44e10800.pinmux: could not request pin 27 (PIN27) from group pinmux_bone_audio_cape_audio_pins  on device pinctrl-single

and fixed!!!

oh wow, no more pin mux errors:

dmesg | grep pinctrl-single
[    0.921210] pinctrl-single 44e10800.pinmux: 142 pins, size 568

and aplay -l returns:

debian@beaglebone:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: B [AudioCape Rev B], device 0: davinci-mcasp.0-tlv320aic3x-hifi tlv320aic3x-hifi-0 [davinci-mcasp.0-tlv320aic3x-hifi tlv320aic3x-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Looks great, doesnt it? Do I need to check something else now?

I cant express how thankful I am for your effort and the time to fix this on such a short notice!
Thanks to heavens and back!

it’s perfect!!!

and now it’ll work for the next user too! thanks for helping debug BeagleBoard.org’s overlay’s !

Regards,

glad to be of any use!
Mind explaining in brief words what did we just do?

Was the old Audio cape completely incompatible with the newest kernel, and this was needed to make it work again?
Would have regressing to the old kernel version work? Why is an important device, such as audio not maintained?

Hello @RobertCNelson sorry to bring you back on this thread…
The debugging we did last week, unfortunately didn’t make my cape working. The aplay -l command listed that soundcard was present, but no sound would come out of it. I sniffed around the dmesg and found the following errors:

[    1.125050] tlv320aic3x-codec 2-0018: 2-0018 supply IOVDD not found, using dummy regulator
[    1.125158] tlv320aic3x-codec 2-0018: Linked as a consumer to regulator.0
[    1.125175] tlv320aic3x-codec 2-0018: 2-0018 supply DVDD not found, using dummy regulator
[    1.125260] tlv320aic3x-codec 2-0018: 2-0018 supply AVDD not found, using dummy regulator
[    1.125335] tlv320aic3x-codec 2-0018: 2-0018 supply DRVDD not found, using dummy regulator
[    1.125425] tlv320aic3x-codec 2-0018: Invalid supply voltage(s) AVDD: -22, DVDD: -22

Would this suggest a hardware error?
How could the U-boot/Linux kernel know what voltages are present and which not, since no measurements was used on BB side?

These are required properies of the tlv320aic31xx device tree:

Required properties:

- compatible - "string" - One of:
    "ti,tlv320aic310x" - Generic TLV320AIC31xx with mono speaker amp
    "ti,tlv320aic311x" - Generic TLV320AIC31xx with stereo speaker amp
    "ti,tlv320aic3100" - TLV320AIC3100 (mono speaker amp, no MiniDSP)
    "ti,tlv320aic3110" - TLV320AIC3110 (stereo speaker amp, no MiniDSP)
    "ti,tlv320aic3120" - TLV320AIC3120 (mono speaker amp, MiniDSP)
    "ti,tlv320aic3111" - TLV320AIC3111 (stereo speaker amp, MiniDSP)
    "ti,tlv320dac3100" - TLV320DAC3100 (no ADC, mono speaker amp, no MiniDSP)
    "ti,tlv320dac3101" - TLV320DAC3101 (no ADC, stereo speaker amp, no MiniDSP)

- reg - <int> -  I2C slave address
- HPVDD-supply, SPRVDD-supply, SPLVDD-supply, AVDD-supply, IOVDD-supply,
  DVDD-supply : power supplies for the device as covered in
  Documentation/devicetree/bindings/regulator/regulator.txt

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/sound/tlv320aic31xx.txt?h=v5.16-rc4

The PocketBeagle has these default regulators off the tps65217:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/am335x-osd335x-common.dtsi?h=v5.16-rc4#n59

If you have a gpio feeding one of the lines, you can create a fake regulator such as:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/am335x-pocketbeagle.dts?h=v5.16-rc4#n54

Your “pcb/hardware” is probably fine, this more about correctly wiring up the device tree options for your chosen device.

Regards,

Thanks for the explanation.

I have some changes to report. Our hustle last week unfortunately doesn’t work. The clock signals are left out and the codec is hanging. This is probably because the PB-BONE-AUDI is just a copy of BB-BONE-AUDI, and pins might not be compatible to each other. Is there some difference in pinout of two Beagle boards?

What does work, however, is the PB-I2C1-TLV320AIC3104 overlay. After some changes, described here, the overlay has been loaded and the aplay exited after playing the sample file. This didnt happen before, what suggests that clocks were not configured properly at the time. So, maybe we continue from this point on.

Lots of differences, the BeagleBone black has an HDMI encoder (video/audio) thus it has a default clock setup:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/am335x-boneblack-hdmi.dtsi?h=v5.16-rc4#n111

The PocketBeagle, is just the processor, microSD and usb…

Regards,

well in that case it doesnt help much to use the dts file intended for BB board. Anyways, I can confirm that the other overlay, PB-I2C1-TLV320… does not create clocking issues. I still have no sound output the way I expect it, but people at Bela suggest to play with amixer until something comes out. If I’m succesful, may I push to the repo?

Yeap, just fork and if you get it working, do a merge request. :wink:

Regards,

ok, will do. Any suggestion on how the dts file should be named? I assume -02-00A0 is not applicable any more

Hi guys, it was great to find this thread! I followed through and was fortunate to be using a BBB rather than a PB. That’s because I’m just using the design from Audio Cape RevB with a stripped mic (just audio).
Following your conversations, I was able to:

git clone https://github.com/beagleboard/bb.org-overlays
cd ./bb.org-overlays
make
sudo make install

And make the necessary changes to the uEnv.txt file (using BB-BONE-AUDI-02-00A0 instead of the PB version used in the thread) to get aplay -l to show the codec.

When I try to play a .wav file, I get nothing nothing out. I see that I also get the “supply” issue:

[    1.408680] tlv320aic3x-codec 2-0018: 2-0018 supply IOVDD not found, using dummy regulator
[    1.408787] tlv320aic3x-codec 2-0018: Linked as a consumer to regulator.0
[    1.408801] tlv320aic3x-codec 2-0018: 2-0018 supply DVDD not found, using dummy regulator
[    1.408886] tlv320aic3x-codec 2-0018: 2-0018 supply AVDD not found, using dummy regulator
[    1.408967] tlv320aic3x-codec 2-0018: 2-0018 supply DRVDD not found, using dummy regulator
[    1.409057] tlv320aic3x-codec 2-0018: Invalid supply voltage(s) AVDD: -22, DVDD: -22
[    1.570147] asoc-simple-card sound: tlv320aic3x-hifi <-> 48038000.mcasp mapping ok
[  280.925436] tlv320aic3x-codec 2-0018: Unable to sync registers 0x3-0x3. -121

But I’m not sure how this gets addressed in the thread. I’m also fairly new at this. For reference, I’m running 4.19.94-ti-r73. Any help would be greatly appreciated.