Skip to content

QOA support - #49

Merged
BasilSkyWalk merged 5 commits into
BasilSkyWalk:mainfrom
boromil:qoa-playback-upstream
Nov 11, 2026
Merged

BasilSkyWalk merged 5 commits into
BasilSkyWalk:mainfrom
boromil:qoa-playback-upstream

Conversation

@boromil

@boromil boromil commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

QOA is a small, fast lossy codec designed for simple, low-cost decoding: https://qoaformat.org/. The decoder is Dominic Szablewski's MIT-licensed reference implementation.

What it adds:

  • Detects QOA files by their qoaf magic and decodes them on core 1 in the existing FLAC/ALAC program.
  • Supports mono and stereo, exact seeking, the equalizer, queue/gapless handover and Now Playing.
  • Indexes .qoa in the library, echo-sync and the music fingerprint. QOA has no tags, so fields come from the path and duration from the header.
  • Adds simulator support and the reference decoder under third_party/qoa.
  • Splits QOA's 5,120-sample frames into 4,608-sample blocks to fit the existing stream slots.

Tests:

  • 13 codec tests covering seeking, block splitting and damaged files.
  • 32 core 1 tests, 8 simulator tests, plus library, scan, fingerprint and echo-sync coverage.
  • The QOA codec, core 1 and simulator tests pass under ASan and UBSan.
  • Basic playback tested on the player. The release image builds and passes the updater check.

Limits: mono/stereo only and no tags. Unsupported sample rates are refused like other formats.

@boromil
boromil force-pushed the qoa-playback-upstream branch from 00becde to bd7fde4 Compare November 7, 2026 19:19
Add QOA playback end to end with the reference decoder by Dominic
Szablewski (MIT, third_party/qoa) behind a small streaming adapter. The
core 1 FLAC program decodes QOA with exact seeking and the equalizer, the
simulator decodes it, and the library indexes .qoa files and reads their
duration from the header. Now Playing shows QOA.

QOA frames are split into 4,608-sample blocks so its 5,120-sample frames
fit the existing stream slots. Build the vendored decoder with -fwrapv so
its 32-bit prediction arithmetic is defined for extreme inputs. The
decoder adds about 4 KB of code and no writable data.

Also make host FAAD2 builds use the system inttypes header, which the
current macOS SDK needs, and give the device build a freestanding
stdlib.h for the vendored QOA header.
@boromil
boromil force-pushed the qoa-playback-upstream branch from bd7fde4 to 8b343f5 Compare November 10, 2026 22:23
Keeps both .m4b and .qoa in the format lists, regenerates the tags and two-drive library fixtures, and counts both new fixtures in the scan tests.
probe_header returns a TrackProbe since 0.11.1, so the bare SOURCE_QOA no longer built for the player. The rate comes from the first frame header, so core 1 sees it for the clock and equalizer checks.
@BasilSkyWalk
BasilSkyWalk merged commit 79c38c1 into BasilSkyWalk:main Nov 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants