Lab 5: Lab M05: Poll-Driven ALSA PCM Audio Engine with RIFF Parser and Q8 Gain
Implement a warning-clean C11 embedded audio engine (libalsa_engine.a) that walks variable-offset RIFF/WAVE chunk headers across odd-sized JUNK padding, applies saturating Q8 fixed-point gain without int16_t wraparound clicks, and drives poll-multiplexed alsa-lib (-lasound) playback with automatic -EPIPE XRUN recovery.
Prerequisites in this module
What ./check.sh verifies
- Builds with -std=c11 -Wall -Wextra and no warnings.
- Archives alsa_engine.o into libalsa_engine.a and links alsa_engine_cli.
- Scans variable RIFF/WAVE chunks across odd-sized JUNK padding to locate PCM data.
- Saturates Q8 fixed-point PCM gain at INT16_MAX/INT16_MIN without wraparound.
Subscribe or sign in to unlock this graded lab
Part of GL-C04 — Embedded Linux Peripherals, Display & Audio. Full access includes all 16 KSA Terminal courses across GL-C01..GL-C04, GL-E00..GL-E07 & GL-Q01..GL-Q04 (288 lessons, 96 TAP 13 graded labs, real Linux 6.12, C11 & C++20/Qt 6 captures, slide decks, printable PDF/HTML handbooks, and flashcards).
Annual All-AccessUS$349/yrsave 25% · 3 months free
Monthly All-AccessUS$39/moCancel any time · All 16 courses
Team (3+ seats)US$290/seat/yrCard or Net-30 PO invoice
Progress is saved on this device.