Skip to content

Add RFC 2198 - #454

Open
gokuljs wants to merge 44 commits into
pion:mainfrom
gokuljs:RED
Open

gokuljs wants to merge 44 commits into
pion:mainfrom
gokuljs:RED

Conversation

@gokuljs

@gokuljs gokuljs commented Sep 6, 2026 •

Copy link
Copy Markdown

This pr adds RED (RFC 2198) support for Opus audio with sender and receiver interceptors. The sender includes copies of up to two previous audio packets, allowing the receiver to recover lost audio from later packets without retransmission. You can look at the full issue here #453

@gokuljs
gokuljs marked this pull request as draft September 6, 2026 23:52
@codecov

codecov Bot commented Sep 6, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.64269% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.55%. Comparing base (0353a58) to head (7970f33).

Files with missing lines Patch % Lines
pkg/red/receiver_stream.go 95.03% 7 Missing ⚠️
pkg/red/receiver_recovery.go 95.87% 4 Missing ⚠️
pkg/red/sender_interceptor.go 96.70% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #454      +/-   ##
==========================================
+ Coverage   86.66%   87.55%   +0.88%     
==========================================
  Files          91       98       +7     
  Lines        4154     4571     +417     
==========================================
+ Hits         3600     4002     +402     
- Misses        554      569      +15     
Flag Coverage Δ
go 87.55% <96.64%> (+0.88%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gokuljs
gokuljs marked this pull request as ready for review October 11, 2026 03:51
@gokuljs
gokuljs requested a review from JoTurk October 11, 2026 04:18

@JoTurk JoTurk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you, other than the comments i would also try to reduce the locks, how much cache we hold and try to simplify the code more.

Comment thread pkg/red/receiver_stream.go Resolved
Comment thread pkg/red/receiver_interceptor_test.go Resolved
Comment thread pkg/red/sender_interceptor.go Resolved
Comment thread pkg/red/sender_interceptor.go Resolved
Comment thread pkg/red/red.go Resolved
@gokuljs gokuljs changed the title Add RFC 2198 (Work in progress Do Not review) Add RFC 2198 Oct 11, 2026
Map redundant Opus copies through timestamp offsets and known
sequence gaps. Skip ambiguous mappings by default and allow explicit
fixed packet duration for broader recovery.
@JoTurk

JoTurk commented Nov 20, 2026

Copy link
Copy Markdown
Member

sorry for taking so long @gokuljs i was reviewing and testing, I'll push a few commits now. Thank you again!

@JoTurk

JoTurk commented Nov 20, 2026

Copy link
Copy Markdown
Member

@gokuljs I pushed a few commits please take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants