I mean where else would you set it up?Who ever reads the latest update, please check the image carefully.
He actually sets up the evaluation board on a train ...
Epic.
13.1 ABE Overview
The audio back end (ABE) module is a subsystem that manages various audio and voice uplink and
downlink streams between the initiator
It sounds like AESS is a small part of ABE. If the ABE sets up how to connect to ram and other parts of the system for AESS to do the work with the sound and output it to speakers, then ABE would need to be set up before AESS?13.1.1 AE Subsystem
The AE is the core of the ABE subsystem. It performs the real-time audio processing within the ABE:
• Mixing
• Muxing
• Volume control
• Smooth muting
• Sampling rate conversion
• Side-tone equalization
Just a quick note: I have a 3.15 kernel working on the PandaES. It still has omap-pcm.c but no omap-abe-mmap.cI finally got some time to work on this and I got some news!
View attachment 39456
Before you get too excited: no, I haven't been able to play sound yet but I've made some realizations.
The old Linux-3.8 driver actually have 2 audio "platform drivers":
ABE (Audio BackEnd) is somehow related to AESS. Maybe one of them is a component of the other? I haven't looked it up
omap-pcm.c
- introduced in 2008 with support for Nokia N810omap-abe-mmap.c
- added in 2012 as a "ABE low power" driver.
The Letux port of the audio driver only has 1 "component driver" (it has changed name from "platform" to "component"):
It looks to be a port of
omap-aess-pcm.c
omap-abe-mmap.c
. I can't blame anyone for going with the driver that clearly states that it's meant for the ABE/AESS when porting the code and disregard the older driver.
However, it looks like there's a symbiosis between the drivers happening in the old code.
One of the problems I've had on a newer kernel is that I couldn't even begin to play any streams unless I chose the "OMAP ABE Media LP" device. Choosing this device triggers some special branches in theomap-aess-pcm.c
code to let the kernel know about the hw constraints of the device. If I chose any other device, that branch was not hit and the kernel refused to play.
I started investigating what code did the same thing on the older kernel, and I found that it was done in 2 places. Inomap-abe-mmap.c
when using the "OMAP ABE Media LP" device and inomap-pcm.c
otherwise.
It's clear to me that parts of the oldomap-pcm.c
driver has to be ported over toomap-aess-pcm.c
, but I don't know what yet.
I'm based off of https://git.goldelico.com/?p=letux-kernel.git;a=shortlog;h=refs/heads/work-aess-noprint-v9 if anyone else want to help out!
I tried using the letux/aess-v13 head, but things have changed in the kernel memory management and I wasted about a day debugging stack corruption. I wouldn't recommend it.
That's it for now. Sorry for the delay
I'll take a look!Just a quick note: I have a 3.15 kernel working on the PandaES. It still has omap-pcm.c but no omap-abe-mmap.c
So this might be a key to get things solved.
Looks like that Linux-3.15 repo is simply missing the two commits that addsJust a quick note: I have a 3.15 kernel working on the PandaES. It still has omap-pcm.c but no omap-abe-mmap.c
So this might be a key to get things solved.
omap-abe-mmap.c
: https://github.com/Risca/linux/commits/omap5_uevm-3.8/sound/soc/omap/omap-abe-mmap.comap-abe-mmap.c
is not really needed. Mind you, I was not able to load the AESS firmware when I tried running a kernel from there. The firmware format might have changed between Linux-3.8 and Linux-3.15. Unfortunately, I've been unable to build a new firmware based on Linux-3.15 branch :/Yes, the firmware format must always match the kernel expectations. It appears that you have to run /root/build-aess-fw to build the firmware binary from source. It is included in the omap-audio-3.15 branch. What I don't know is if it works on the OMAP5. Just tested on the PandaES (where I have access to the handsfree speaker through expansion connector J6).Looks like that Linux-3.15 repo is simply missing the two commits that addsomap-abe-mmap.c
: https://github.com/Risca/linux/commits/omap5_uevm-3.8/sound/soc/omap/omap-abe-mmap.c
Notably, the second commit is some kind of big bang "Just fix it" commit before release (my interpretation).
However, if you've successfully been able to use the AESS on that branch, it means thatomap-abe-mmap.c
is not really needed. Mind you, I was not able to load the AESS firmware when I tried running a kernel from there. The firmware format might have changed between Linux-3.8 and Linux-3.15. Unfortunately, I've been unable to build a new firmware based on Linux-3.15 branch :/
The story continues...
That sounds (pun intended) greatAlright, got AESS running on Letux-3.15 kernel now - it was as I expected: too many drivers disabled to cut down on build/boot time.
According to htop, playing a 96 kHz audio sample consumes around 1-2% cpu same with a 44.1 kHz audio sample.
Next step will be to compare this branch to latest Letux kernel
#!/bin/bash
# use https://www.capstone-engine.org
[ "$(which cstool)" ] || sudo port install capstone || sudo apt-get install capstone-tool # for MacPorts || Debian
[ -r abe_firmware.c ] || wget -O abe_firmware.c https://git.ti.com/cgit/glsdk/abefw-omap4plus/plain/fw/009590/abe_firmware.c?id=eb79849a8c4c50b5f87f5923482162c3dea56147
MODE="$1"
[ "$MODE" ] || MODE=2
function hexify { # process abe firmware file
ADDR=-20 # skip 5 words header (version, pmem+cmem+dmem+smem size)
while read LINE
do
case "$LINE" in
*/'*' | '*'* ) continue;; # comment
'' ) continue;; # empty
esac
HEX="$(echo "$LINE" | cut -d ',' -f 1)"
if false
then # attempt byte swap - has 2144 ERRORs instead of 1634 ERRORs without swap...
H=$[$HEX]
HEX=$(printf "%02x%02x%02x%02x" $[HEX&0xff] $[(HEX&0xff00)>>8] $[(HEX&0xff0000)>>16] $[(HEX&0xff000000)>>24])
fi
[ $ADDR -ge 0 ] && echo $HEX
# printf "%08x\n" $[$(echo "$LINE" | cut -d ',' -f 1)]
ADDR=$[ADDR+4]
done <abe_firmware.c
}
A=0
case $MODE in
1) # disassemble single lines (for debugging)
hexify | while read HEX
do
cstool tms320c64x "$HEX" 0x$A 2>/dev/null || echo $A: invalid assembly code: $HEX
B=0x$A A=$(printf "%04x" $[B+4])
done
;;
2 ) # disassemble full file
HEX=$(hexify)
#echo $HEX
cstool -s tms320c64x "$HEX" $A
;;
esac
snd_pcm_hw_constraints_complete()
because some driver is not filling in the data we need to get past this step. I tracked it down to the "omap-pcm-audio" platform driver on Linux-3.15. It calls snd_soc_set_runtime_hwparams()
with the necessary data. This data now lives in the aforementioned "sdma-pcm" platform driver, or maybe you could say that this data now lives in every driver that is registered using sdma_pcm_platform_register()
. I just need to setup the proper DAI links so the data from the "sdma-pcm" driver gets loaded... I think.