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

Mute Multiple Microphones #32

Open
grahamwhiteuk opened this issue Feb 3, 2021 · 22 comments
Open

Mute Multiple Microphones #32

grahamwhiteuk opened this issue Feb 3, 2021 · 22 comments

Comments

@grahamwhiteuk
Copy link

This extension is perfect for me except that I have two microphones attached to my laptop. There's the default microphone on the laptop and there's an additional microphone connected via USB (as attached to a web cam). The mute button only appears to mute the default microphone, which may not be the one I'm using. I wonder if it's possible to update the extension in order to mute all microphones? A further enhancement might allow the user to configure which of their microphones would get muted by the extension but for me the simple case of mute and unmute all microphone devices would work wonderfully. Thanks for your work on this.

@wbolster
Copy link
Owner

wbolster commented Mar 4, 2021

yep i agree that it would be best to keep it simple and always mute/unmute all microphones.

@iPablo
Copy link

iPablo commented Jun 8, 2021

Hi @wbolster, thank you for the work you are doing here. I would like to know if you intend to add this functionality to the roadmap.

@wbolster
Copy link
Owner

wbolster commented Sep 9, 2021

🤣 there is no roadmap but if there was any this would be on it. i wrote above that i think this would be sensible behaviour.

(i have not actively worked on this project in a long time)

@grahamwhiteuk
Copy link
Author

What's the best way forward? Are you starting up again or are we talking fork or pull request? I see the one open PR is now outdated so would be good to see some commentary on the prospects for this work. Thanks again for your work here, love the idea.

@wbolster
Copy link
Owner

wbolster commented Sep 9, 2021

always taking reasonable pull requests that don't appear as 'yolo i suspect this code maybe has a chance of working sometimes on the developer's machine, perhaps' 🤪

@wbolster
Copy link
Owner

wbolster commented Sep 9, 2021

practically speaking, changing this extension to mute/unmute all mics, with a reasonable investigation in how it would work in case things are not in sync, and the tradeoffs made etc, would be a welcome enhancement

@brianjmurrell
Copy link

So how does the extension currently decide which mic to mute when there are multiple? Is it just totally random choice among them? Or is it deterministic in some way?

I came here from #46, so just knowing if mic choice is deterministic and what determines it would be sufficient.

@urmilparikh
Copy link

So how does the extension currently decide which mic to mute when there are multiple? Is it just totally random choice among them? Or is it deterministic in some way?

I came here from #46, so just knowing if mic choice is deterministic and what determines it would be sufficient.

It uses default mic:

this.mixer_control = new Gvc.MixerControl({ name: "Nothing to say" });
this.stream = this.mixer_control.get_default_source();

May be, there could be an option to mute / unmute all mics but monitor only default mic?

@brianjmurrell
Copy link

It uses default mic:

Does it? My current PA fallback configuration:

image

so WH-CH710N is the fallback, yet when I toggle: image to
image:

image

It toggles the (non-fallback) USB Audio Headset input to un-muted.

Am I misunderstanding something?

@brianjmurrell
Copy link

Any further information I can provide here?

Unfortunately the unpredictability (and control -- even by just setting the desired input as the fallback) of which input this will actually toggle makes it quite unusable. I don't actually use it any more. I use the input mute control on PA volume control tool instead, as cumbersome as it is.

@grahamwhiteuk
Copy link
Author

This paper adds some weight to the argument of muting microphones at the OS level instead of in apps: Are You Really Muted?: A Privacy Analysis of Mute Buttons in Video Conferencing Apps

@brianjmurrell
Copy link

@grahamwhiteuk I think we are all here because we agree that trusting apps to mute is like trusting the fox to look after the hen-house.

The problem is that this app isn't working in scenarios of multiple inputs (who doesn't have multiple inputs these days?). It's not even predictably working with the designated default input. Which input it mutes seems to be pretty random or at least non-deterministic.

@grahamwhiteuk
Copy link
Author

OK, so I think @wbolster has made it clear already that he's not working on this project (other than the odd small tweak to update the config for compatibility). We should start to consider how we can write a patch and put in a pull request.

@brianjmurrell
Copy link

Unfortunately, even though I am a software developer, I don't develop for JS (however, languages are languages, so that is probably not the major hurdle here) more more importantly I am not a GNOME hacker and so not familiar (enough) with the GNOME application development layer.

I am sure with some time (another thing I don't have unfortunately) I could figure it all out, but I lack that time between my day job, real-life and other projects I am working on.

@wbolster
Copy link
Owner

@brianjmurrell it's actually exactly the same for me. i hacked this thing together 6 years ago or so, and the landscape evolved so much in the mean time that i am pretty much back to square zero.

BenignBeppe added a commit to BenignBeppe/nothing-to-say that referenced this issue Apr 23, 2022
Adds a setting to control all inputs. This mutes and unmutes all
sources, instead of just the default.

Fixes wbolster#32
@BenignBeppe
Copy link
Collaborator

I had a look at this (commit above) and think I managed to get it to work by (un)muting all sources. I did some testing on my own machine with three mics (internal, external sound card and webcam) and it seems to work.

The implementation is pretty simple: loop over all sources and set mute, instead of just the default. I haven't touched refresh() which deals with streams since it was a bit hard to immediately see what's going on there. Maybe if @wbolster have time to look at it they would have an easier time. There's probably a bit more work and testing to be done, but at least it's a start.

In general I've found the audio devices being a bit finicky (this is on Ubuntu), where sometimes the active one switches when you connect one, but not always. It might be that this is the root cause of this issue. Using the default source should reasonably control the active input.

BenignBeppe added a commit to BenignBeppe/nothing-to-say that referenced this issue Apr 23, 2022
Adds a setting to control all inputs. This mutes and unmutes all
sources, instead of just the default.

Fixes wbolster#32
BenignBeppe added a commit to BenignBeppe/nothing-to-say that referenced this issue Apr 23, 2022
Adds a setting to control all inputs. This mutes and unmutes all
sources, instead of just the default.

Fixes wbolster#32
@wbolster
Copy link
Owner

wbolster commented Apr 24, 2022

👀 is there any actual reason to have a setting? why not unconditionally do this by default? see #32 (comment)

@brianjmurrell
Copy link

I think there are going to be use cases where people don't want all of their inputs muted just because they want the mic in their video conference muted.

Somebody could have some other audio processing task going on on their computer in the background when a call comes in, or a video conference starts, for example.

@wbolster
Copy link
Owner

this extension is supposed to be dead simple. complex audio setups are out of scope.

that said, ‘one mic’ vs ‘all mics’ is conceptually not too complex, but i still think ‘all mics’ should be the default b/c principle of least surprise

@grahamwhiteuk
Copy link
Author

I agree. Default to "All Mics". I'm less bothered about whether there's a user setting for it. I don't think I'd use the setting myself but that doesn't mean it's not useful to others. I find it hard to imagine a use case where someone might want to only mute one mic though but my primary use case is conference calls.

@grahamwhiteuk
Copy link
Author

I (finally) found time to test out the branch from @BenignBeppe and can confirm it works great for me. @wbolster - would it be possible to have this merged?

@benblasco
Copy link

@grahamwhiteuk I think we are all here because we agree that trusting apps to mute is like trusting the fox to look after the hen-house.

The problem is that this app isn't working in scenarios of multiple inputs (who doesn't have multiple inputs these days?). It's not even predictably working with the designated default input. Which input it mutes seems to be pretty random or at least non-deterministic.

FWIW I agree with the selection of the microphone to mute being either random or non-deterministic. I'll see if I can test the proposed fix, but I am scared because the extension has been crashing Gnome altogether for me as per issue #49

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

No branches or pull requests

7 participants