Skip to content

raop_rtp: resume mirror audio after an AirPlay video (HLS) session - #604

Draft
danieldhaiti wants to merge 1 commit into
FDH2:masterfrom
danieldhaiti:audio-resume-after-hls
Draft

danieldhaiti wants to merge 1 commit into
FDH2:masterfrom
danieldhaiti:audio-resume-after-hls

Conversation

@danieldhaiti

@danieldhaiti danieldhaiti commented Oct 13, 2026 •

Copy link
Copy Markdown

Bug. Mirror with audio, play a YouTube video (AirPlay HLS), return to mirroring: video comes back, audio stays silent until mirroring is restarted on the phone.

Cause. The AirPlay video connection stops the mirror's audio receiver and timing (raop.c). The phone keeps sending audio and returns with a mirror SETUP only, so nothing restarts them. The relaunch at the video's start also pauses the audio renderer, and only an audio SETUP starts it again; our logs show "start audio connection" (the NULL-renderer branch) at every return.

Fix (your direction). Leave raop_rtp and raop_ntp running. The relaunch at HLS start still pauses the audio renderer; the HLS-end reset (RESET_TYPE_HLS_EOS only, not the NOHOLD fall-through, so a new client still gets a fresh renderer) starts it again with the audio SETUP's codec, and the relaunch loop leaves it alone that once (keep_audio). Packets arriving into a paused renderer are dropped before the base-time check; data_len == 0 compared the pointer.

Tested. Builds on Ubuntu 26.04, no new warnings. Our appliance runs the same shape; the earlier shape (restart at the mirror SETUP) passed three YouTube-to-mirror returns live. A phone run of this exact shape is pending (no phone at hand today), so still a draft.

🤖 Generated with Claude Code

@danieldhaiti danieldhaiti changed the title raop: restart mirror audio after an AirPlay video (HLS) session raop_rtp: resume mirror audio after an AirPlay video (HLS) session Oct 13, 2026
@danieldhaiti
danieldhaiti force-pushed the audio-resume-after-hls branch from 2d48017 to be0046d Compare October 13, 2026 21:19
@fduncanh

Copy link
Copy Markdown
Collaborator

Yes I think you are right. Right now we shut down the raop_rtp audio thread and the ntp_thread when switching the video pipeline. A video shutdown was done as a simple way to cleanup the previous video window, but there really is no need to to do that for the NTP threads and the audio thread, maybe just stop the pipeline.

@fduncanh

Copy link
Copy Markdown
Collaborator

the relaunch loop in main() calls audio_renderer_stop() after an HLS session

I think this is done when the HLS starts, not stops

An AirPlay video connection stopped the mirror's audio receiver and
timing. The client streams audio through the video and returns to
mirroring with a mirror SETUP alone, so nothing restarted them and the
audio stayed silent.

Leave raop_rtp and raop_ntp running. The relaunch at the video's start
still pauses the audio renderer; the HLS end reset starts it again with
the audio SETUP's codec and the relaunch loop leaves it alone that once.
Packets arriving into a paused renderer are dropped before the base-time
check (and data_len was compared as a pointer).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@danieldhaiti
danieldhaiti force-pushed the audio-resume-after-hls branch from be0046d to 0d85d8a Compare October 14, 2026 02:33
@fduncanh

Copy link
Copy Markdown
Collaborator

I need to understand better what you want to do.

Just give a precise recipe to demonstrate what you think is the issue. as in "do this, then do that, then do this: what I want to happen is...., what actually happens is .... "

@fduncanh
fduncanh force-pushed the master branch 6 times, most recently from a0da077 to 517cbb1 Compare October 22, 2026 21:13
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.

2 participants