Skip to content

Commit

Permalink
feat(statistics) remove AudioOutputProblemDetector
Browse files Browse the repository at this point in the history
It has been broken for over 3 years now, since ca325f5#diff-9e19da30f465ca5665ac3d7ca1aa03d0498aed1be0cb2d7eeb27684a2636da77

Ever since that change, the "audioLevelReportHistory" property is not
populated, so it justs acts on nothing an generates bogus log lines such
as:

```
[modules/statistics/AudioOutputProblemDetector.js] A potential problem is detected with the audio output for participant b5fb30bc, local audio levels: [null,null], remote audio levels: undefined
```

Since nobody seems to have noticed in 3 years it's safe to assume we
don't need this at all, so it gets the axe treatment.
  • Loading branch information
saghul committed Aug 8, 2024
1 parent 03eef6d commit da1d068
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 211 deletions.
14 changes: 0 additions & 14 deletions JitsiConference.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import { LiteModeContext } from './modules/litemode/LiteModeContext';
import { QualityController } from './modules/qualitycontrol/QualityController';
import RecordingManager from './modules/recording/RecordingManager';
import Settings from './modules/settings/Settings';
import AudioOutputProblemDetector from './modules/statistics/AudioOutputProblemDetector';
import AvgRTPStatsReporter from './modules/statistics/AvgRTPStatsReporter';
import LocalStatsCollector from './modules/statistics/LocalStatsCollector';
import SpeakerStatsCollector from './modules/statistics/SpeakerStatsCollector';
Expand Down Expand Up @@ -221,14 +220,6 @@ export default function JitsiConference(options) {
this.avgRtpStatsReporter
= new AvgRTPStatsReporter(this, options.config.avgRtpStatsN || 15);

/**
* Detects issues with the audio of remote participants.
* @type {AudioOutputProblemDetector}
*/
if (!options.config.disableAudioLevels) {
this._audioOutputProblemDetector = new AudioOutputProblemDetector(this);
}

/**
* Indicates whether the connection is interrupted or not.
*/
Expand Down Expand Up @@ -649,11 +640,6 @@ JitsiConference.prototype.leave = async function(reason) {
this.avgRtpStatsReporter = null;
}

if (this._audioOutputProblemDetector) {
this._audioOutputProblemDetector.dispose();
this._audioOutputProblemDetector = null;
}

if (this.e2eping) {
this.e2eping.stop();
this.e2eping = null;
Expand Down
6 changes: 2 additions & 4 deletions modules/connectivity/ConnectionQuality.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,7 @@ export default class ConnectionQuality {
connectionQuality: this._localStats.connectionQuality,
jvbRTT: this._localStats.jvbRTT,
serverRegion: this._localStats.serverRegion,
maxEnabledResolution: this._localStats.maxEnabledResolution,
avgAudioLevels: this._localStats.localAvgAudioLevels
maxEnabledResolution: this._localStats.maxEnabledResolution
};

try {
Expand Down Expand Up @@ -450,8 +449,7 @@ export default class ConnectionQuality {
connectionQuality: data.connectionQuality,
jvbRTT: data.jvbRTT,
serverRegion: data.serverRegion,
maxEnabledResolution: data.maxEnabledResolution,
avgAudioLevels: data.avgAudioLevels
maxEnabledResolution: data.maxEnabledResolution
};

this.eventEmitter.emit(
Expand Down
160 changes: 0 additions & 160 deletions modules/statistics/AudioOutputProblemDetector.js

This file was deleted.

28 changes: 1 addition & 27 deletions modules/statistics/RTPStatsCollector.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ export default function StatsCollector(peerconnection, audioLevelsInterval, stat
this.peerconnection = peerconnection;
this.currentStatsReport = null;
this.previousStatsReport = null;
this.audioLevelReportHistory = {};
this.audioLevelsIntervalId = null;
this.eventEmitter = eventEmitter;
this.conferenceStats = new ConferenceStats();
Expand Down Expand Up @@ -385,29 +384,6 @@ StatsCollector.prototype._processAndEmitReport = function() {
calculatePacketLoss(lostPackets.upload, totalPackets.upload)
};

const avgAudioLevels = {};
let localAvgAudioLevels;

Object.keys(this.audioLevelReportHistory).forEach(ssrc => {
const { data, isLocal } = this.audioLevelReportHistory[ssrc];
const avgAudioLevel = data.reduce((sum, currentValue) => sum + currentValue) / data.length;

if (isLocal) {
localAvgAudioLevels = avgAudioLevel;
} else {
const track = this.peerconnection.getTrackBySSRC(Number(ssrc));

if (track) {
const participantId = track.getParticipantId();

if (participantId) {
avgAudioLevels[participantId] = avgAudioLevel;
}
}
}
});
this.audioLevelReportHistory = {};

this.eventEmitter.emit(
StatisticsEvents.CONNECTION_STATS,
this.peerconnection,
Expand All @@ -418,9 +394,7 @@ StatsCollector.prototype._processAndEmitReport = function() {
resolution: resolutions,
framerate: framerates,
codec: codecs,
transport: this.conferenceStats.transport,
localAvgAudioLevels,
avgAudioLevels
transport: this.conferenceStats.transport
});
this.conferenceStats.transport = [];
};
Expand Down

This file was deleted.

0 comments on commit da1d068

Please sign in to comment.