Skip to content

Fix HLS audio: auto-detect device instead of hardcoded name#8

Open
LeeOtts wants to merge 1 commit intomainfrom
claude/amazing-raman
Open

Fix HLS audio: auto-detect device instead of hardcoded name#8
LeeOtts wants to merge 1 commit intomainfrom
claude/amazing-raman

Conversation

@LeeOtts
Copy link
Copy Markdown
Owner

@LeeOtts LeeOtts commented Apr 12, 2026

Summary

  • Bug: Enabling HLS_AUDIO=true caused ffmpeg to crash-loop because the ALSA device was hardcoded to plughw:CARD=Camera — if the Pi's USB mic has a different card name, ffmpeg fails immediately
  • Fix: Added auto-detection via arecord -l (mirroring the existing logic in recorder.py) and device validation before launching ffmpeg
  • Graceful fallback: If the audio device can't be opened, the stream continues video-only with a warning instead of crashing

Test plan

  • Pull on Pi, set HLS_AUDIO=true in .env, restart HLS service
  • Check journalctl -u hummingbird-hls -f for device detection logs
  • Verify stream stays up (no crash loop)
  • Test with explicit AUDIO_DEVICE=plughw:CARD=Camera to confirm override works

🤖 Generated with Claude Code

…mera

The audio device name was hardcoded, causing ffmpeg to crash in a loop
when the Pi's USB camera mic had a different ALSA card name. Now
auto-detects via arecord -l (mirroring recorder.py) and validates the
device before use, falling back to video-only if inaccessible.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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