wwmm / easyeffects

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

no sound, randomly, viewing video with FF , Chrome, VLC #1789

Closed promeneur closed 1 year ago

promeneur commented 2 years ago

EasyEffects Version

6.2.6

What package are you using?

openSUSE

Distribution

openSUSE Tumbleweed

Describe the bug

Randomly, sometime when viewing a video with FF or Chrome (YouTube) or VLC then there is no sound.

It seems this occurs after several starts and stops, or several launching and quitting.

Speakers are "on".

I must restart the PC to get again sound For FF or Chrome or VLC.

Expected Behavior

Output sound is never cut.

Debug Log

Debug Log
``` Paste your log here ```

Additional Information

No response

wwmm commented 2 years ago

This reminds of a bug whose source is still a mystery https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1733. The next time this happens try to see if enabling and disabling the global bypass button, the one next to the presets menu, makes the sound come back. Or if disabling and enabling effects for the streams in the corresponding EasyEffects checkbox makes any difference. If one of these things work it is probably the same situation as the one in the issue I have opened in the PipeWire's page.

I must restart the PC to get again sound For FF or Chrome or VLC.

Executing easyeffects -q and opening it again by clicking on you desktop icon is a faster solution if the global bypass procedure has no effect.

promeneur commented 2 years ago

pipewire 0.3.56

Ok, I will try your solution and I will report the result.

Thanks

promeneur commented 2 years ago

The problem has just occured with VLC. I get again the sound by clicking twice the "bypass" button.

wwmm commented 2 years ago

The problem has just occured with VLC. I get again the sound by clicking twice the "bypass" button.

Ok. The next time this happens run pw-dot before forcing the sound to come back. The output file can be viewed with the command xdot. It would be good to know if in your computer the links between filters are paused or if the sound is gone even if the links are made and active. In the past I saw paused links. But for a while I have been noticing lack of sound even if PipeWire tells that the links are made and active.

promeneur commented 2 years ago

Exactly what happens.

With FF I play a video. After this video, I quit FF and launch VLC. With VLC I play a video After this video, I search and play another video. From the beginning of the video, i get no sound. I pause the video. I launch EE I click twice the "bypass" button I keep on playing the video. this time i get sound.

LebedevRI commented 2 years ago

I would just like to mention that this / https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1733 is also happening for me, during watching youtube videos in chrome on debian sid. No actionable reproduction steps, sadly.

wwmm commented 2 years ago

No actionable reproduction steps, sadly.

That is one of the main problems with this bug. It is too random and as a result hard to debug. I think that just like https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2617 we are facing some kind of bug in PipeWire. As far as PipeWire's API is concerned I do not see what else I could do different in order to avoid these 2 bugs.

wwmm commented 2 years ago

Whenever this "no sound" bug happens it is important to run pw-dot and maybe pw-dump too before forcing things to work again. This way we can see if anything new is happening to the link states.

LebedevRI commented 2 years ago

(left channel is silent) pw-dump.txt pw.dot.txt

LebedevRI commented 2 years ago

Worse case: left channel is somehow random noise, right channel is good. pw-dump.txt pw.dot.txt

wwmm commented 2 years ago

(left channel is silent) Worse case: left channel is somehow random noise, right channel is good.

The pw-dot output is totally fine. Just like I have seen in the last months when this problem happens. I will need some time to take a good look at the pw-dump file.

Such a frustrating bug... According to PipeWire's own tool the links are there and in the active state. There should be audio but somehow there isn't.

promeneur commented 2 years ago

New phenomenon.

during a skype video talk suddenly no more mic. before playing with "by pass" button, I executed "pw-dot".

pw.dot.txt

playing with "by pass" button does not solve the problem.

I recalled my contact then again after a while no more mic.

more info : the mic is dynamically shared between the host and a qemu guest.

I never get any problem till this day using mic with Skype.

wwmm commented 2 years ago

before playing with "by pass" button, I executed "pw-dot".

And again the output is totally fine. The filters are loaded and the links between them are in the active state... I wonder what is happening inside PipeWire under the hoods. If the links are active they are literally sending silent audio buffers to the filters. It doesn't make any sense.

promeneur commented 2 years ago

More info about mic : I get an error message from Skype saying there is a problem with the mic and suggesting to restart the PC.

promeneur commented 2 years ago

I get the problem with VLC.

pw.dot.txt

Playing with "by pass" button does not solve the problem.

I had to relaunch VLC to get again sound.

wwmm commented 2 years ago

I wonder if PipeWire 0.3.58 will have any effect on this bug. At least another one whose source was unknown https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2617 seems to have been unintentionally fixed by the new release.

LebedevRI commented 2 years ago

I wonder if PipeWire 0.3.58 will have any effect on this bug.

I'll report back after statistically-significant time frame.

LebedevRI commented 2 years ago

I wonder if PipeWire 0.3.58 will have any effect on this bug.

I'll report back after statistically-significant time frame.

Just had the "left channel is somehow random noise, right channel is good." case again. So nothing changed basically.

MrAureliusR commented 2 years ago

I am having a somewhat similar issue; I didn't want to create a new issue in case this is the same bug. I'm on Arch Linux, running KDE Plasma 5.25.5 using Pipewire 0.3.58 and Easyeffects 6.3.0-1. For ages, I've had no issues with EasyEffects. I use it both with the built-in speakers on my laptop, and with my Bluetooth JBL speaker. However, in the last few weeks (I should have noted exactly when but I didn't think of it) if EasyEffects is running, and I try to start an audio stream from any application, the audio stream is unable to start and the application hangs until I move the volume slider in the system tray. Then all of a sudden the program (YouTube in Firefox, VLC, Strawberry, whatever) will suddenly start playing and as long as the audio continues, it keeps playing fine. However, if the audio stops again for any reason (next track in a playlist, buffering, etc) the stream will once again get "hung" until I move the volume slider. The volume slider fix was something I discovered accidentally when trying to figure out what was going on. I don't see anything in dmesg. EasyEffects is installed as a system package from pacman, not as a Flatpak. Looking in various log files, I can't immediately see anything that occurs at the same time as this problem, but I may not be looking in the right places. Checked journalctl for pipewire and pipewire-pulse. I occasionally see some things from easyeffects also but they seem to be related to GTK errors when drawing the interface so likely unrelated.

wwmm commented 2 years ago

if EasyEffects is running, and I try to start an audio stream from any application, the audio stream is unable to start and the application hangs until I move the volume slider in the system tray.

If this is easy to reproduce you are probably seeing a different kind of problem. The bug in this issue is so random that it never happens when I need it to happen.

promeneur commented 2 years ago

After having a problem with the mic (see my previous comment 19 days before.) in EE settings, I disabled the input stream process. Yesterday during a video talk with Skype again, no more mic. My conclusion is the problem does not come from EE, but comes from pipewire. What do you think? Then I enabled the input stream process, then I get a working mic.

wwmm commented 2 years ago

My conclusion is the problem does not come from EE, but comes from pipewire. What do you think?

It is the only explanation I can think of. In the issue I opened at the PipeWire's page I asked if some kind of special procedure was needed when creating/destroying links based on when the players streams enter/exit the playing state. The answer was that things should work out of the box. No delays or special procedures required. So as far as I can see I am doing nothing wrong.

LebedevRI commented 2 years ago

Still happening with pipewire 0.3.59, wireplumber 0.4.11, easyeffects 6.3.0.

nargacu83 commented 2 years ago

I had the same problem and was using wireplumber. I tried to switch to pipewire-media-session, the problem still happened.

The method i used to test was playing a video with Freetube (should be the same with firefox) and have pavucontrol opened on the side to see when the output of the app disappear and when it disappears unpause the video.

It seems like the microphone input works fine while this issue is happening, it appears to be only happening on the ouputs.

Replacing easyeffects with the Flatpak seems to have fixed the issue.

promeneur commented 2 years ago

So now what is the difference between the flatpack version and the openSUSE Tumbleweed version for example ?

nargacu83 commented 2 years ago

So now what is the difference between the flatpack version and the openSUSE Tumbleweed version for example ?

The flatpak version is using it's own dependencies and not the system ones.

I'm surprised to have this issue because i'm on Arch Linux like @wwmm and a friend a mine. Both of them doesn't seem to have the issue.

promeneur commented 2 years ago

The flatpak version is using it's own dependencies and not the system ones.

It's nos sufficient to say this. The question is where is the bug.

For example, openSUSE okular get a bug and not the flatpack version supplied by KDE team. With their help we found that openSUSE okular uses a bad font which leads to a bug. We must inquire with the help of EE team.

wwmm commented 2 years ago

I'm surprised to have this issue because i'm on Arch Linux like @wwmm and a friend a mine. Both of them doesn't seem to have the issue.

This lack of sound is super random and hard to reproduce. I still haven't found a way to make it happen when I want. It is always the same thing. After several hours without issue out of nowhere there is no sound after starting a new stream. I think that of all the software bugs I have ever seen in my life this one is the hardest to figure out. I have absolutely no idea about why it is even happening.

nargacu83 commented 2 years ago

It's nos sufficient to say this. The question is where is the bug.

For example, openSUSE okular get a bug and not the flatpack version supplied by KDE team. With their help we found that openSUSE okular uses a bad font which leads to a bug. We must inquire with the help of EE team.

Yeah sorry about that, i actually don't know what versions of packages it's using. I don't think it really matters because i actually encountered the same issue on the Flatpak version.

This random lack of sound is super random and hard to reproduce. I still haven't found a way to make it happen when I want. It is always the same thing. After several hours without issue out of nowhere there is no sound after starting a new stream. I think that of all the software bugs I have ever seen in my life this one is the hardest to figure out. I have absolutely no idea about why it is even happening.

Agreed 100%, this is really annoying and hard to reproduce. Like you said, sometimes it will not happen at all for hours and sometimes it will happen every time you pause a stream.

I don't know if it's related, it seems to appear when i had the issue happening every time i did a quick journalctl command to check what's happening.

This is the output for journalctl --user -b -u pipewire:

systemd[948]: Started PipeWire Multimedia Service.
pipewire[1031]: mod.rt: Can't find xdg-portal: (null)
pipewire[1031]: mod.rt: found session bus but no portal
pipewire[1031]: spa.audioadapter: 0x55c38a1d8518: scheduling stopped node
pipewire[1031]: spa.audioadapter: 0x55c38a1d8518: scheduling stopped node
pipewire[1031]: spa.audioadapter: 0x55c38a1d8518: scheduling stopped node

This is for journalctl --user -b -u pipewire-media-session:

systemd[948]: Started PipeWire Media Session Manager.
pipewire-media-session[1043]: mod.rt: Can't find xdg-portal: (null)
pipewire-media-session[1043]: mod.rt: found session bus but no portal
pipewire-media-session[1043]: dbus[1043]: Attempted to unregister path (path[0] = MediaEndpoint path[1] = A2DPSink) which isn't registered
pipewire-media-session[1043]: dbus[1043]: Attempted to unregister path (path[0] = MediaEndpoint path[1] = A2DPSink) which isn't registered
pipewire-media-session[1043]: dbus[1043]: Attempted to unregister path (path[0] = MediaEndpoint path[1] = A2DPSink) which isn't registered
etc...
nargacu83 commented 1 year ago

Alright, i've been running easyeffects with this command: G_MESSAGES_DEBUG=easyeffects easyeffects --gapplication-service.

Here's the last few lines:

(easyeffects:25999): easyeffects-DEBUG: 14:53:31.907:   pipe_manager.cpp:1189   Chromium port 110 is connected to easyeffects_sink port 58
(easyeffects:25999): easyeffects-DEBUG: 14:53:31.907:   pipe_manager.cpp:1189   Chromium port 102 is connected to easyeffects_sink port 96
(easyeffects:25999): easyeffects-DEBUG: 14:53:31.908:   stream_output_effects.cpp:156   At least one app linked to our device wants to play. Linking our filters.
(easyeffects:25999): easyeffects-DEBUG: 14:54:09.501:   pipe_manager.cpp:212    Stream/Output/Audio 114 Chromium has been removed

When the issue happened, no new messages appeared. Only when the stream i paused was paused long enough to be removed. Started the stream again and it was working.

I was thinking it might be related on how easyeffects removes streams references or something?

I also ran the same command without --gapplication-service yesterday and i did not encounter the issue at all. Could it also be related to the running in the background thing?

wwmm commented 1 year ago

I was thinking it might be related on how easyeffects removes streams references or something?

Not really. The one removing or adding streams is pipewire. Easyeffects is just listening to these events and linking/unlinking filters accordingly. And these operations succeed. That is why I still think that this bug is on pipewire's side.

I also ran the same command without --gapplication-service yesterday and i did not encounter the issue at all. Could it also be related to the running in the background thing?

Nothing different is done to the way we link/unlink filters when we run in background. We do not have a true service. It is just a gtk app with it's window hidden.

DanMan commented 1 year ago

Since YT videos don't even start playing, it might be that something is waiting for something else to happen, which is why there are basically no errors?

wwmm commented 1 year ago

Since YT videos don't even start playing, it might be that something is waiting for something else to happen, which is why there are basically no errors?

Are you sure they do not start? At least in the occasions where I saw this bug happening on my computer independently from the player used the stream was advancing like there was nothing wrong. If it does not start you may be seeing a slightly different bug.

In this case if there are errors they are not going to be visible in EasyEffects logs. I would expect them to be in PipeWire's logs. By the way if we had a reliable way to reproduce the bug discussed in this issue PipeWire's logs would be the better place to investigate. But as I can't reproduce it when I need it I do not know what PipeWire is actually doing when it happens...

HanabishiRecca commented 1 year ago

If someone needs a hotfix: https://github.com/Audio4Linux/JDSP4Linux/issues/74#issuecomment-1301701043

wwmm commented 1 year ago

If someone needs a hotfix: https://github.com/Audio4Linux/JDSP4Linux/issues/74#issuecomment-1301701043

Interesting. I wonder if the built-in session manager is doing the same thing as wireplumber. I am almost sure I also saw this bug in the past while using the built-in session manager too.

DanMan commented 1 year ago

Are you sure they do not start? At least in the occasions where I saw this bug happening on my computer independently from the player used the stream was advancing like there was nothing wrong. If it does not start you may be seeing a slightly different bug.

100% sure, that's why I thought it was a network issue at first. Video does not move forward in Vivaldi browser.

HanabishiRecca commented 1 year ago

Fix merged to WirePlumber upstream. https://gitlab.freedesktop.org/pipewire/wireplumber/-/merge_requests/450

LebedevRI commented 1 year ago

Still happening with pipewire 0.3.60-1, wireplumber 0.4.12-1+b1, easyeffects 7.0.0-1.

HanabishiRecca commented 1 year ago

wireplumber 0.4.12

Just wait for the next release.

promeneur commented 1 year ago

Hello

pipewire 3.60

For two months, I uninstalled EE.

Yesterday I got again the problem. I was viewing a video with FF. I paused the video, the time to get a coffee. Furthermore, I played the video then no sound. I mute/unmute the speakers at VLC icon (With KDE in the task bar in VLC icon, there is a mini-icon of a speaker for muting/unmuting sound). I also pause/play the video, then I get again the sound.

wwmm commented 1 year ago

Yesterday I got again the problem.

For some reason I haven't seen this bug on my system for a few months. But based on one of the comments a PipeWire developer made in the issue I opened there this bug should still be present indeed. He does not think that the fix to wireplumber will solve this one :-(.

Elendil211 commented 1 year ago

I have a similar problem that might be the same bug. It happens with Chromium and FreeTube. It happens very reliable so this might help?

Every time I have EasyEffects open, and then join a jitsi meeting with Chromium, I have neither sound, nor video (can't talk, can't hear anything, can't start my camera). This happens in 100% of times. When I start the meeting first, and then open EasyEffects, everything works fine.

When I start a video on FreeTube and have EasyEffects running, in 100% of cases no video plays sound, and in 90% of cases no video plays. When I start EasyEffects after starting the video, everything works fine.

The same video works fine in Chromium (also in Firefox).

It is not important whether or not I check the audio source in EasyEffects, or whether I start EasyEffects or Chromium/FreeTube first.

FreeTube is Electron based, and shows as Chromium in EasyEffects, so it's very similar in that regard.

This was not always a problem, but started happening some time ago, maybe two weeks to a month ago or so.

wwmm commented 1 year ago

Every time I have EasyEffects open, and then join a jitsi meeting with Chromium, I have neither sound, nor video (can't talk, can't hear anything, can't start my camera).

I think you are the second person to report that videos do not start in some situations. This is something I have never seen in my computers and really sounds like a PipeWire problem. It does not make any sense something in EasyEffects would do this.

It happens very reliable so this might help?

As you are able to reproduce this reliably my suggestion is trying to get PipeWire logs and reporting this whole video not playing issue to them. The issue discussed in this thread may or may not be related to how EasyEffects is doing things. But videos not playing is definitely caused by some flaw on PipeWire's side.

HanabishiRecca commented 1 year ago

WirePlumber 0.4.13 released

Fixes:

  • Worked around an issue that would prevent streams from properly linking when using effects software like EasyEffects and JamesDSP
DanMan commented 1 year ago

videos not playing is definitely caused by some flaw on PipeWire's side

Certainly possible, but I can reliably prevent all issues by simply not launching EE. So it appears to be something about how they interact.

wwmm commented 1 year ago

Certainly possible, but I can reliably prevent all issues by simply not launching EE. So it appears to be something about how they interact.

There isn't much to be done. We just load the filters and link them on demand based on whether there are audio players active or not. Once the links are made everything is done by pipewire. We do not even have a way to pause the pipeline for example. It is all handled internally by pipewire.

Compared to not using easyeffects the main difference is that the audio player is linked to a null-sink that we create using a pipewire module. So again pipewire's code.

LebedevRI commented 1 year ago

"No audio in one of the channels" is still happening with

ii  wireplumber                                      0.4.13-1                                                     amd64        modular session / policy manager for PipeWire

Will get the debug logs next time ithappens...

wwmm commented 1 year ago

No audio in one of the channels" is still happening with

So as suspected by one of PipeWire developers the wireplumber patch is fixing another problem. That is unfortunate but it makes some sense. I think that in the wireplumber issue the player was not being liked to the sink. This is not what happens here. All the links are made and are active. But somehow there is no sound.

LebedevRI commented 1 year ago

Observation: this seems to reliable happen when there is an audio playback (a chrome tab with youtube), that you pause, don't close the tab, and resume some time later, like 10+ minutes later.

LebedevRI commented 1 year ago

pw-dump.txt pw.dot.txt