GitHub

Fox Red Labs / Builds / Audio

Audio and video codecs on a LaunchPad

Pick a codec, build it for the board, flash it and compare every frame with a Mac build. LC3, Opus, MP3 and Plaits run on the MSPM33 C321A, and H.264 on it and the AM13E230.

HardNo wiring

Parts and steps

Which version

You need

  1. Build the Mac reference.TERMINAL

    Build the strict and fast-math references with a per-frame CRC for each frame.

    cd ports/lc3 host/build.sh

    You should see: The Mac references are built under ports/lc3/results/host.

  2. Build the board image.TERMINAL

    Build at -O2 with the float unit on and strict arithmetic. Nothing is flashed.

    target-m33/build.sh O2 hard strict

    You should see: The script ends with built .../lc3.out and a size line.

  3. Flash the board and compare.TERMINAL

    Flash the image, wait for the finished flag, read the results back over the probe and compare every checksum with the Mac reference. It prints cycles, the share of real time and the stack use. It plays no sound and drives no pin.

    Replace <probe serial> and <path of lc3.out> before you run this.

    cd ../.. PROBE=<probe serial> python3 ports/lc3/run_board.py <path of lc3.out>

    You should see: The CRCs match and the printed shares are about 12, 16 and 24 percent for encoding at 16, 24 and 48 kHz.

Or hand it to a coding assistant

Paste this in a terminal. It hands off to an AI assistant.

git clone --depth 1 --filter=blob:none https://github.com/Fox-Red-Labs/fox-red-labs.git && cd fox-red-labs ./start.sh mspm33c321a codecs --assistant claude

It runs the steps above and reports what it saw.

Not Claude Code? Copy this prompt instead.
Clone https://github.com/Fox-Red-Labs/fox-red-labs and read mspm33c321a/AGENTS.md first. Then run Audio and video codecs on a LaunchPad on my LP-MSPM33C321A, following docs/builds/codecs.md. Tell me when to plug in a board and what you saw at each step.

If something goes wrong

The compiler is missingInstall the Xcode command line tools and run it again.
It cannot find the SysConfig outputSet G to the gen160 folder from the prerequisites.
The probe is not foundPass the serial of your probe that xdsdfu -e lists.

Every fix for this board: the FAQ.

What to build next

Every build. The code for all of them is in the GitHub repository.

Evidence and limitsLC3, Opus, MP3 and Plaits run bit-exact on an MSPM33 C321A, and H.264 video decodes on it and on an AM13E230. Ran on 3 boards. Results, sources, timing and limits.

LC3 (LE Audio) on the LP-MSPM33C321A

Expected result: The board encodes and decodes LC3 frames with every checksum equal to the Mac's.

What this shows

  • LE Audio's codec runs in real time on a Cortex-M33 at 160 MHz with room left: the heaviest encode is 24.2 percent of a 10 ms frame.
  • The output is bit-exact against the Mac build in all three configurations, and the 7.5, 5 and 2.5 ms frames, packet-loss concealment and two channels also match in 9 of 9 runs.
What this does not establish, and limits

What this does not establish

  • Codec only: a generated test signal, no Bluetooth link and no sound output.
  • A Cortex-M0+ at 80 MHz is modelled in an emulator, not run: it needs about 329 percent of real time for the 16 kHz encode.

Limits to keep in mind

  • Build size is 157.8 kB of flash with every feature and 83.2 kB with LC3 only at -Os.
  • A fast-math build makes different encoder bytes from the strict build; both are valid LC3 but not byte-identical.

Sources

Versions, sizes and timing

Encode, 16 / 24 / 48 kHz198k / 249k / 388k cycles a frame
Decode, 16 / 24 / 48 kHz73k / 114k / 168k cycles a frame

Evidence

  • liblc3 v1.1.3 encodes 16, 24 and 48 kHz mono 10 ms frames in 12.4, 15.6 and 24.2 percent of real time and decodes them in 4.6, 7.1 and 10.5 percent at 160 MHz. The CRC-32 of every encoded frame and decoded block equals the Mac build in all three configurations.
  • With the float unit off the same core needs 120 to 262 percent of real time to encode. README notes

Other boards

What the status words mean

Works ran here and did what it shouldCould work some of it ran; real porting effort is left; hover for whatNot for this chip the chip or its vendor software cannot; hover for why

Opus voice and music on the LP-MSPM33C321A

Expected result: The board encodes and decodes Opus voice and music frames with every checksum equal to the Mac's.

What this shows

  • CELT at 48 kHz encodes in 29 to 54 percent and decodes in 17 to 22 percent of real time at 160 MHz; SILK decodes in 5 percent.
  • The fixed-point build is bit-exact against the Mac in 12 of 12 runs.
What this does not establish, and limits

What this does not establish

  • Mono, constant bit rate, a generated signal; no radio and no sound output.
  • The SILK encoder keeps up only at complexity 0 (56 percent); at complexity 5 it needs 2.5 times the core.

Limits to keep in mind

  • Flash is 331.4 kB at -O2 and 164.7 kB at -Os.
  • A Mac build with its default 64-bit multiply macros differs from CELT complexity 5 and up.

Sources

Versions, sizes and timing

CELT 48 kHz 10 ms, complexity 5858k cycles to encode, 358,367 to decodeREADME notes
SILK 16 kHz 20 ms, complexity 01.79M cycles to encode, 155,615 to decodeREADME notes

Evidence

  • libopus 1.5.2 fixed-point builds encode and decode SILK 16 kHz and CELT 48 and 16 kHz frames; packets and decoded samples equal a Mac build with the same multiply macros in 12 of 12 runs at three optimization levels.
  • The floating-point image runs but its decoded samples equal the Mac in 2 of 12 runs, and it is slower in all 12. README notes

Other boards

What the status words mean

Works ran here and did what it shouldCould work some of it ran; real porting effort is left; hover for whatNot for this chip the chip or its vendor software cannot; hover for why

MP3 decoding (minimp3) on two LaunchPad kits

Expected result: Both boards decode the clip with every frame checksum equal to the Mac's; the M33 keeps up in real time and the M0+ does not.

What this shows

  • A Cortex-M33 at 160 MHz decodes stereo MP3 in 15 percent of real time with the hardware float unit.
  • The Cortex-M0+ at 80 MHz, with no float unit, needs about 787 MHz to keep up with stereo.
What this does not establish, and limits

What this does not establish

  • Decode only: no audio is played.
  • minimp3 has no fixed-point path, so there is no fixed-point row.

Limits to keep in mind

  • The M0+ image is 150.3 kB of flash and 34.1 kB of static RAM plus a 32 kB stack.
  • The M0+ timer is SysTick plus an overflow count; a bare SysTick read would understate each frame.

Sources

Versions, sizes and timing

LP-MSPM33C321A0.151 (stereo) and 0.109 (mono) times real time
LP-MSPM0G35199.84 (stereo) and 7.38 (mono) times real time

Evidence

  • minimp3 decodes a 5.07 s 128 kbps stereo clip in 0.151 times its length on the MSPM33 C321A; all 194 frame checksums equal the Mac's scalar build and the maximum sample error is 0.
  • On the MSPM0 G3519 at 80 MHz the same clip takes 9.84 times its length, again with every checksum equal.

Other boards

What the status words mean

Works ran here and did what it shouldCould work some of it ran; real porting effort is left; hover for whatNot for this chip the chip or its vendor software cannot; hover for why

Plaits synthesis (24 engines) on the LP-MSPM33C321A

Expected result: All 24 engines render with every block checksum equal to the Mac's.

What this shows

  • A full synthesizer voice costs about a quarter of the core: 23 of 24 engines stay under 37 percent of real time in every block.
  • The output is bit-exact against the Mac in all 24 engines.
What this does not establish, and limits

What this does not establish

  • Synthesis only: the sound goes to a RAM buffer, with no DAC, MIDI or listening test. The Audio BoosterPack page plays a tone and a tune through a DAC.
  • The speech engine has three blocks over real time, where the harmonics jump.

Limits to keep in mind

  • One voice and one fixed note sequence.
  • Flash is 202.2 kB at -O2. Switching to six of the engines costs one slow block, so switch while the output is muted.

Sources

Versions, sizes and timing

Block cost4.3k cycles (chiptune) to 13.8k (modal) of a 40k-cycle blockREADME notes

Evidence

  • Mutable Instruments' Plaits code renders 24 engines in 12-sample blocks at 48 kHz; the CRC-32 of every block equals the Mac build for all 24 engines. A block costs 10.7 to 34.5 percent of real time, median 26.2.
  • With the float unit off the same core needs 149 to 1,140 percent of real time. README notes

Other boards

What the status words mean

Works ran here and did what it shouldCould work some of it ran; real porting effort is left; hover for whatNot for this chip the chip or its vendor software cannot; hover for why

H.264 video decoding on two LaunchPad kits

Expected result: Each board decodes the streams with every frame checksum equal to the Mac's.

What this shows

  • Small H.264 baseline video decodes in software on both boards: 176 by 144 at 57.4 frames a second on the MSPM33 C321A and at 86.1 on the AM13E230.
  • The decoded frames equal the Mac's.
What this does not establish, and limits

What this does not establish

  • Decode only: no display, and the numbers are test-pattern streams.
  • Streams of 240 by 240 and up do not fit the AM13E230's RAM, and 320 by 240 and up do not fit the MSPM33 C321A's.

Limits to keep in mind

  • Baseline profile only. The decoder is a software decoder with no video block.

Sources

Versions, sizes and timing

LP-MSPM33C321A176 by 144 at 57.4 frames a second (-Os), 240 by 240 at 33.3; 110.9 kB of RAM for the firstthe data (CSV)
LP-AM13E230176 by 144 at 86.1, 160 by 112 at 109.9, 128 by 96 at 149.8 frames a secondthe data (CSV)

Evidence

  • h264bsd decodes a 176 by 144 baseline stream at 57.4 frames a second on the MSPM33 C321A (240 by 240 at 33.3) with the YUV and RGB CRCs equal to the Mac's. the data (CSV)
  • On the AM13E230 the 176 by 144 stream runs at 86.1 frames a second, 160 by 112 at 109.9 and 128 by 96 at 149.8. the data (CSV)

Other boards

What the status words mean

Works ran here and did what it shouldCould work some of it ran; real porting effort is left; hover for whatNot for this chip the chip or its vendor software cannot; hover for why

Result grid

Project
LP-MSPM0G3507MSPM0G3507 chip
LP-MSPM0L1306MSPM0L1306 chip
LP-EM-CC2340R5CC2340R52 chip
LAUNCHXL-F2800137TMS320F2800137 chip
Audio and video codecs on a LaunchPad
LP-MSPM0G3507
LP-MSPM0L1306
LP-EM-CC2340R5
LAUNCHXL-F2800137

Works ran here and did what it shouldShould work it builds; only naming, packaging or build glue is in the way; hover for whichCould work some of it ran; real porting effort is left; hover for whatNot for this chip the chip or its vendor software cannot; hover for why

Source files

Get the code and tell us how it wentThe clone command, the board folder with its AGENTS.md, reports from others, and the three report forms.

Get the code

Clone the repository and open the board's folder below. AGENTS.md is a plain text file of notes for AI coding assistants, and llms.txt at the root indexes the site for one.

git clone https://github.com/Fox-Red-Labs/fox-red-labs.git

Code is BSD-3-Clause, writing is CC BY 4.0; third-party folders keep their own licenses.

Built it? Tell us

Built this, or got stuck? Report it on GitHub with a few short answers. Your report shows here in your words, marked as yours. A failure that repeats on the bench gets its fix here.