Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable automatic gain control #248

Open
ara4n opened this issue Mar 5, 2022 · 10 comments
Open

Configurable automatic gain control #248

ara4n opened this issue Mar 5, 2022 · 10 comments

Comments

@ara4n
Copy link
Member

ara4n commented Mar 5, 2022

We seem to be using WebRTC's defaults for AGC - we should probably either force it on via audioConstraints (https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints/autoGainControl) and/or make it configurable.

@foxlet
Copy link

foxlet commented Mar 8, 2022

A checkbox to disable AGC would be particularly beneficial for podcast or production use, where mic gain is already carefully controlled and fluctuations would be detrimental.

@bblacher
Copy link

Also, the checkbox within Element Desktop that should disable AGC doesn't do anything when using Element Call in Element Desktop.
element-hq/element-web#24355

@natanox
Copy link

natanox commented Apr 8, 2024

For anyone who also can't use the call feature due to this unsolved issue (or with participants who regularly complain about their ears falling off), this is the workaround we're currently using:

Find out the correct number for your source with wpctl status. Then, when connecting to a call, execute while sleep 0.01; do wpctl set-volume 54 .25; done in a terminal (replace 54 with your source and .25 with the target volume, on a scale from 0.01 to 1.00). This will set the correct volume every 10 milliseconds.

@perru
Copy link

perru commented Apr 21, 2024

For anyone who also can't use the call feature due to this unsolved issue (or with participants who regularly complain about their ears falling off), this is the workaround we're currently using:

Find out the correct number for your source with wpctl status. Then, when connecting to a call, execute while sleep 0.01; do wpctl set-volume 54 .25; done in a terminal (replace 54 with your source and .25 with the target volume, on a scale from 0.01 to 1.00). This will set the correct volume every 10 milliseconds.

Well, it works but what an ugly workaround...

Me and all my contacts have this bug and nobody wanna use Element cause of it. Same on Linux and Windows.

@Ceiridge
Copy link

Ceiridge commented Nov 4, 2024

For anyone who also can't use the call feature due to this unsolved issue (or with participants who regularly complain about their ears falling off), this is the workaround we're currently using:

Find out the correct number for your source with wpctl status. Then, when connecting to a call, execute while sleep 0.01; do wpctl set-volume 54 .25; done in a terminal (replace 54 with your source and .25 with the target volume, on a scale from 0.01 to 1.00). This will set the correct volume every 10 milliseconds.

This probably also causes it to change all the time, meaning for some milliseconds, you are quieter/louder than you should be, which will sound very unprofessional

@bblacher
Copy link

bblacher commented Nov 4, 2024

This is just fixing an issue that shouldn't be there in the first place with a very sloppy workaround. I can't imagine that telling livekit not to do agc would be that hard.

@ParzivalWolfram
Copy link

Any fix yet? This causes a friend of mine to be unable to play any other audio without muting his microphone entirely, or it immediately adjusts his gain to ridiculous levels to pick up the audio (and blows everyone else's ears out if he speaks after that.)

@Ceiridge
Copy link

Ceiridge commented Jan 10, 2025

@ParzivalWolfram

Any fix yet? This causes a friend of mine to be unable to play any other audio without muting his microphone entirely, or it immediately adjusts his gain to ridiculous levels to pick up the audio (and blows everyone else's ears out if he speaks after that.)

You can open the devtools in Element (Ctrl+Shift+I), use the element selector (Ctrl+Shift+C) to select an element inside the call iframe (important!!!) so that the javascript scope is inside the iframe, then run the Anti AGC JavaScript linked below and finally mute, unmute and temporarily select another microphone, then go back to the microphone you want to use. AGC is now disabled for this call.

Anti AGC: https://github.com/joeywatts/disable-autogain-control-extension/blob/master/disableAutogain.js

@ParzivalWolfram
Copy link

ParzivalWolfram commented Jan 10, 2025 via email

@Destinyg133
Copy link

This is just fixing an issue that shouldn't be there in the first place with a very sloppy workaround. I can't imagine that telling livekit not to do agc would be that hard.

Agree, this should be more in focus to fix AGC and to make it configurable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

8 participants