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

Copy MUTED state of selected source #420

Open
Neurognostic opened this issue Oct 23, 2023 · 4 comments
Open

Copy MUTED state of selected source #420

Neurognostic opened this issue Oct 23, 2023 · 4 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@Neurognostic
Copy link

Neurognostic commented Oct 23, 2023

Is your feature request related to a problem? Please describe.
When NoiseTorch is not enabled/loaded and I mute the @DEFAULT_AUDIO_SOURCE@ with wpctl and later load NoiseTorch: I cannot unmute the source device using @DEFAULT_AUDIO_SOURCE@ because NoiseTorch is now the default source.

This breaks any widgets that are monitoring the state of the default source. It will appear that the microphone is unmuted, because the NoiseTorch source is unmuted, but the real source is still muted.

Describe the solution you'd like
As an option or by default:

Upon loading NoiseTorch, if the selected source is MUTED, unmute it and mute the NoiseTorch source upon loading. When unloading revert the MUTED state change, if any.

Describe alternatives you've considered
Shell script wrapper, but it gets kind of messy when reverting the MUTED state when unloading.

@Neurognostic Neurognostic added the enhancement New feature or request label Oct 23, 2023
@TheDukeofErl
Copy link
Collaborator

I'm guessing that in this case, you've also set NoiseTorch as the default microphone device in the past, thus, upon loading it, it takes over the state as default and the normal microphone becomes the fallback?

@Neurognostic
Copy link
Author

it takes over the state as default and the normal microphone becomes the fallback?

Yes that is correct. When NoiseTorch is loaded it becomes the default source, but if the real source was in MUTED state when loaded then it will appear to any systray widgets that are monitoring mute state of default source that the mic is unmuted when it is actually still muted.

I'm guessing that in this case, you've also set NoiseTorch as the default microphone device in the past

Is that the behavior of Wireplumber? I do not remember if I ever manual set NoiseTorch as the default audio source or know if NoiseTorch tries to set itself as the default source upon loading.

@TheDukeofErl
Copy link
Collaborator

Is that the behavior of Wireplumber? I do not remember if I ever manual set NoiseTorch as the default audio source or know if NoiseTorch tries to set itself as the default source upon loading.

By default, NoiseTorch shouldn't become the default device. It'll only done so if set manually. That said, once it's set as default and disappears, the sound server may or may not set it as default again when it becomes available again. In this case, it's very likely that it was set as default and is thus remembered as such.

In general, I avoid using NoiseTorch as the default device and only manually set it for programs I want to have noise cancellation. Though nothing enforces this, and it is up to the user, it avoids odd situations. In this case, I almost want to just modify the README and add a recommendation to not set NT as the default device, rather setting it when you want it. This would also be in line with Easy Effects' stance of not setting the output device as a default, rather using the device where needed.

I also worry about NT automagically changing the mute state of a device if NT is the default on startup. That sounds like it could lead to corner cases, and to be frank, I also don't like the idea of the actual audio device itself getting unmuted by NT if NT is the default. Usually if I mute the device itself, it's because I have no intention of using a microphone and would rather no programs in userspace have access to the microphone period. Personally, I'd look at that as an overstepping of what a piece of noise cancellation software should do. That said, that's just my 2 cents.

@Neurognostic
Copy link
Author

This would also be in line with Easy Effects' stance of not setting the output device as a default, rather using the device where needed.

I had assumed some programs would be forgetful when they are started without NoiseTorch loaded and NoiseTorch not set as the default, but after some testing the programs I use all switch to NoiseTorch as their source from the default as soon as it becomes available.

If that is always true then setting NoiseTorch as the default source would not be necessary and adding a note to the README would be helpful.

I also don't like the idea of the actual audio device itself getting unmuted by NT if NT is the default. Usually if I mute the device itself, it's because I have no intention of using a microphone and would rather no programs in userspace have access to the microphone period. Personally, I'd look at that as an overstepping of what a piece of noise cancellation software should do.

Make sense to me, I agree.

@TheDukeofErl TheDukeofErl added the documentation Improvements or additions to documentation label Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants