Closed TriplEight closed 3 years ago
Hello @TriplEight, there's the WebRTC input plugin where you can set various feature like noise reduction, echo reduction and voice detection.
In the next PulseEffects release there will be an additional new Noise Reduction plugin available for both input and output pipeline.
You can also compile the latest git master to test it or install it from pulseeffects-git
on the AUR if you use Arch Linux (install librnnoise
before).
Depending on the noise level you could also use the gate plugin. But based on your requirements the noise reduction plugin mentioned by Digitalone1 will be the better tool.
Thank you guys for answering. But it seems the problem with my input starts a bit earlier - I think PulseEffects doesn't see my mic. It's set to the only input device. And as it's seen from the picture - gnome hears while I'm screaming at my laptop while doing a screenshot, and PulseEffects doesn't seem to.
You will see activity in PulseEffects meters only when an application is actually recording audio(skype, teams, obs, etc) and you enable effects for it in the Applications
section. The one at the top of the plugins list.
Thanks, I've enabled "Process all inputs" and tried it with firefox, chromium and telegram with voice recording. Now I've seen moving graph on the top in PulseEffects, but no input in the Gate or Webrtc tools turned on. And changing the settings was not affecting the recorded sound.
Then something is wrong. Kill the current PulseEffects instance pulseeffects -q
and restart it in debug mode G_MESSAGES_DEBUG=pulseeffects pulseeffects
. This way we will see if there are errors.
ok, that was easy!
(pulseeffects:1074796): pulseeffects-CRITICAL **: 18:23:26.541: pulse_manager: failed to move source output Firefox, idx = to PE
Usually when this error happens there is an identification number after idx =
. It is also strange seeing it happening with Firefox. There are applications that set a Pulseaudio flags the do not allow third party applications to process its output or input. But as far as I remember Firefox is no one of them. Show the whole log here. Maybe there is something else that would help to understand what is happening.
Btw chromium didn't cause errors, but also I couldn't see any input graph and improvement in the recording.
In the second full log our mic pipeline soe
did not start to play because the source output
ZOOM VoiceEngine
did not allow the input of its audio stream to be redirected. So in this case it makes sense things did not work. What I do not understand is why Firefox is not allowing its source output
to be redirected.
Are you sure you enabled effects for Chromium in the mic pipeline? The logs only show effects being applied to its output or in Pulseaudio words sink input
:
pulse_manager: sink input: Chromium, idx = 233 moved to PE
This won't create activity in the mic pipeline widgets.
Are you sure you enabled effects for Chromium in the mic pipeline?
I turned "Process all inputs" on And if I do something with mic in Chromium, it appears on in Applications menu.
Now, when I updated to 4.8.2-1
it works with chromium: I see the graphs and gate with webrtc seem to work. So problem is localizing around Firefox:
I have good and bad news. I did some tests with Firefox and I was able to reproduce the issue. And I know why it is happening. The bad news is that I can do nothing about it. While Firefox is recording something run the command pacmd list-source-outputs
. Firefox is setting the flag DONT_MOVE
to its recording stream. This tells Pulseaudio that no one is allowed to redirect Firefox to another source device. That is why we are not able to move it to PulseEffects. Unfortunately this is something that only the Firefox developers can change.
I hope that Chromium doesn't follow this horrible path taken by Mozilla...
Maybe a ticked should be opened on https://bugzilla.mozilla.org/
Anyway the relationship between Firefox and Pulseaudio is a mess, there's also this opened from years and never resolved.
I think they will answer that this choice was made for security and privacy reasons for not allowing third party software to record their stream.
More or less what KDE devs told me about their useless and buggy microphone indicator.
I think they will answer that this choice was made for security and privacy reasons for not allowing third party software to record their stream.
Any other software is still allowed to record the user microphone while Firefox is recording it. Setting that flag offers no privacy protection.
And we are still able to redirect Firefox output. They must have had other reasons to set that flag.
@wwmm please open a ticket in bugzilla, you can explain more in depth the issue.
I will try to do that tomorrow.
Someone has already done that 6 months ago https://bugzilla.mozilla.org/show_bug.cgi?id=1645684. And there was no answer... =/
I'm afraid nothing will be done if we wait them. Looking at the other issue posted above, this seems the repository where Mozilla has its Pulseaudio implementation.
And this is the mentioned flag. Maybe it's only a matter of deleting or changing this line so I can submit a pull request? I don't know, I'm not even a Rust developer.
Thanks a bunch for triaging the issue this far! Unfortunately, the problems are not limited to Firefox.
This issue with Telegram is known for at least 2 years. They also set the DONT_MOVE
flag. Zoom is probably doing the same thing. Only them can change that.
And this is the mentioned flag. Maybe it's only a matter of deleting or changing this line so I can submit a pull request?
This line only defines the constant. It is not where it is being set to the Firefox recording stream.
this seems the repository where Mozilla has its Pulseaudio implementation
I think Firefox is not developed in Github
It's there: https://searchfox.org/mozilla-central/source/third_party/rust/cubeb-pulse/src/backend/stream.rs#442
And a modification can be made here in Github: https://github.com/mozilla/cubeb-pulse-rs/blob/bf31534d08b2c16fb5e4c5834944ae3271efbd63/src/backend/stream.rs#L488
I added a comment at https://bugzilla.mozilla.org/show_bug.cgi?id=1645684. Let's see if this revives the bug report.
I think Firefox is not developed in Github
It's not, but cubeb-pulse is developed there and receives pull request to be implemented in the main project.
Could be enough to remove the conditional statements where the flag is added. In the next days I'll make an issue on Github adding a pull request. Let's see what happens. I'm pretty sure the issue on Bugzilla will remain ignored.
@wwmm with Pipewire the limitation of this flag could be bypassed?
with Pipewire the limitation of this flag could be bypassed?
It is hard say. At least its pw_stream_flags
structure does not have a don't move flag https://gitlab.freedesktop.org/pipewire/pipewire/-/blob/master/src/pipewire/stream.h#L237
PipeWire's developers have added a workaround that ignores the silly request done by Firefox
Firefox is forced to remove the DONT_MOVE flag on capture streams so
that you can move firefox streams with other tools.
https://gitlab.freedesktop.org/pipewire/pipewire/-/releases#0.3.32
So from PipeWire 0.3.32
this kind of problem should not happen anymore when using Firefox.
I will close this issue.
Hello, I didn't find any comprehensive guide on how to set up the mic to cut off my background noises, keyboard clicking, ideally everything which is not voice. Would be cool to have one!