wwmm / easyeffects

Limiter, compressor, convolver, equalizer and auto volume and many other plugins for PipeWire applications
GNU General Public License v3.0
6.41k stars 268 forks source link

Buggy audio while listening music and getting a notification #962

Open CCaroV opened 3 years ago

CCaroV commented 3 years ago

I recently moved from Fedora 33 to Fedora 34. One of it's big changes is replacing pulseaudio with pipewire.

Since I updated fedora I have noticed, while listening music, (YouTube, Spotify, etc...) if I receive any notification (a Telegram message for example), the background music... crashes? It makes some weird sound, like if it would be played backwards, this only lasts like a second or less. Receiving various notifications at the same time makes the music almost inaudible.

I have tried closing PulseEffects (pulseeffects -q) and get some notifications while listening music and everything seems to work fine, so I'm assuming this only happens while using PulseEffects.

I'm not sure if you need any extra information, so I'm just going to upload some hardware basics of my pc. Thanks in advance!

$ hwinfo --short
cpu:                                                            
                       Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz, 1800 MHz
sound:
                       Intel Sunrise Point-LP HD Audio
wwmm commented 3 years ago

Since I updated fedora I have noticed, while listening music, (YouTube, Spotify, etc...) if I receive any notification (a Telegram message for example), the background music... crashes?

One of the best PipeWire features is the dynamic latency adjustment. But dealing with it is tough. Specially in the current approach used in our stable releases where we take audio away from the server to process in GStreamer and send the results back to the server. Hopefully the new approach based on native PipeWire filters that I am using in our gtk4 branch will deal better with this.

When a new audio client starts and asks for a latency that is smaller than the one currently being used PipeWire automatically adjusts its latency. This means that the audio buffer size is changed. When only Spotify is running this buffer size is usually around 8192 samples. But when the notification runs it can go down to 1024 or even less. These big changes in buffer size are causing the noises you are listening to. As our stable releases are sending the audio to GStreamer some additional buffering is done there too. What makes the situation more difficulty to handle. And maybe this is the reason why you only hear this noise when PulseEffects is running.

A bad workaround you can try is playing with the latency setting in PulseEffects menu. If the value you choose is close enough to the one being requested by the notification client these noises may be less intense. The downside is that the dynamic latency adjustment will be essentially killed.

Run pw-top in a terminal and pay attention to the column QUANT. It will show the current buffer size applied. If the field has 0 it just means that the audio stream is happy to use whatever is given. Different numbers are shown only for the clients that requested a latency value. Once you receive a notification you will see these numbers changing.

pulpan977 commented 3 years ago

Can confirm. This is the most evident when I have Spotify (Snap version) playing and I get a notification on Discord. Some times Whatsapp notifications on Vivaldi do the same thing. Using Xonar Essence ST. I use equalizer and convolver plugins, but it seems only the presence of PulseEffects without any effects enabled is enough to cause the issue. It also introduces a latency drift like described in #875

log.txt

CCaroV commented 3 years ago

I have changed the latency settings. At first, when I clicked the - icon in the latency settings, PulseEffects crashed. I had to close it using killall because pulseeffects -q didn't work either. After opening it again, I was able to change the value. I changed the value to 49ms (50ms was the default value) and tried again. Now there is no weird sounds when receiving any notification. I tried also on some video conferences and it works like a charm.

image

Thanks for your help!

AlexWayfer commented 2 years ago

Probably related (duplicate?) to #1023.