RTCOutboundRtpStreamStats.nackCount is always 0 for audio
Categories
(Core :: WebRTC: Networking, defect, P2)
Tracking
()
People
(Reporter: deadbeef, Assigned: bwc)
References
(Regression)
Details
(Keywords: regression)
Steps to reproduce
Create a bidirectional WebRTC peer connection and simulate packet loss (for example with mac network link conditioner) and observe nackCount in about:webrtc
Actual results
Remains at 0.
Expected results
Should increment as NACKs are received.
Before upstream libwebrtc supported NACK stats on AudioSendStream::Stats, Mozilla added a local patch (RtcpCounterObserver in third_party/libwebrtc/audio/channel_send.cc and rtcp_packet_type_counts on CallSendStatistics / AudioSendStream::Stats) so that RTCRtpSender::GetStatsInternal (dom/media/webrtc/jsapi/RTCRtpSender.cpp) could populate outbound-rtp.nackCount for audio:
local.mNackCount.Construct(
audioStats->rtcp_packet_type_counts.nack_packets);
Upstream libwebrtc later added audio NACK tracking directly to ChannelSend (making ChannelSend itself inherit from RtcpPacketTypeCounterObserver) and exposed nacks_received on CallSendStatistics / AudioSendStream::Stats.
When that upstream change was merged into Firefox's ChannelSend::ChannelSend constructor (third_party/libwebrtc/audio/channel_send.cc, lines 549–557), both observer assignments were kept on configuration.rtcp_packet_type_counter_observer:
configuration.rtcp_packet_type_counter_observer =
rtcp_counter_observer_.get();
if (env_.field_trials().IsDisabled("WebRTC-DisableRtxRateLimiter")) {
configuration.retransmission_rate_limiter =
retransmission_rate_limiter_.get();
}
configuration.extmap_allow_mixed = extmap_allow_mixed;
configuration.rtcp_report_interval_ms = rtcp_report_interval_ms;
configuration.rtcp_packet_type_counter_observer = this;
Because = this overwrites = rtcp_counter_observer_.get(), RTCPReceiver only notifies ChannelSend::RtcpPacketTypesCounterUpdated (populating audioStats->nacks_received) and never updates rtcp_counter_observer_. As a result, audioStats->rtcp_packet_type_counts.nack_packets is permanently 0, so outbound-rtp.nackCount for audio is always 0 in getStats().
Suggested Fix:
Since audioStats->rtcp_packet_type_counts is only used for .nack_packets in RTCRtpSender.cpp, Firefox can switch RTCRtpSender.cpp to read upstream's audioStats->nacks_received:
local.mNackCount.Construct(audioStats->nacks_received);
and drop the custom RtcpCounterObserver / rtcp_packet_type_counts patch in third_party/libwebrtc.
| Reporter | ||
Updated•28 days ago
|
| Reporter | ||
Updated•28 days ago
|
Comment 1•20 days ago
|
||
The severity field is not set for this bug.
:bwc, could you have a look please?
For more information, please visit BugBot documentation.
| Assignee | ||
Updated•20 days ago
|
| Assignee | ||
Comment 2•20 days ago
|
||
Let's fix this once we're done with the 158 update.
| Assignee | ||
Updated•20 days ago
|
Comment 3•9 days ago
|
||
That = this is from https://hg-edge.mozilla.org/mozilla-central/rev/69bb056d6106b8706294919fb3820c01713f653f#l5.115.
Description
•