Commit ffb9989
authored
WebRTCGetStartedVP8Net: add per-second source + RTCP packet-count diagnostics (#1581)
Adds two unconditional packet counters to the example so we can
distinguish sender-side audio failure from receiver-side drop the
next time audio cuts out mid-session.
Background
----------
Audio loss has been observed in this example after some seconds of
streaming. chrome://webrtc-internals confirms packetsLost = 0 on both
streams and iceState = connected at failure time, with video
continuing to flow normally on the same transport while audio's
bytesReceived/s drops to 0. From the receiver's vantage point we
can't tell whether:
(a) The .NET sender stopped emitting audio packets (encoder/timer
stuck, or pc.SendAudio failing silently); or
(b) Packets are leaving the sender but Chrome is dropping them
pre-stats — suspected SRTP / DTLS auth issue, which doesn't
manifest as packetsLost or bytesReceived because failed-auth
packets are discarded before being counted.
The previous music-source-EOF hypothesis is ruled out: the embedded
Macroform_-_Simplicity.raw is 200.6 s of music and the observed
audio cut-off is at ~166 s with 35+ s of audio remaining in the
file.
Diagnostics added
-----------------
1. "src" counter on the source-side encoded-sample events:
OnVideoSourceEncodedSample += { send + Interlocked.Increment }
OnAudioSourceEncodedSample += { send + Interlocked.Increment }
Logged once per second of source rate (every 15 video frames /
every 50 audio packets). If this counter freezes at the moment
audio dies, the source itself stopped producing.
2. "rtcp" counter from outgoing RTCP Sender Reports, hooked via
pc.OnSendReport. SIPSorcery emits SRs every ~5 s by default and
PacketCount is the cumulative count of RTP packets the local
send path has actually emitted on each stream. If "src" keeps
incrementing past audio-loss but "rtcp" PacketCount on the
audio SSRC stalls (or grows much slower than "src"), packets
are being silently dropped between the source-side event and
the wire — for example by SRTP encryption returning an error
that pc.SendAudio swallows. If "src" stalls, the source itself
is the issue.
Comparing the audio rtcp PacketCount with Chrome's inbound-rtp
packetsReceived for the same SSRC then tells us whether the
remaining packets are leaving .NET but failing in transit / at
Chrome (PacketCount > packetsReceived) or whether SIPSorcery
itself stopped sending (PacketCount = packetsReceived, both
stop together).
No bitstream or timing changes; pure observability addition. The
example's existing Q=96/15fps configuration is unchanged.
Author attribution: Claude Opus 4.7 (model: claude-opus-4-7),
commissioned by Aaron Clauson — per the convention from #1562.1 parent 2317140 commit ffb9989
1 file changed
Lines changed: 52 additions & 2 deletions
Lines changed: 52 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
133 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
134 | 184 | | |
135 | 185 | | |
136 | 186 | | |
| |||
0 commit comments