feat(agc): Add setting to disable automatic gain control (#582)

In some OS/Chromium combinations the automatic gain control goes slightly
crazy, but normally its fine. Thus keep the default as is, but add an option
for the users to disable it if required.

Closes: #564
This commit is contained in:
csett86 2021-05-11 17:08:47 +02:00 committed by GitHub
parent 4b4148388d
commit 22b3406613
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 51 additions and 3 deletions

View file

@ -34,6 +34,11 @@ type Props = {
*/
_alwaysOnTopWindowEnabled: boolean;
/**
* Disable automatic gain control.
*/
_disableAGC: boolean;
/**
* Email of user.
*/
@ -211,6 +216,7 @@ class Conference extends Component<Props, State> {
};
const configOverwrite = {
disableAGC: this.props._disableAGC,
startWithAudioMuted: this.props._startWithAudioMuted,
startWithVideoMuted: this.props._startWithVideoMuted
};
@ -403,6 +409,7 @@ class Conference extends Component<Props, State> {
function _mapStateToProps(state: Object) {
return {
_alwaysOnTopWindowEnabled: getSetting(state, 'alwaysOnTopWindowEnabled', true),
_disableAGC: state.settings.disableAGC,
_email: state.settings.email,
_name: state.settings.name,
_serverURL: state.settings.serverURL,

View file

@ -19,6 +19,16 @@ export const SET_ALWAYS_ON_TOP_WINDOW_ENABLED
*/
export const SET_AUDIO_MUTED = Symbol('SET_AUDIO_MUTED');
/**
* The type of (redux) action that sets disable AGC.
*
* @type {
* type: SET_DISABLE_AGC,
* disableAGC: boolean
* }
*/
export const SET_DISABLE_AGC = Symbol('SET_DISABLE_AGC');
/**
* The type of (redux) action that sets the email of the user.
*

View file

@ -3,6 +3,7 @@
import {
SET_ALWAYS_ON_TOP_WINDOW_ENABLED,
SET_AUDIO_MUTED,
SET_DISABLE_AGC,
SET_EMAIL,
SET_NAME,
SET_SERVER_URL,
@ -108,6 +109,21 @@ export function setStartWithVideoMuted(startWithVideoMuted: boolean) {
};
}
/**
* Set disable AGC.
*
* @param {boolean} disableAGC - Whether to disable AGC.
* @returns {{
* type: SET_DISABLE_AGC,
* disableAGC: boolean
* }}
*/
export function setDisableAGC(disableAGC: boolean) {
return {
type: SET_DISABLE_AGC,
disableAGC
};
}
/**
* Set window always on top.

View file

@ -17,7 +17,7 @@ import { Onboarding, advenaceSettingsSteps, startOnboarding } from '../../onboar
import { Form, SettingsContainer, TogglesContainer } from '../styled';
import {
setEmail, setName, setWindowAlwaysOnTop,
setStartWithAudioMuted, setStartWithVideoMuted
setStartWithAudioMuted, setStartWithVideoMuted, setDisableAGC
} from '../actions';
import SettingToggle from './SettingToggle';
@ -163,6 +163,10 @@ class SettingsDrawer extends Component<Props, *> {
settingChangeEvent = { setWindowAlwaysOnTop }
settingName = 'alwaysOnTopWindowEnabled' />
</SpotlightTarget>
<SettingToggle
label = { t('settings.disableAGC') }
settingChangeEvent = { setDisableAGC }
settingName = 'disableAGC' />
</TogglesContainer>
</Panel>
<Onboarding section = 'settings-drawer' />

View file

@ -3,6 +3,7 @@
import {
SET_ALWAYS_ON_TOP_WINDOW_ENABLED,
SET_AUDIO_MUTED,
SET_DISABLE_AGC,
SET_EMAIL,
SET_NAME,
SET_SERVER_URL,
@ -12,6 +13,7 @@ import {
type State = {
alwaysOnTopWindowEnabled: boolean,
disableAGC: boolean,
email: string,
name: string,
serverURL: ?string,
@ -24,6 +26,7 @@ const username = window.jitsiNodeAPI.osUserInfo().username;
const DEFAULT_STATE = {
alwaysOnTopWindowEnabled: true,
disableAGC: false,
email: '',
name: username,
serverURL: undefined,
@ -53,6 +56,12 @@ export default (state: State = DEFAULT_STATE, action: Object) => {
startWithAudioMuted: action.startWithAudioMuted
};
case SET_DISABLE_AGC:
return {
...state,
disableAGC: action.disableAGC
};
case SET_EMAIL:
return {
...state,

View file

@ -34,6 +34,7 @@
"invalidServer": "Falsche Server-Adresse",
"invalidServerTimeout": "Ungültiger Wert für die Server-Wartezeit",
"serverUrl": "Server-Adresse",
"serverTimeout": "Server-Wartezeit (in Sekunden)"
"serverTimeout": "Server-Wartezeit (in Sekunden)",
"disableAGC": "Automatische Mikrofonlautstärkeregelung deaktivieren"
}
}

View file

@ -34,6 +34,7 @@
"invalidServer": "Invalid Server URL",
"invalidServerTimeout": "Invalid value for Server Timeout",
"serverUrl": "Server URL",
"serverTimeout": "Server Timeout (in seconds)"
"serverTimeout": "Server Timeout (in seconds)",
"disableAGC": "Disable automatic gain control"
}
}