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
+57 -29
View File
@@ -830,6 +830,22 @@ func (r *RTPStats) SetRtcpSenderReportData(srData *RTCPSenderReportData) {
"highestTS", r.highestTS, "highestTS", r.highestTS,
"highestTime", r.highestTime.String(), "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,21 +881,19 @@ func (r *RTPStats) GetExpectedRTPTimestamp(at time.Time) (uint32, uint64, error)
if r.srNewest != nil { if r.srNewest != nil {
minTS = r.srNewest.RTPTimestampExt minTS = r.srNewest.RTPTimestampExt
} }
/* r.logger.Debugw(
r.logger.Debugw( "expected RTP timestamp",
"expected RTP timestamp", "firstTime", r.firstTime.String(),
"firstTime", r.firstTime.String(), "checkAt", at.String(),
"checkAt", at.String(), "timeDiff", timeDiff,
"timeDiff", timeDiff, "firstRTP", r.extStartTS,
"firstRTP", r.extStartTS, "expectedRTPDiff", expectedRTPDiff,
"expectedRTPDiff", expectedRTPDiff, "expectedExtRTP", expectedExtRTP,
"expectedExtRTP", expectedExtRTP, "expectedRTP", uint32(expectedExtRTP),
"expectedRTP", uint32(expectedExtRTP), "minTS", minTS,
"minTS", minTS, "highestTS", r.highestTS,
"highestTS", r.highestTS, "highestTime", r.highestTime.String(),
"highestTime", r.highestTime.String(), )
)
*/
return uint32(expectedExtRTP), minTS, nil return uint32(expectedExtRTP), minTS, nil
} }
@@ -971,6 +985,22 @@ func (r *RTPStats) GetRtcpSenderReport(ssrc uint32, srFirst *RTCPSenderReportDat
"highestTS", r.highestTS, "highestTS", r.highestTS,
"highestTime", r.highestTime.String(), "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{ return &rtcp.SenderReport{
@@ -1985,20 +2015,18 @@ func (p *PIDController) Update(setpoint, measurement float64, at time.Time) floa
p.prevError = errorTerm p.prevError = errorTerm
p.prevMeasurement = measurement p.prevMeasurement = measurement
p.prevMeasurementTime = at p.prevMeasurementTime = at
/* p.logger.Debugw(
p.logger.Debugw( "pid controller",
"pid controller", "setpoint", setpoint,
"setpoint", setpoint, "measurement", measurement,
"measurement", measurement, "errorTerm", errorTerm,
"errorTerm", errorTerm, "proportional", proportional,
"proportional", proportional, "integral", iVal,
"integral", iVal, "integralLimited", boundIVal,
"integralLimited", boundIVal, "derivative", p.dVal,
"derivative", p.dVal, "output", output,
"output", output, "outputLimited", boundOutput,
"outputLimited", boundOutput, )
)
*/
return boundOutput return boundOutput
} }