Skip to content

audio: cadence: support RAW AAC decoding and support for DIF and MPEG-2 ADTS with IPC4 - #11451

Merged
lgirdwood merged 2 commits into
thesofproject:mainfrom
ujfalusi:peter/pr/compress-aac-raw
Nov 13, 2026
Merged

lgirdwood merged 2 commits into
thesofproject:mainfrom
ujfalusi:peter/pr/compress-aac-raw

Conversation

@ujfalusi

Copy link
Copy Markdown
Contributor

Accept RAW AAC alongside MPEG-4 ADTS and select the Cadence bitstream format explicitly. Configure the external sample rate and stereo output selection from the codec parameters for RAW input.

During drain, the host can supply zero-filled padding after the last AAC payload. Passing this padding to the RAW decoder causes a fatal error before the existing EOS detection can run. Supply zero input bytes for all-zero RAW AAC buffers when EOS is expected, allowing the decoder to flush its remaining output and complete drain.

Validated with a signed PTL build and mocked EOS regression tests. DUT testing confirmed AAC LC M4A playback at 24 kHz mono and 48 kHz stereo, with drain completion verified for the 24 kHz mono stream.

Copilot AI balanced review requested due to automatic review settings November 12, 2026 16:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

RAW AAC initialization and drain correctness depend on Cadence runtime behavior unavailable in this snapshot, requiring broader DUT validation of short/empty streams, partial blocks, repeated flushes, stereo, and IPC4/library input-size mismatches.

No open issues 🎉

What changed in this PR

Adds RAW AAC decoding to the IPC4 Cadence adapter alongside existing MPEG-4 ADTS support, including handling for zero-filled padding during drain.

Changes:

  • Selects the Cadence bitstream format explicitly for RAW or ADTS input.
  • Configures RAW input’s external sample rate and stereo output from codec parameters.
  • Submits zero input bytes for all-zero RAW AAC buffers when end-of-stream is expected.
File Description
src/​audio/​module_adapter/​module/​cadence_ipc4.c Adds RAW AAC configuration and drain-padding detection.

Review effort: Balanced

@intel-sofci

intel-sofci commented Nov 12, 2026 •

Copy link
Copy Markdown

PR 11451: test results

Run date: 2026-11-13 09:14 UTC

Tested commit: 7d2818df6343427405ab8a20a5931d9dadef20e5

mtl pass rate lnl pass rate ptl pass rate wcl pass rate nvl pass rate

@ujfalusi
ujfalusi force-pushed the peter/pr/compress-aac-raw branch from 7d2818d to d61093c Compare November 13, 2026 06:50
Accept RAW AAC alongside MPEG-4 ADTS and select the Cadence bitstream
format explicitly. Configure the external sample rate and stereo output
selection from the codec parameters for RAW input.

During drain, the host can supply zero-filled padding after the last AAC
payload. Passing this padding to the RAW decoder causes a fatal error
before the existing EOS detection can run. Supply zero input bytes for
all-zero RAW AAC buffers when EOS is expected, allowing the decoder to
flush its remaining output and complete drain.

Validated with a signed PTL build and mocked EOS regression tests.
DUT testing confirmed AAC LC M4A playback at 24 kHz mono and 48 kHz
stereo, with drain completion verified for the 24 kHz mono stream.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Map ADIF to the Cadence AAC ADIF bitstream mode and accept MPEG-2
ADTS using the ADTS parser. The decoder parses the MPEG ID from the
ADTS stream; MPEG_ID and ORIGINAL_OR_COPY are decoder-reported values,
not configuration parameters.
@ujfalusi ujfalusi changed the title audio: cadence: support RAW AAC decoding with IPC4 audio: cadence: support RAW AAC decoding and support for DIF and MPEG-2 ADTS with IPC4 Nov 13, 2026

@kv2019i kv2019i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on Intel PTL system using fcplay from https://github.com/ujfalusi/tinycompress/commits/peter/wip/

@lgirdwood
lgirdwood merged commit 704f79e into thesofproject:main Nov 13, 2026
45 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.

5 participants