communication protocol_error ai_generated partial

RTP SSRC collision detected: duplicate SSRC 0x%08X

ID: communication/rtp-ssrc-collision

Also available as: JSON · Markdown · 中文
80%Fix Rate
85%Confidence
1Evidence
2024-03-15First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
libWebRTC M120 active — — —
PJSIP 2.13.1 active — — —
FFmpeg 6.1 active — — —

Root Cause

Two RTP endpoints in the same session are using the same synchronization source identifier, causing packet misrouting.

generic

中文

同一RTP会话中的两个端点使用了相同的同步源标识符,导致数据包错误路由。

Official Documentation

https://datatracker.ietf.org/doc/html/rfc3550#section-8.2

Workarounds

  1. 85% success Implement RTCP BYE and re-invite with new random SSRC. Example in Python: import random; new_ssrc = random.randint(0, 0xFFFFFFFF); send_rtcp_bye(old_ssrc); start_rtp(new_ssrc)
    Implement RTCP BYE and re-invite with new random SSRC. Example in Python: import random; new_ssrc = random.randint(0, 0xFFFFFFFF); send_rtcp_bye(old_ssrc); start_rtp(new_ssrc)
  2. 90% success Enable SSRC collision detection and handling in your RTP stack (e.g., in PJSIP set pjsua_media_config.rtp_collision_detection=1)
    Enable SSRC collision detection and handling in your RTP stack (e.g., in PJSIP set pjsua_media_config.rtp_collision_detection=1)

中文步骤

  1. Implement RTCP BYE and re-invite with new random SSRC. Example in Python: import random; new_ssrc = random.randint(0, 0xFFFFFFFF); send_rtcp_bye(old_ssrc); start_rtp(new_ssrc)
  2. Enable SSRC collision detection and handling in your RTP stack (e.g., in PJSIP set pjsua_media_config.rtp_collision_detection=1)

Dead Ends

Common approaches that don't work:

  1. Restart all RTP streams simultaneously 60% fail

    Collision may reoccur if SSRCs are generated from the same seed or algorithm without randomization.

  2. Increase SSRC pool size or use fixed SSRCs 80% fail

    Fixed SSRCs can cause permanent collisions in multi-party calls; randomization is required by RFC 3550.