Repository navigation
Audio RTP on the data channel peer (Opus, BUNDLE) - #17
Merged
Merged
Conversation
accept() takes { audio: { fmtp?, send: [{ ssrc, mid?, streamId?, trackId? }] } }
and answers the offer's Opus audio m-lines on the same peer, port and DTLS
session as the data channels, at the payload type the browser offered and
with our fmtp. Browser sendonly m-lines are received (rtp events with the
decrypted RTP and its mid); each send slot takes a browser recvonly m-line
and puts its SSRC, cname and msid in the answer. sendRtp() SRTP-encrypts a
finished packet and sends it at once, outside the gate, pacer and egress
cap. rtpopen fires per audio mid once DTLS-SRTP is up. rtc handles SRTCP
and sender/receiver reports; RTCP never reaches JS. stats() gains audio
bytes and packets in/out.
Without the option, audio m-lines are rejected as before. The rtc bump
also fixes that case: candidates landed on the first (rejected) m-line,
so an offer with leading audio m-lines never connected.
Tested end to end against headless Chromium, Firefox and WebKit.
…rowsers elsewhere The test job installs Chromium, Firefox and WebKit and sets LAGLESS_REQUIRE_BROWSERS=1 so a launch failure fails the run. Other platforms skip browsers Playwright doesn't have.
stasadance
force-pushed
the
audio-rtp
branch
from
November 24, 2026 05:08
26004c8 to
b33c176
Compare
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.
Server-side voice forwarding (SFU, no encoding) on the same peer, port and DTLS session as the data channels.
API
a=ssrc:<ssrc> cname:<streamId>,msid:<streamId> <trackId>). Recvonly m-lines without a slot are answered inactive.audio, audio m-lines are rejected (port 0), same as before.rtc bump (stasadance/rtc
lagless, 9e4c4bf -> ad5eeb0)add_track_to_transceiver: an answerer'sadd_trackalways grabs the first free audio m-line, which is the mic.audiooption (Chrome puts the application m-line last) got its candidates on rejected mid 0 and never connected. Germs hit this on main.Tests
test/audio.test.mts, against headless Chromium, Firefox and WebKit. Shape: mic + 4 slots + 2 DCs. Mic RTP goes in, gets echoed to slot 0 with the slot's SSRC/PT, and the browser's inbound-rtp count on slot 0 is checked; other slots get nothing and the DCs work on the same peer. A second case sends the same offer withoutaudioand checks that it connects.LAGLESS_REQUIRE_BROWSERS=1. Elsewhere, browsers that aren't installed are skipped.