ReviewOS

home-lang/home-os

HDMI audio output on BCM2712 (HDMI block audio interface + DMA): PCM 2.0/5.1 at 48 kHz, audio infoframe, sample-rate/clock config — HIL gate `hdmi-audio-tone`

#79
Open chris opened this 9 days ago ·
9 days ago

Epic: #113 · Milestone: MC5 — Audio

Why

The Pi 5 has no analog jack; TV audio goes over HDMI (or I2S/USB DACs). The only audio driver in the tree is AC97/Intel HDA over x86 PCI (drivers/audio.home, 817 lines) — useless here. rpi/rp1_hdmi.home sketches HDMI_AUDIO_* registers (and mis-locates the HDMI block in RP1). On Pi hardware the HDMI encoder consumes audio samples from a DMA-fed interface (Linux calls it MAI); channel status, N/CTS for the audio clock, and the audio infoframe must be programmed per sample rate.

Tasks

  • Spike alongside #74: dump the HDMI audio and DMA register state left by the firmware after hdmi_drive=2; document in docs/hardware/BCM2712_DISPLAY.md.
  • platform/bcm2712/hdmi_audio.home: audio clock (N/CTS for 48 kHz at the active pixel clock), channel map (stereo, 5.1 PCM), IEC60958 channel status, audio infoframe, DMA ring with period interrupts, underrun detection.
  • Audio backend interface (drivers/sound.home rewritten): open(rate, channels, fmt), write(frames), delay() for A/V sync; backends: HDMI (Pi), I2S (#80), Intel HDA/AC97 (x86 QEMU for CI with -device intel-hda -device hda-duplex), null.
  • tone shell command (1 kHz sine 3 s); HIL gate records via the capture dongle and asserts a 1 kHz peak in an FFT (host-side script, may use the Home stdlib audio FFT).
  • Bitstream passthrough (AC3/DTS/E-AC3 over IEC61937) as a later task in #81.

Acceptance

hdmi-audio-tone gate passes on the rig for 48 kHz stereo; 5.1 PCM plays with correct channel mapping (per-channel tone test).

Size: L · Depends on: #74 · Blocks: #81, #85

Sign in to comment on this issue.