Repository navigation
v3.1.0 — AAC works, and it was never the hardware
AAC and AAC+ play now. The cause was never the Cardputer.
ESP32-audioI2S used the Helix AAC decoder up to version 3.0.0 and switched to
faad2 afterwards. faad2's channel_pair_element() asks for 22,006 bytes
in one piece, per stereo frame — about 43 times a second — and checks 2 of
its 71 allocations for NULL. Without PSRAM that block is not reliably there, so
every AAC station died on its first frame, 64 kbit/s exactly like 192.
Putting the Helix decoder back fixes it. It allocates 20.6 KB once when the
station opens and keeps it. Fourteen test streams — MP3 64–320, AAC 64–192,
AAC+ 32–96 — then played with zero crashes and nothing audible missing. The
build also shrinks by 62 KB.
The swap is a change to the library, not to the sketch, and it is written up in
library-patch/aac-helix-swap.md.
A library update overwrites it, and AAC will start rebooting the device
again until it is redone.
What follows from it
- The online directory no longer filters AAC away. That filter was hiding
42% of the stations in Australia, 33% in Poland, 13% in Germany. - "128 kbit/s or lower is the sweet spot" is withdrawn. Measured twice
over: every MP3 stage up to 320 kbit/s played cleanly, no warning from the
library, nothing audible. Bitrate was never the limit — the decoder was. - A decoder that runs out of memory now says so. The footer shows
Low RAM - codec too biginstead of the device rebooting. station_list_test.txtships with the fourteen streams used for all of this,
named128-mp3,64-aac,48-aacpand so on, each verified by measuring
its real data rate rather than trusting a directory entry.
The one catch
No SBR — the "+" in AAC+. The decoder compiles it in only when
BOARD_HAS_PSRAM is defined, because its state costs another 50,788 bytes.
AAC+ therefore plays its base layer only: 22,050 Hz instead of 44,100, and mono
instead of stereo where parametric stereo is used. It is stable, it just sounds
duller. Plain AAC-LC is unaffected.
https is still out, for the unchanged reason: mbedTLS wants about 32 KB.
Flashing
| File | Flash to |
|---|---|
Cardputer-WebRadio_v3.1.0.bin |
SD card / M5Launcher — application only |
Cardputer-WebRadio_v3.1.0_merged.bin |
address 0x0 with M5Burner or a web flasher |
Building from source needs both library patches, the https one and the AAC
decoder swap.
Credits
Thanks to DrRhesus, whose
radio plays AAC on the same board without PSRAM. Comparing against it is what
pointed at the decoder rather than the hardware. And to
schreibfaul1, whose
library does the work — including the 3.0.0 decoder that makes this release
possible.