Skip to content

Use perf timer to improve RTP packet sending frequency#51

Merged
codingjoe merged 1 commit intomainfrom
pref-timer
Mar 18, 2026
Merged

Use perf timer to improve RTP packet sending frequency#51
codingjoe merged 1 commit intomainfrom
pref-timer

Conversation

@codingjoe
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings March 17, 2026 23:58
@codingjoe codingjoe self-assigned this Mar 17, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.59%. Comparing base (b9b6677) to head (9a51651).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #51      +/-   ##
==========================================
+ Coverage   94.58%   94.59%   +0.01%     
==========================================
  Files          24       24              
  Lines        1716     1721       +5     
==========================================
+ Hits         1623     1628       +5     
  Misses         93       93              

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adjusts outbound RTP audio pacing in AudioCall by switching from fixed sleeps to a perf_counter()-based interval calculation to better maintain the intended packet cadence.

Changes:

  • Add time import and a last_packet_time field on AudioCall for pacing state.
  • Change send_audio() to compute sleep time based on elapsed time since the last packet send, rather than always sleeping a fixed duration.

You can also share your feedback on Copilot code review. Take the survey.

voip/audio.py Outdated
Comment on lines +214 to +218
for payload in self.codec.packetize(audio):
await asyncio.sleep(
self.rpt_packet_duration.total_seconds()
- (time.perf_counter() - self.last_packet_time)
)
voip/audio.py Outdated
Comment on lines +215 to +218
await asyncio.sleep(
self.rpt_packet_duration.total_seconds()
- (time.perf_counter() - self.last_packet_time)
)
@codingjoe codingjoe merged commit f1d62a7 into main Mar 18, 2026
21 checks passed
@codingjoe codingjoe deleted the pref-timer branch March 18, 2026 00:10
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