Is the CPLD code available?

Hello, i’m toying with the idea of building a custom board using the same codec and cpld, so i’m looking at how you change the clocks and trick the rpi into reading the bigger multichannel frames over i2s

is the code for the cpld available somewhere? I can’t find almost everything else in the github repos but not this

Hi @possan,
not yet but we just need to review a few things and it is in our plans to release it.

I’ll send you a PM and can get you a tarball archive in the meanwhile, also for anyone else interested. There are not many uses to modify the code on the Elk Pi hat but it makes total sense if you want to build a new HW shield.

1 Like

I would be interested in this as well.

Hi @Stefano, I’m interested in building an elk compatible audio card with other codecs ics than the pcm3168, I’m interested in understanding how the audio and CV driver interfaces with the pcm codec, will you please tell me which files in the elk repository is relative to the codec driver? It would be also interesting to have the cpld code.
Thanks a lot

Hi @boncia and welcome here!
Could you please create a new topic since your question is not strictly related to the original one in this thread?

Here is the audio codec driver:

It’s not a normal Linux driver, it’s a Xenomai RTDM one.

You might also want to check the RASPA library to access the driver from userspace:

We’re also working on supporting other codecs right now.

Hi @Stefano, shure, I can create a new threah how can I move the post to the new thread?

Hi @Stefano,
thank you for making Elk Audio Open Source, this is very helpful!
I am currently also designing an audio device based on the Raspberry Pi, and I want to include your solution for multi channel analog IO.
Can you explain what exactly the CPLD is doing? From the schematic it seems like the CLPD is changing the LRCLK based on the BCLK, so the Raspberry Pi understands it.
Would it be possible to extract one of the I2S streams muxed into the TDM stream, and give out an additonal set of DIN, DOUT, LRCLK and BCLK, based on one IO stream in the TDM signal?
The reason I am asking is that I will use a MCU that supports USB audio, and it would be great to have one of the input and output signals also available on the USB port.
Best Regards,