Repository navigation
Send UDP media and timing to the RTSP peer's address - #74
Closed
PhilflowIO wants to merge 1 commit into
Closed
PhilflowIO wants to merge 1 commit into
PhilflowIO wants to merge 1 commit into
Conversation
The RTSP connection is dialed by hostname, and the dial follows the resolver's order, which usually puts IPv6 first for dual-stack names such as "receiver.local". Audio data, audio control and NTP timing probes re-resolved the hostname with net.ResolveUDPAddr, which prefers IPv4. The session therefore ran over IPv6 while all UDP media went to the receiver's IPv4 address. Receivers that bind their media sockets to the session's address family never see those packets. UxPlay does exactly that (IPV6_V6ONLY on an IPv6 session): video works over the TCP mirror stream, audio stays silent and timing times out. Use the remote IP (and zone) of the established RTSP connection for all UDP media and timing destinations. Fall back to the hostname when there is no connection yet or its remote address is not TCP. This mirrors how PTP setup already takes the local address from the RTSP connection (localIPForConnection). Verified against UxPlay 1.73.7 over IPv6 with `-target <name>.local`: ~2450 audio packets in 20 s (before: none), no NTP timeouts. Limits: the TCP video-data and event-channel dials still use the hostname; they follow the same address order as the RTSP dial, so they were not affected here. Devices picked via discovery use an IPv4 literal and were not affected either. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
omarroth
added a commit
that referenced
this pull request
Nov 6, 2026
Anchor UDP audio and timing plus TCP video/event sockets to the address selected by the established control connection. This preserves the IPv6 family and scope zone for dual-stack target names and prevents secondary channels from landing on another resolved address.\n\nPR #74 supplied the core UDP diagnosis and live UxPlay verification; this implementation extends the invariant to every port returned for the RTSP session.\n\nRefs #73 and #74.
Owner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #73.
What was wrong
receiver.localthe session usually runs over IPv6.net.ResolveUDPAddr, which prefers IPv4. All UDP media went to the receiver's IPv4 address.IPV6_V6ONLYon an IPv6 session): video works, audio is silent, timing times out.What this changes
(*AirPlayClient).mediaHost()returns the remote IP (with IPv6 zone) of the established RTSP connection; it falls back to the hostname when there is no connection yet or the remote address is not TCP.localIPForConnection).Testing
make test,go vet ./...,gofmt -lclean.-target <name>.localover IPv6: ~2450 audio packets in 20 s (before: none), no NTP timeouts.Limits
🤖 Generated with Claude Code