I2S Audio on the BBB

I spent most of the weekend down in the rabbit-hole, trying to get a
CircuitCo Rev_B Audio cape to work, (unsuccessfully.)

Is this cape compatible-with / supported-by Debian 8.6/kernel 4.4 ?

Does the BB-BONE-AUDI-02-00A0.dtbo overlay that comes with the current distribution work?

How can you tell if an overlay actually loaded, with 4.4?
/sys/devices/platform/bone_capemgr/slots
as well as the boot log, only shows the first physical four, and no longer shows the higher numbered “pseudo-capes” and overlay status.

I understand that
The CircuitCo cape does not have an EEPROM, so everything needs to be configured explicitly.
I need to use a base .dts with HDMI audio disabled, then load the overlay for the CircuitCo card.
I also need to load the asound.state file.

Am I approaching this correctly?

I can not use a USB-soundcard for audio. I have several applications
that need McASP/I2S running for several other codecs, but I thought I would start
with the CircuitCo cape as a starting point.

Thanks,
— Graham

I’m also interested as I have a project where I will interface directly to the I2S/McASP interface. Did you figure it out?

Yes, I was able to get a CircuitCo Rev.B Audio cape running, using the I2S/McASP interface.
I’ll write it up for you, if you are interested.

If you are going to use a different CODEC or other device on the I2S/McASP interface,
you will need to see if a driver already exists for it, or if it fits a generalized I2S audio interface that
is already inside the kernel can be invoked and controlled from a device tree.

If it is unique, then you will have to write your own Linux driver and recompile the kernel.

If you just want audio, it is a lot easier to just use a USB CODEC.

— Graham

I would appreciate the writeup, thank you.

My project requires interfacing to an IC with I2S input. I planned on using (something like) aplay to write audio out to I2S/McASP channel (using built-in driver support) and hoped I could also use the built-in support (drivers) for SPI and/or I2C using the /dev/spidev<x.y> or /dev/i2c- devices to control the IC.

It will be a day or so, but I will post the write-up here.

You will not be able to control the IC independently, since the kernel claims the device.
The Linux audio system expects to be able to control the audio controls such as volume, etc.
by reaching into the CODEC through the control bus. The kernel blocks direct user
space access to the device.

In fact one way to make sure the device tree loaded correctly is that the “UU” symbol
appears at the devices’ I2C address.

— Graham

This is very old, but I’m still interested in using I2S to directly drive an audio device (software defined radio module).
Could you post your write-up if available? Thanks.

I need to gather it together and do some edits, so it makes sense.
It will be a few days or so.
— Graham

ags:
Here it is.
— Graham

@Graham thanks for posting this. I expect to have to do some things differently since my target CODEC is different and overlays are now handled differently. In any case, this will give me a good head start and foundation to build on.

Hey hi Graham,
Its an elaborate and very well explained post. I wanted to use same CODEC to play an audio on BBB but on the latest Debian version 9.3. Device tree overlay structure is very different in the latest images. Will these same commands work on recent images as well? If you have tried it on any recent image,can you please guide?
Thanks,
Jithu.

The device tree stuff might change, but I'd imagine everything beyond
"You can check the existence of a soundcard…" should be near identical.