Skip to content

Add nicer names for HDMI audio outputs - #225

Open
lawik wants to merge 2 commits into
bbangert:mainfrom
lawik:hdmi
Open

lawik wants to merge 2 commits into
bbangert:mainfrom
lawik:hdmi

Conversation

@lawik

@lawik lawik commented Oct 25, 2026

Copy link
Copy Markdown

No description provided.

lawik and others added 2 commits October 25, 2026 21:16
Wake the AV receiver (or TV) on the far end of a Pi's HDMI link and switch
it to our input before Sendspin audio hits the HDMI output, instead of
failing to open the vc4-hdmi ALSA device while the receiver is in standby.

UniversalProxy.Cec drives `cec-ctl` from v4l-utils (shipped by the
nerves_systems_universal_proxy rpi4 system >= 0.1.12) rather than a NIF:
the kernel keeps the claimed logical address as adapter state, so one
`--playback` claim at boot and short-lived one-shots for everything else
are enough.

- Cec.Enumerate: /dev/cecN adapters, paired with the HDMI ALSA card via the
  shared platform device under /sys/class/{cec,sound}/*/device.
- Cec.Server: discovery (10 s hotplug scan), claim + physical address,
  receiver power/volume/mute state from bus traffic; subscribes to the
  Sendspin state topic and fires One Touch Play (Image View On + Active
  Source) on `stream_start` for the paired HDMI output.
- Cec.Monitor: one `cec-ctl -m` per adapter, parsed into PubSub records.
- Cec.Parser: monitor stream, one-shot replies, Driver Info.
- Cec facade: one_touch_play, standby, power_status, audio_status,
  volume_up/down, mute, user_control — catch :exit idiom like the other
  optional subsystems; commands run in the caller's process.
- Supervisor returns :ignore unless `UniversalProxy.Cec` has enabled: true
  (set in config/target.exs), so host/test never spawn cec-ctl.
- mix.exs: UP_SYSTEMS_PATH switches the custom systems to path: deps on a
  local checkout, for building against a locally built system.

Tests cover the parser formats, sysfs pairing, discovery, auto-wake on
stream_start, receiver state updates, hotplug removal and the facade's
degraded behaviour, with a recording fake cec-ctl in test/support.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L3zFyNeDAeaCXyznuLUnv8
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.

1 participant