From ba66c7e2409b2d3bf32c26dbce7726783c0ffae6 Mon Sep 17 00:00:00 2001 From: Oliver Lazoroski Date: Tue, 5 May 2026 11:00:37 +0200 Subject: [PATCH 1/2] fix(client): prevent screen share audio loopback by default Enable AEC on the default screen share audio constraints so that remote participants' voices played through the local speakers are subtracted from the captured system audio before publish. Also align the default ScreenShareState audio bitrate profile with the capture path: switch from MUSIC_HIGH_QUALITY to VOICE_HIGH_QUALITY so the declared profile honestly describes what is being captured. Music sharing remains supported via an explicit setAudioBitrateProfile(MUSIC_HIGH_QUALITY) call when HIFI is enabled at the call level. --- packages/client/src/devices/ScreenShareState.ts | 2 +- .../client/src/devices/__tests__/ScreenShareManager.test.ts | 2 +- packages/client/src/devices/devices.ts | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/client/src/devices/ScreenShareState.ts b/packages/client/src/devices/ScreenShareState.ts index 5ca22b5998..b227e7e382 100644 --- a/packages/client/src/devices/ScreenShareState.ts +++ b/packages/client/src/devices/ScreenShareState.ts @@ -26,7 +26,7 @@ export class ScreenShareState extends AudioDeviceManagerState { expect(call.publish).toHaveBeenCalledWith( manager.state.mediaStream, TrackType.SCREEN_SHARE, - { audioBitrateProfile: AudioBitrateProfile.MUSIC_HIGH_QUALITY }, + { audioBitrateProfile: AudioBitrateProfile.VOICE_HIGH_QUALITY }, ); }); diff --git a/packages/client/src/devices/devices.ts b/packages/client/src/devices/devices.ts index 1cabeddf2c..f7d16cb527 100644 --- a/packages/client/src/devices/devices.ts +++ b/packages/client/src/devices/devices.ts @@ -357,7 +357,10 @@ export const getScreenShareStream = async ( ? options.audio : { channelCount: { ideal: 2 }, - echoCancellation: false, + // AEC on the captured system audio uses the local render path + // as reference, which removes remote participants' voices that + // would otherwise loop back to them through the screen share. + echoCancellation: true, autoGainControl: false, noiseSuppression: false, ...options?.audio, From 64063e849160f3ae37451d421142fd5efdfdf606 Mon Sep 17 00:00:00 2001 From: Oliver Lazoroski Date: Tue, 5 May 2026 12:08:30 +0200 Subject: [PATCH 2/2] fix(client): remove own-tab audio from screen share capture Set restrictOwnAudio: true on the default screen share audio constraints so that audio originating from the capturing tab (notably WebRTC