Skip to content

fix(viewer): default x86 audio fallback to ALSA 'default'#3038

Merged
vpetersson merged 1 commit into
masterfrom
fix/x86-audio-default-fallback-takeover
Jun 9, 2026
Merged

fix(viewer): default x86 audio fallback to ALSA 'default'#3038
vpetersson merged 1 commit into
masterfrom
fix/x86-audio-default-fallback-takeover

Conversation

@vpetersson

Copy link
Copy Markdown
Contributor

Supersedes #2927 (original work by @Xzzz, attribution preserved in the commit), rebased onto current master and fixed up to pass CI.

Problem

On x86, get_alsa_audio_device() returned sysdefault:CARD=HID as the fallback, which matches no real ALSA card on standard Intel/AMD/Nvidia HDA chipsets, leaving operators with no working audio.

Fix

Defer to the default device instead. This mirrors the ARM64 branch directly above, which already returns 'default' for the same reason (heterogeneous SoCs, no portable per-SoC card name).

On x86 — a Qt 6 board — VideoView::resolveAlsaDevice resolves default to the PulseAudio default sink, since Debian's Qt 6 Multimedia only has a PulseAudio backend and the daemon is started by start_viewer.sh. (This is why the rationale differs from the original PR, which predated the PulseAudio migration in #3001 and described raw ~/.asoundrc routing.)

Changes vs the original PR

  • Updated the inline comment to reflect the PulseAudio resolution path rather than raw ~/.asoundrc.
  • Updated test_hdmi_on_x86_falls_back_to_hidtest_hdmi_on_x86_uses_alsa_default, asserting 'default'. The original PR touched only media_player.py, so it would have failed this test (added later in Fix HDMI audio detection on Pi4 with dual HDMI ports #2811).

Verification

  • uv run ruff check + ruff format --check: clean
  • uv run pytest tests/test_media_player.py -m "not integration": 79 passed

🤖 Generated with Claude Code

On x86, get_alsa_audio_device() previously returned
'sysdefault:CARD=HID' as the fallback, which matches no real ALSA
card on standard Intel/AMD/Nvidia HDA chipsets, leaving operators
with no working audio.

Defer to the `default` device instead. On x86 (a Qt 6 board)
VideoView::resolveAlsaDevice resolves `default` to the PulseAudio
default sink, since Debian's Qt 6 Multimedia only has a PulseAudio
backend. This mirrors the ARM64 branch above, which already returns
'default' for the same reason.

Update the corresponding test to assert the new fallback.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vpetersson vpetersson requested a review from a team as a code owner June 9, 2026 05:52
@vpetersson vpetersson requested a review from Copilot June 9, 2026 05:52
@sonarqubecloud

sonarqubecloud Bot commented Jun 9, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adjusts the viewer’s x86 ALSA fallback device selection so audio works out-of-the-box on common Intel/AMD/Nvidia HDA setups, aligning x86 behavior with the existing ARM64 approach.

Changes:

  • Update get_alsa_audio_device() to return default (instead of sysdefault:CARD=HID) for the x86 HDMI fallback path.
  • Update/rename the corresponding unit test to assert the new x86 fallback (default) and document the PulseAudio resolution behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/anthias_viewer/media_player.py Switch x86 HDMI fallback ALSA device from a non-portable hardcoded card name to default.
tests/test_media_player.py Rename/update x86 HDMI fallback test to expect default and clarify rationale in comments.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vpetersson vpetersson merged commit fe8f054 into master Jun 9, 2026
10 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.

3 participants