Skip to content

Commit c0c03c5

Browse files
authored
fix(meetings): checking audio level from RTP header before emitting DECODE_RESULTS_IN_ZERO_AUDIO_LEVEL (#4550)
1 parent 035a897 commit c0c03c5

File tree

10 files changed

+192
-141
lines changed

10 files changed

+192
-141
lines changed

packages/@webex/media-helpers/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
"deploy:npm": "yarn npm publish"
2323
},
2424
"dependencies": {
25-
"@webex/internal-media-core": "2.20.0",
25+
"@webex/internal-media-core": "2.20.1",
2626
"@webex/ts-events": "^1.1.0",
27-
"@webex/web-media-effects": "2.27.1"
27+
"@webex/web-media-effects": "2.32.1"
2828
},
2929
"browserify": {
3030
"transform": [

packages/@webex/media-helpers/src/webrtc-core.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ export {
2929
RemoteStreamEventNames,
3030
type VideoContentHint,
3131
type StreamState,
32+
type InboundAudioIssueEvent,
33+
InboundAudioIssueSubTypes,
3234
} from '@webex/internal-media-core';
3335

3436
export type ServerMuteReason =

packages/@webex/plugin-meetings/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"dependencies": {
6363
"@webex/common": "workspace:*",
6464
"@webex/event-dictionary-ts": "^1.0.1930",
65-
"@webex/internal-media-core": "2.20.0",
65+
"@webex/internal-media-core": "2.20.1",
6666
"@webex/internal-plugin-conversation": "workspace:*",
6767
"@webex/internal-plugin-device": "workspace:*",
6868
"@webex/internal-plugin-llm": "workspace:*",
@@ -75,7 +75,7 @@
7575
"@webex/plugin-people": "workspace:*",
7676
"@webex/plugin-rooms": "workspace:*",
7777
"@webex/ts-sdp": "^1.8.1",
78-
"@webex/web-capabilities": "^1.6.0",
78+
"@webex/web-capabilities": "^1.7.1",
7979
"@webex/webex-core": "workspace:*",
8080
"ampersand-collection": "^2.0.2",
8181
"bowser": "^2.11.0",

packages/@webex/plugin-meetings/src/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ export const EVENT_TRIGGERS = {
347347
MEETING_SELF_LEFT: 'meeting:self:left',
348348
NETWORK_QUALITY: 'network:quality',
349349
MEDIA_NEGOTIATED: 'media:negotiated',
350-
MEDIA_INBOUND_AUDIO_ISSUE_DETECTED: 'media:inboundAudio:issueDetected',
350+
MEDIA_INBOUND_AUDIO_ISSUE_DETECTED: 'media:inboundAudio:issueDetected', // event.data: InboundAudioIssueEvent
351351
// the following events apply only to multistream media connections
352352
ACTIVE_SPEAKER_CHANGED: 'media:activeSpeakerChanged',
353353
REMOTE_VIDEO_SOURCE_COUNT_CHANGED: 'media:remoteVideoSourceCountChanged',

packages/@webex/plugin-meetings/src/media/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,12 @@ Media.createMediaConnection = (
194194
config.stopIceGatheringAfterFirstRelayCandidate = stopIceGatheringAfterFirstRelayCandidate;
195195
}
196196

197+
if (BrowserInfo.isEdge() || BrowserInfo.isChrome()) {
198+
// we need this for getting inbound audio metadata
199+
// but the audioLevel that we use is only available on Chromium based browsers
200+
config.enableInboundAudioLevelMonitoring = true;
201+
}
202+
197203
return new MultistreamRoapMediaConnection(
198204
config,
199205
meetingId,

packages/@webex/plugin-meetings/src/meeting/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import {
3030
NetworkQualityMonitor,
3131
StatsMonitor,
3232
StatsMonitorEventNames,
33+
InboundAudioIssueSubTypes,
3334
} from '@webex/internal-media-core';
3435

3536
import {

packages/@webex/plugin-meetings/test/unit/spec/media/index.ts

Lines changed: 140 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,12 @@ describe('createMediaConnection', () => {
141141
const roapMediaConnectionConstructorStub = sinon
142142
.stub(InternalMediaCoreModule, 'RoapMediaConnection')
143143
.returns(fakeRoapMediaConnection);
144-
144+
145145
StaticConfig.set({bandwidth: {audio: 123, video: 456, startBitrate: 999}});
146-
146+
147147
const ENABLE_EXTMAP = false;
148148
const ENABLE_RTX = true;
149-
149+
150150
Media.createMediaConnection(false, 'sendonly-debug-id', 'meetingId', {
151151
mediaProperties: {
152152
mediaDirection: {
@@ -168,7 +168,7 @@ describe('createMediaConnection', () => {
168168
turnServerInfo: undefined,
169169
iceCandidatesTimeout: undefined,
170170
});
171-
171+
172172
assert.calledWith(
173173
roapMediaConnectionConstructorStub,
174174
sinon.match.any,
@@ -194,12 +194,12 @@ describe('createMediaConnection', () => {
194194
const roapMediaConnectionConstructorStub = sinon
195195
.stub(InternalMediaCoreModule, 'RoapMediaConnection')
196196
.returns(fakeRoapMediaConnection);
197-
197+
198198
StaticConfig.set({bandwidth: {audio: 123, video: 456, startBitrate: 999}});
199-
199+
200200
const ENABLE_EXTMAP = true;
201201
const ENABLE_RTX = false;
202-
202+
203203
Media.createMediaConnection(false, 'recvonly-debug-id', 'meetingId', {
204204
mediaProperties: {
205205
mediaDirection: {
@@ -221,7 +221,7 @@ describe('createMediaConnection', () => {
221221
turnServerInfo: undefined,
222222
iceCandidatesTimeout: undefined,
223223
});
224-
224+
225225
assert.calledWith(
226226
roapMediaConnectionConstructorStub,
227227
sinon.match.any,
@@ -242,7 +242,6 @@ describe('createMediaConnection', () => {
242242
'recvonly-debug-id'
243243
);
244244
});
245-
246245

247246
it('creates a MultistreamRoapMediaConnection when multistream is enabled', () => {
248247
const multistreamRoapMediaConnectionConstructorStub = sinon
@@ -511,6 +510,138 @@ describe('createMediaConnection', () => {
511510
);
512511
});
513512

513+
const testEnableInboundAudioLevelMonitoring = (
514+
testName: string,
515+
browserStubs: {isChrome?: boolean; isEdge?: boolean; isFirefox?: boolean},
516+
isMultistream: boolean,
517+
expectedConfig: object,
518+
additionalOptions = {}
519+
) => {
520+
it(testName, () => {
521+
const connectionConstructorStub = isMultistream
522+
? sinon.stub(InternalMediaCoreModule, 'MultistreamRoapMediaConnection')
523+
: sinon.stub(InternalMediaCoreModule, 'RoapMediaConnection');
524+
525+
connectionConstructorStub.returns(fakeRoapMediaConnection);
526+
527+
// Set up browser stubs
528+
sinon.stub(BrowserInfo, 'isChrome').returns(browserStubs.isChrome || false);
529+
sinon.stub(BrowserInfo, 'isEdge').returns(browserStubs.isEdge || false);
530+
sinon.stub(BrowserInfo, 'isFirefox').returns(browserStubs.isFirefox || false);
531+
532+
const baseOptions = {
533+
mediaProperties: {
534+
mediaDirection: {
535+
sendAudio: true,
536+
sendVideo: true,
537+
sendShare: false,
538+
receiveAudio: true,
539+
receiveVideo: true,
540+
receiveShare: true,
541+
},
542+
...(isMultistream
543+
? {}
544+
: {
545+
audioStream: fakeAudioStream,
546+
videoStream: fakeVideoStream,
547+
shareVideoTrack: null,
548+
shareAudioTrack: null,
549+
}),
550+
},
551+
...(isMultistream
552+
? {}
553+
: {
554+
remoteQualityLevel: 'HIGH',
555+
enableRtx: true,
556+
enableExtmap: true,
557+
}),
558+
...additionalOptions,
559+
};
560+
561+
if (!isMultistream) {
562+
StaticConfig.set({bandwidth: {audio: 123, video: 456, startBitrate: 999}});
563+
}
564+
565+
Media.createMediaConnection(isMultistream, 'debug string', 'meeting id', baseOptions);
566+
567+
if (isMultistream) {
568+
assert.calledOnceWithExactly(
569+
connectionConstructorStub,
570+
expectedConfig,
571+
'meeting id',
572+
sinon.match.func,
573+
sinon.match.func,
574+
sinon.match.func
575+
);
576+
} else {
577+
assert.calledOnceWithExactly(
578+
connectionConstructorStub,
579+
expectedConfig,
580+
sinon.match.object,
581+
'debug string'
582+
);
583+
}
584+
});
585+
};
586+
587+
testEnableInboundAudioLevelMonitoring(
588+
'enables enableInboundAudioLevelMonitoring for multistream when browser is Chrome',
589+
{isChrome: true},
590+
true,
591+
{
592+
iceServers: [],
593+
disableAudioTwcc: true,
594+
enableInboundAudioLevelMonitoring: true,
595+
}
596+
);
597+
598+
testEnableInboundAudioLevelMonitoring(
599+
'enables enableInboundAudioLevelMonitoring for multistream when browser is Edge',
600+
{isEdge: true},
601+
true,
602+
{
603+
iceServers: [],
604+
disableAudioTwcc: true,
605+
enableInboundAudioLevelMonitoring: true,
606+
}
607+
);
608+
609+
testEnableInboundAudioLevelMonitoring(
610+
'does not enable enableInboundAudioLevelMonitoring for multistream when browser is Firefox',
611+
{isFirefox: true},
612+
true,
613+
{
614+
iceServers: [],
615+
disableAudioTwcc: true,
616+
doFullIce: true,
617+
stopIceGatheringAfterFirstRelayCandidate: undefined,
618+
}
619+
);
620+
621+
testEnableInboundAudioLevelMonitoring(
622+
'does not enable enableInboundAudioLevelMonitoring for non-multistream connections even when browser is Chrome',
623+
{isChrome: true},
624+
false,
625+
{
626+
iceServers: [],
627+
iceCandidatesTimeout: undefined,
628+
skipInactiveTransceivers: false,
629+
requireH264: true,
630+
sdpMunging: {
631+
convertPort9to0: false,
632+
addContentSlides: true,
633+
bandwidthLimits: {
634+
audio: 123,
635+
video: 456,
636+
},
637+
startBitrate: 999,
638+
periodicKeyframes: 20,
639+
disableExtmap: false,
640+
disableRtx: false,
641+
},
642+
}
643+
);
644+
514645
[
515646
{testCase: 'turnServerInfo is undefined', turnServerInfo: undefined},
516647
{

packages/@webex/plugin-meetings/test/unit/spec/meetings/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -690,11 +690,9 @@ describe('plugin-meetings', () => {
690690
assert.deepEqual(result.options, {
691691
mode: 'BLUR',
692692
blurStrength: 'STRONG',
693-
generator: 'worker',
694693
quality: 'LOW',
695694
authToken: 'fake_token',
696695
mirror: false,
697-
canvasResolutionScaling: 1,
698696
});
699697
assert.exists(result.enable);
700698
assert.exists(result.disable);

packages/calling/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
},
3838
"dependencies": {
3939
"@types/platform": "1.3.4",
40-
"@webex/internal-media-core": "2.20.0",
40+
"@webex/internal-media-core": "2.20.1",
4141
"@webex/internal-plugin-metrics": "workspace:*",
4242
"@webex/media-helpers": "workspace:*",
4343
"async-mutex": "0.4.0",

0 commit comments

Comments
 (0)