Closed alexmurray closed 3 years ago
Apologies for that. The first thing to check is: is hushboard muting the correct microphone?
If you refresh to the latest edge version (0+git.b108be2) and then run it from a terminal as hushboard --verbose
then it should tell you on stdout what it's muting and unmuting every time you press a key.
If that's the incorrect mic, then there's our problem. We attempt to identify the active mic; perhaps we're doing it wrong.
If it's the correct mic but it doesn't seem to be actually muting it even though hushboard thinks it is, then the next thing to try is to see whether hushboard is actually muting it. You can see this with pavucontrol
; as hushboard mutes and unmutes a mic, you should see that reflected in pavucontrol (and you can see that in https://www.youtube.com/watch?v=icXB7j8zUQg).
If hushboard thinks it's muting the mic but pavucontrol doesn't think it is, then we're doing something wrong when actually muting it; if that's the case, I'm a bit puzzled (muting isn't hard!) but we can drill into it.
If the mic is being muted according to pavucontrol
but it's not muting in audacity, then it's possible that audacity is configured to bypass pulseaudio and use ALSA directly, which would be annoying on audacity's part; you can doubtless test that, or try some other application which does use pulse as it should as part of the desktop to see if that's maybe the issue.
If you could give those things a try and report back, that would be useful. Apologies again, and thank you for trying hushboard!
I have the same problem, and I get this ... I have plenty of microphones :)
nsg@glamdring ~ $ hushboard --verbose
Gtk-Message: 02:12:09.277: Failed to load module "canberra-gtk-module"
There is more than one active microphone so I don't know which one to unmute
There is more than one active microphone so I don't know which one to unmute
@nsg thank you! Hm. So... I don't know what to do in that situation (and I don't have multiple active microphones, so I've never experienced this). What should hushboard do here? Mute all the active mics?
What should hushboard do here? Mute all the active mics?
That's a good question. For me, that would work. But I'm unsure if that's a good default ... hm. Maybe configurable?
I don't want to make it configurable; hushboard is deliberately and intentionally simple, because it's meant to do one thing. If people have to fiddle with configuration then it's a Terrible Linux Tool :-)
I will make it mute all the active microphones and we'll see if anyone dislikes that :-) New build coming shortly...
With the new build, I also see -There is more than one active microphone so I don't know which one to unmute
- I agree, mute all microphones makes the most sense if we don't know which is the active one. :+1:
OK, version 0+git.3374c8f should be in the snap edge channel; give that a try and see if it works. It mutes (and unmutes) all active mics.
@nsg I too do not understand this :) If muting everything works but there's a cleverer way to only identify the mic that's actually being used then I'm happy to do that -- we'll see whether this version works first, and if it's enough to tide things over then that will help!
Mute works :)
For me this is completely fine and solves my problem, and this is probably the sane default anyway.
Excellent! If that works for @alexmurray too then I'll close this, and if anyone has a better suggestion of how to deal with PulseAudio and multiple mics then I'm happy to listen.
@stuartlangridge I did some basic testing - looks like we can get which sources are running (and hence the active mic) with something like:
active_sources = [s for s in self.pulse.source_list() if s.state == pulsectl.PulseStateEnum['running']]
So if you want to go back to only muting / unmuting the active mic, then I think this could work. However, I suspect if pulseaudio support multiple running mics you would still want the current logic to mute all 'running' ones, not just active, so perhaps a combination of the two would be the best approach?
OK. I have promoted this version to stable, which mutes all active mics. Thank you both for testing. Clearly I need to better understand the difference between active and running and possibly other states in order for hushboard to Do The Right Thing here; @alexmurray I suspect you're right here and that I want to find things which are both active and running, but I'd like to check out what all that means before doing it, and "mute all active mics" seems to be a material improvement over the current state at least! I'll leave this issue open for now to track that need.
Ok no worries - I sent a PR just in case you still want to go down that route - thanks again for this excellent tool - it is very neat.
Just a heads up, I have an install where I had used the Ubuntu Studio installer to setup Jack, etc. It seems to suffer from this (it states there are no microphones even though I can record audio without issue).
I am intentionally being vague as I am going to roll back to default and see if that fixes it. Then it may help give you some context and a heads up that jack might be an issue.
I will report back
Not sure if it's the same error, but in my case it only seems to work on certain applications (Wayland vs Xorg). We should probably adapt the software a little to get the keystrokes from both environments.
To reproduce the issue, you can use my setup:
Then open an alacritty terminal (wayland) and the Firefox browser. Start to type on the terminal and then try on Firefox. Result: keystrokes on Alacritty (Wayland) are not detected, thus the microphone is not muted. Keystrokes on Firefox (Xorg) are detected and the microphone is correctly muted.
@denysvitali I've moved that discussion over to https://github.com/stuartlangridge/hushboard/issues/13.
@dustinkrysak do file a new issue with Jack problems when you have them, certainly!
Closing this issue as being about multiple mics only, which should now be fixed.
See the attached video - let me know if I can help debug further...
https://user-images.githubusercontent.com/56540/103961132-c0237380-51a3-11eb-8a6c-b1aecb0cdb4f.mp4