ALSA drivers for ES9080Q and TLV320AIC3104

The Bela cape rev C comes with a ES9080Q 8-channel DAC and a TLV320AIC3104 stereo codec. The former has no support on Linux, while the latter is well supported. This project involves:

  • writing a driver for the ES9080Q, which interacts with existing McASP and DMA drivers
  • have the ES9080Q and TLV320AIC3104 show up as a single ALSA device with 2 inputs and 10 outputs. Explore whether this can happen via a simple wrapper in the device tree or requires a dedicated driver.

Goal: Upstream support of ES9080Q; simultaneous access to ES9080Q and TLV320AIC3104 via ALSA
Hardware Skills: None, but a scope or logic analyzer will be useful
Software Skills: C or Rust, kernel developmnet
Possible Mentors: @giuliomoro
Expected Size of Project: 175 hrs or more
Rating: Medium
Upstream Repository: GitHub - BelaPlatform/bela-hardware: Bela cape and capelets design files for the Bela cape Rev C bela-hardware/cape/bela_cape_rev_C3 at master Ā· BelaPlatform/bela-hardware Ā· GitHub
References: GitHub - BelaPlatform/Bela: Bela: core code, IDE and lots of fun! shows how to access this driver with a custom driver and DMA running on the PRU.

Hi @giuliomoro, I would like to know more about the project.
I have some question:

  1. Since this is working well on PRU, by patch the driver to linux does it mean to support device without PRU like BeagleBoneĀ® AI-64 or BeagleVĀ®-Ahead
  2. Do this driver only support on linux with Xenomai or normal linux


To ensure I understand the project goals clearly. I have illustrated ALSA, Linux Kernel and Hardware Integration diagram.
The driver will be part of the ALSA SoC (ASoC) framework. The block that highlighted with red color indicates the task for this project.
Task:

  1. ES9080Q DAC Codec Driver
  • I2C Communication
  • Device Init and Configuration
  • Setting up the TDM
  1. Machine Driver
  • Registers the S9080Q and TLV320AIC3104 as a single ALSA device
  1. Platform Driver
  • Handling DMA data transfer
  • Configure McASP
  • Handle interrupts and buffer management

Welcome and thanks for your interest.

This is missing the codec driver for the ES9080Q. Also, the communication between the McASP and the ES9080Q is via TDM, not I2C.

This is about drivers that use ALSA and DMA, no PRU involved.

In the first instance, a regular non-Xenomai Linux driver is the objective. If we select the longest duration for the project, then we could add a Xenomai port to the ALSA driver. This will need to be modified to use Xenomai-friendly DMA and IRQs.

1 Like

Thanks for your feedback.

This is missing the codec driver for the ES9080Q. Also, the communication between the McASP and the ES9080Q is via TDM, not I2C.

Noted, the communication between McASP via TDM and i2c to configuring ES9080Q registers

we could add a Xenomai port to the ALSA driver.

The Xenomai port you refer is against the Real-Time Driver Model (RTDM) with Xenomai V3, How about EVL driver tinyalsa-evl ?

I am not familiar with that one, but it looks pretty outdated? I think the ideal solution is an ALSA driver that can also handle out-of-band requests at Xenomai priority. I think that’s the foundational model of Xenomai-4 / evl kernel drivers.

@Jiande are you still working on this? The proposal submissions deadline is coming up this Sunday.

@giuliomoro Thanks for the reminder.

I’m working on the proposal, and current progress is about 80% completed.

Here is the link for the proposal proposals/2025/jiande/index.rst Ā· main Ā· Jian De / gsoc.beagleboard.io Ā· GitLab

@giuliomoro I complete my proposal draft. Here is the PR GSoC 2025 - ALSA drivers for ES9080Q and TLV320AIC3104 - Jian De (!66) Ā· Merge requests Ā· Google Summer of Code / gsoc.beagleboard.io Ā· GitLab

Please provide feedback to let me know anything need to improve or clarified. Thanks.

Thanks. Looks good overall, I think this can be a strong proposal.

Comments on ef6dbab53f62ad426740a9fae33e97ff030685b5:

  • figure 1 the ASOC Driver box is missing the tlc320aic3x driver
  • ā€œpathesā€ should be ā€œpathā€
  • ā€œFor es9080q codec driver parameters configuration. I will refer to the driver documentation and the implementation in Bela’s code core/Es9080_Codec.cppā€ . That implementation is limited to as specific use case. You may want to use the ESS ES9080Q datasheet as a further source of information. I know you included that in the resources at the bottom, but you will need it much earlier than ā€œIf I get stuck on my projectā€
  • "which which is actually " remove one ā€˜which’
  • the title ā€œPlatform Drivers Implementationā€ makes it look like you will be working on the platform driver, but I don’t think any work is needed there. You may make that clearer in the paragraph that you’ll be using TI’s existing drivers
  • figure 4 "sound card schematics’ I don’t understand why you have both DAI link1 and DAI link2. There’s no tlv320dacxxxx chip on the board, is that a way of referring to the dac part of the tlc320aic3x ? but then why is there also a tlc320aic playback DAI link? I suspect one should go
  • ā€œUses I2S for 2-channel input/output (AUDIO_INL/R and HPL/R).ā€ There’s also a line output available on board which is driven by the same digital data as HPL/R. Also, when running alongside the ES9080Q, this is actually running as TDM (not I2S) because the TLV320AIC3104 is generating the bitclock for both codects at 256 clocks per frame. Similarly in the ā€œSound Card Definitionā€, it should actually be the tlv320aic310x the one generating the clocks. That’s the currently used configuration. Other configurations may be possible with the current wiring, but we should probably start from the one that’s already in use on Bela.
  • I like the idea of benchmarking Xenomai-3 vs Xenomai-4, but that is not a high priority. I think Xenomai-4 should be privileged as it should be easier to port a driver to it and Xenomai-3 would require a complete rewrite which may be outside the scope of this project. It’s fine to keep it in there for the proposal, but maybe mark Xenomai-3 as a stretch goal?
  • ā€œLinux kernel 5.15ā€ is a bit old. We should target the latest Xenomai-4 supported kernel available.
  • Timeline:
    • ā€œfamiliarā€ should be ā€œfamiliarize withā€
    • it seems over ambitious to have ES9080Q driver implemented on week 1 and under ambitious to only progress on configuring one subsystem per week on weeks 3, 4 ,5. I think it’s more 3 weeks doing the ES9080Q and 1 week configuring the three subsystems. Anyhow, on balance it seems reasonable to reach a working ALSA driver by midterm. That would allow enough time for back and forth with the maintainers to make sure by the end of the project the driver is ready to marge. I would take out the RTDM stuff and give yourself more time to work on Xenomai-4/EVL instead.

Great work overall, make sure you submit by the deadline!

1 Like