Enable some debug logs to debug freeze (#1761)

* Enable some debug logs to debug freeze

* log receiver sender report also
This commit is contained in:
Raja Subramanian
2023-06-02 16:31:19 +05:30
committed by GitHub
parent b5c8fe5294
commit c2ae34151c
+32 -4
View File
@@ -830,6 +830,22 @@ func (r *RTPStats) SetRtcpSenderReportData(srData *RTCPSenderReportData) {
"highestTS", r.highestTS,
"highestTime", r.highestTime.String(),
)
} else {
packetDriftResult, reportDriftResult := r.getDrift()
r.logger.Debugw(
"received sender report",
"ntp", srData.NTPTimestamp.Time().String(),
"rtp", srData.RTPTimestamp,
"arrival", srData.At.String(),
"ntpDiffSinceLast", ntpDiffSinceLast.Seconds(),
"rtpDiffSinceLast", int32(rtpDiffSinceLast),
"arrivalDiffSinceLast", arrivalDiffSinceLast.Seconds(),
"expectedTimeDiffSinceLast", expectedTimeDiffSinceLast,
"packetDrift", packetDriftResult.String(),
"reportDrift", reportDriftResult.String(),
"highestTS", r.highestTS,
"highestTime", r.highestTime.String(),
)
}
}
@@ -865,7 +881,6 @@ func (r *RTPStats) GetExpectedRTPTimestamp(at time.Time) (uint32, uint64, error)
if r.srNewest != nil {
minTS = r.srNewest.RTPTimestampExt
}
/*
r.logger.Debugw(
"expected RTP timestamp",
"firstTime", r.firstTime.String(),
@@ -879,7 +894,6 @@ func (r *RTPStats) GetExpectedRTPTimestamp(at time.Time) (uint32, uint64, error)
"highestTS", r.highestTS,
"highestTime", r.highestTime.String(),
)
*/
return uint32(expectedExtRTP), minTS, nil
}
@@ -971,6 +985,22 @@ func (r *RTPStats) GetRtcpSenderReport(ssrc uint32, srFirst *RTCPSenderReportDat
"highestTS", r.highestTS,
"highestTime", r.highestTime.String(),
)
} else {
packetDriftResult, reportDriftResult := r.getDrift()
r.logger.Debugw(
"sending sender report",
"ntp", nowNTP.Time().String(),
"rtp", nowRTP,
"departure", now.String(),
"ntpDiffSinceLast", ntpDiffSinceLast.Seconds(),
"rtpDiffSinceLast", int32(rtpDiffSinceLast),
"departureDiffSinceLast", departureDiffSinceLast.Seconds(),
"expectedTimeDiffSinceLast", expectedTimeDiffSinceLast,
"packetDrift", packetDriftResult.String(),
"reportDrift", reportDriftResult.String(),
"highestTS", r.highestTS,
"highestTime", r.highestTime.String(),
)
}
return &rtcp.SenderReport{
@@ -1985,7 +2015,6 @@ func (p *PIDController) Update(setpoint, measurement float64, at time.Time) floa
p.prevError = errorTerm
p.prevMeasurement = measurement
p.prevMeasurementTime = at
/*
p.logger.Debugw(
"pid controller",
"setpoint", setpoint,
@@ -1998,7 +2027,6 @@ func (p *PIDController) Update(setpoint, measurement float64, at time.Time) floa
"output", output,
"outputLimited", boundOutput,
)
*/
return boundOutput
}