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

EasyEffects loses audio stream on device port changes #1393

Closed
Digitalone1 opened this issue Feb 9, 2022 · 12 comments
Closed

EasyEffects loses audio stream on device port changes #1393

Digitalone1 opened this issue Feb 9, 2022 · 12 comments

Comments

@Digitalone1
Copy link
Contributor

EasyEffects Version

6.2.3 git master

What package are you using?

AUR (easyeffects-git)

Distribution

Arch Linux

Describe the bug

EE is not redirecting audio stream to it's processing sink after the device port is changed (I call it "port" because pavucontrol names it that way, I don't remember how it's named in PipeWire, maybe route; it's basically the change from speaker to headphones or vice versa on the same device).

This issue was not occurring before. Surely it was not happening two days ago. It should be related to the new wireplumber 0.4.8-1 update on Arch Linux.

I can easily reproduce it every time.

  1. Start playing with mpv on speakers.
  2. EE is processing.
  3. Pause reproduction.
  4. Plug in headphones.
  5. Unplug headphones, return to speakers.
  6. Resume reproduction.
  7. EE is not processing.

Same issue starting on headphones, then unplugging and replugging in. EE sink does not receive audio stream: mpv has been redirected to default output device.

Expected Behavior

The same as before. EE keeps getting audio stream from the player. The player is not redirected to default device on port changes.

Debug Log

mpv start on headphones
(easyeffects:2121): easyeffects-DEBUG: 22:58:36.511: pipe_manager: Stream/Output/Audio 100 mpv with timestamp 1644443916511465305 was added
(easyeffects:2121): easyeffects-DEBUG: 22:58:36.514: pipe_manager: new metadata property: 100, target.node, Spa:Id, 105
(easyeffects:2121): easyeffects-DEBUG: 22:58:36.534: pipe_manager: mpv port 99 is connected to easyeffects_sink port 84
(easyeffects:2121): easyeffects-DEBUG: 22:58:36.534: pipe_manager: mpv port 98 is connected to easyeffects_sink port 106
(easyeffects:2121): easyeffects-DEBUG: 22:58:45.069: soe: limiter latency: 0.005125 s
(easyeffects:2121): easyeffects-DEBUG: 22:58:45.076: soe: output_level: new PipeWire blocksize: 2048
pause and headphones unplugged
(easyeffects:2121): easyeffects-DEBUG: 22:59:02.519: pipe_manager: new metadata property: 0, default.audio.source, Spa:String:JSON, {"name":"alsa_output.pci-0000_00_14.2.analog-stereo"}
(easyeffects:2121): easyeffects-DEBUG: 22:59:02.519: application: device alsa_card.pci-0000_00_14.2 has changed its input route to: analog-input-internal-mic
(easyeffects:2121): easyeffects-DEBUG: 22:59:02.521: presets_manager: autoloading preset Empty for device alsa_input.pci-0000_00_14.2.analog-stereo
(easyeffects:2121): easyeffects-DEBUG: 22:59:02.522: presets_manager: loaded preset: /home/ggius/.config/easyeffects/input/Empty.json
(easyeffects:2121): easyeffects-DEBUG: 22:59:02.556: pipe_manager: new metadata property: 0, default.audio.sink, Spa:String:JSON, {"name":"easyeffects_sink"}
(easyeffects:2121): easyeffects-DEBUG: 22:59:02.556: pipe_manager: new metadata property: 0, default.audio.source, Spa:String:JSON, {"name":"alsa_input.pci-0000_00_14.2.analog-stereo"}
(easyeffects:2121): easyeffects-DEBUG: 22:59:02.556: new default input device: alsa_input.pci-0000_00_14.2.analog-stereo
(easyeffects:2121): easyeffects-DEBUG: 22:59:02.557: presets_manager: autoloading preset Empty for device alsa_input.pci-0000_00_14.2.analog-stereo
(easyeffects:2121): easyeffects-DEBUG: 22:59:02.557: presets_manager: loaded preset: /home/ggius/.config/easyeffects/input/Empty.json
(easyeffects:2121): easyeffects-DEBUG: 22:59:02.571: pipe_manager: new metadata property: 100, target.node, , 
(easyeffects:2121): easyeffects-DEBUG: 22:59:02.577: application: device alsa_card.pci-0000_00_14.2 has changed its output route to: analog-output-speaker
(easyeffects:2121): easyeffects-DEBUG: 22:59:02.578: presets_manager: autoloading preset LoudnessEqualizerSpeaker for device alsa_output.pci-0000_00_14.2.analog-stereo
(easyeffects:2121): easyeffects-DEBUG: 22:59:02.579: soe: pipeline latency: 0.000000 ms
(easyeffects:2121): easyeffects-DEBUG: 22:59:02.579: soe: disconnecting the crossfeed filter from PipeWire
(easyeffects:2121): easyeffects-DEBUG: 22:59:02.582: pipe_manager: new metadata property: 0, default.audio.sink, Spa:String:JSON, {"name":"alsa_output.pci-0000_00_14.2.analog-stereo"}
**(easyeffects:2121): easyeffects-DEBUG: 22:59:02.591: pipe_manager: mpv port 99 is connected to alsa_output.pci-0000_00_14.2.analog-stereo port 42**
**(easyeffects:2121): easyeffects-DEBUG: 22:59:02.591: pipe_manager: mpv port 98 is connected to alsa_output.pci-0000_00_14.2.analog-stereo port 44**
(easyeffects:2121): easyeffects-DEBUG: 22:59:02.592: soe: filter successfully connected to PipeWire graph
(easyeffects:2121): easyeffects-DEBUG: 22:59:02.646: presets_manager: loaded preset: /home/ggius/.config/easyeffects/output/LoudnessEqualizerSpeaker.json
(easyeffects:2121): easyeffects-DEBUG: 22:59:02.667: new default output device: alsa_output.pci-0000_00_14.2.analog-stereo
(easyeffects:2121): easyeffects-DEBUG: 22:59:02.668: presets_manager: autoloading preset LoudnessEqualizerSpeaker for device alsa_output.pci-0000_00_14.2.analog-stereo
(easyeffects:2121): easyeffects-DEBUG: 22:59:02.684: presets_manager: loaded preset: /home/ggius/.config/easyeffects/output/LoudnessEqualizerSpeaker.json
headphones plugged in and resume mpv reproduction
(easyeffects:2121): easyeffects-DEBUG: 22:59:26.511: pipe_manager: new metadata property: 0, default.audio.sink, Spa:String:JSON, {"name":"easyeffects_sink"}
(easyeffects:2121): easyeffects-DEBUG: 22:59:26.519: application: device alsa_card.pci-0000_00_14.2 has changed its output route to: analog-output-headphones
(easyeffects:2121): easyeffects-DEBUG: 22:59:26.519: pipe_manager: mpv port 99 is connected to easyeffects_sink port 84
(easyeffects:2121): easyeffects-DEBUG: 22:59:26.519: pipe_manager: mpv port 98 is connected to easyeffects_sink port 106
(easyeffects:2121): easyeffects-DEBUG: 22:59:26.519: presets_manager: autoloading preset LoudnessEqualizerHeadphones for device alsa_output.pci-0000_00_14.2.analog-stereo
(easyeffects:2121): easyeffects-DEBUG: 22:59:26.521: soe: pipeline latency: 0.000000 ms
(easyeffects:2121): easyeffects-DEBUG: 22:59:26.521: soe: disconnecting the filter filter from PipeWire
(easyeffects:2121): easyeffects-DEBUG: 22:59:26.533: pipe_manager: new metadata property: 0, default.audio.sink, Spa:String:JSON, {"name":"alsa_output.pci-0000_00_14.2.analog-stereo"}
**(easyeffects:2121): easyeffects-DEBUG: 22:59:26.541: pipe_manager: mpv port 99 is connected to alsa_output.pci-0000_00_14.2.analog-stereo port 42**
**(easyeffects:2121): easyeffects-DEBUG: 22:59:26.541: pipe_manager: mpv port 98 is connected to alsa_output.pci-0000_00_14.2.analog-stereo port 44**
(easyeffects:2121): easyeffects-DEBUG: 22:59:26.547: soe: crossfeed successfully connected to PipeWire graph
(easyeffects:2121): easyeffects-DEBUG: 22:59:26.581: presets_manager: loaded preset: /home/ggius/.config/easyeffects/output/LoudnessEqualizerHeadphones.json
(easyeffects:2121): easyeffects-DEBUG: 22:59:26.582: new default output device: alsa_output.pci-0000_00_14.2.analog-stereo
(easyeffects:2121): easyeffects-DEBUG: 22:59:26.582: presets_manager: autoloading preset LoudnessEqualizerHeadphones for device alsa_output.pci-0000_00_14.2.analog-stereo
(easyeffects:2121): easyeffects-DEBUG: 22:59:26.599: presets_manager: loaded preset: /home/ggius/.config/easyeffects/output/LoudnessEqualizerHeadphones.json
(easyeffects:2121): easyeffects-DEBUG: 22:59:26.757: pipe_manager: new metadata property: 0, default.audio.source, Spa:String:JSON, {"name":"alsa_output.pci-0000_00_14.2.analog-stereo"}
(easyeffects:2121): easyeffects-DEBUG: 22:59:26.757: application: device alsa_card.pci-0000_00_14.2 has changed its input route to: analog-input-mic
(easyeffects:2121): easyeffects-DEBUG: 22:59:26.770: pipe_manager: new metadata property: 0, default.audio.source, Spa:String:JSON, {"name":"alsa_input.pci-0000_00_14.2.analog-stereo"}
(easyeffects:2121): easyeffects-DEBUG: 22:59:26.771: new default input device: alsa_input.pci-0000_00_14.2.analog-stereo

Additional Information

No response

@wwmm
Copy link
Owner

wwmm commented Feb 9, 2022

I have seen more problems lately with headphones connection/disconnection. I did not have time yet for a full investigation but at least on my side it seems random. Sometimes it is fine sometimes it isn't. What is the output of pw-dot when it happens to you? You can see the output with xdot. Are all the links correct?

@wwmm
Copy link
Owner

wwmm commented Feb 9, 2022

mpv has been redirected to default output device.

Oh... That is weird...

@Digitalone1
Copy link
Contributor Author

What is the output of pw-dot when it happens to you? You can see the output with xdot. Are all the links correct?

I will post the output of pw-dot, but for now I can say that from helvum I was able to see mpv connected directly to the output device rather than EE sink.

I'm pretty sure it is related to the last wireplumber update. I will downgrade and let you know.

@sinatosk
Copy link

sinatosk commented Feb 10, 2022

I too have this issue with wireplumber 0.48, downgraded to wireplumber 0.4.7 on arch linux and it's working again using EE 6.2.3

When I open the EE GUI and unplug then plug I can sometimes see the toggle button on the app to appear on or off ( it's random ) everytime I plug/unplug but EE is not processing anything. If I toggle it to appear enabled, EE starts processing again until I unplug/plug again

@Digitalone1
Copy link
Contributor Author

I too have this issue with wireplumber 0.48, downgraded to wireplumber 0.4.7 on arch linux and it's working again using EE 6.2.3

Thanks for testing it out, I was quite sure 0.4.7 was working properly because I played content with it not having issues.

But I switched back to pipewire-media-session. No issues with it too. The problem should be related to some new behavior of wireplumber redirecting all sinks to the new default device.

Attached pw.dot.txt output, it's showing the same I was seeing in helvum: mpv connected directly to output device, EE sink disconnected.

I will stick to pipewire-media-session. Honestly, never understood which benefits wireplumber is supposed to offer. When I have time I will report the issue on wireplumber gitlab.

@sinatosk
Copy link

I too have this issue with wireplumber 0.48, downgraded to wireplumber 0.4.7 on arch linux and it's working again using EE 6.2.3

Thanks for testing it out, I was quite sure 0.4.7 was working properly because I played content with it not having issues.

But I switched back to pipewire-media-session. No issues with it too. The problem should be related to some new behavior of wireplumber redirecting all sinks to the new default device.

Attached pw.dot.txt output, it's showing the same I was seeing in helvum: mpv connected directly to output device, EE sink disconnected.

I will stick to pipewire-media-session. Honestly, never understood which benefits wireplumber is supposed to offer. When I have time I will report the issue on wireplumber gitlab.

I think pipewire-media-session is some kind of reference implementation of the idea of media session and wireplumber is an intended ready to use media session implementation

I won't use pipewire-media-session because development of it is reduced/stopped

@wwmm
Copy link
Owner

wwmm commented Feb 10, 2022

I won't use pipewire-media-session because development of it is reduced/stopped

And on top of that we may not have the option of using the built-in media session in the future. There is a clear intention of delegating this functionality to WirePlumber. So it would be good if one of you reported this to them so it gets fixed. Somehow I still could not reproduce this particular bug here on my PC.

@Digitalone1
Copy link
Contributor Author

Digitalone1 commented Feb 10, 2022

Reported to wireplumber devs. https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/192

I think pipewire-media-session is some kind of reference implementation of the idea of media session and wireplumber is an intended ready to use media session implementation

I won't use pipewire-media-session because development of it is reduced/stopped

No doubts. But if these issues occur (and frankly, they are quite annoying), it means wireplumber is not stable yet, at least for being used in conjunction with EE. So it's worth to give pw media session a try until wireplumber becomes quite mature.

@bdaase
Copy link

bdaase commented Feb 16, 2022

It looks like I'm also affected by this.
However, in my case it's sometimes enough to make the easyeffects window visible again...

@pv
Copy link
Contributor

pv commented Feb 27, 2022

What is the actual behavior that should be fixed?

How does easyeffect force applications to be directed to somewhere? Via setting default.configured.audio.sink in metadata, and that is no longer respected? Or setting application target.node metadata, that gets unset or is not respected?

@wwmm
Copy link
Owner

wwmm commented Feb 28, 2022

How does easyeffect force applications to be directed to somewhere? Via setting default.configured.audio.sink in metadata, and that is no longer respected?

No. Setting the default medata is not the best way to redirect applications output. We call set_metadata_target_node and ask the PipeWire's media session manager to move the stream to our virtual device. And that is working. But what @Digitalone1 reported is that WirePlumber is deciding to move the application back to the default device in some situations.

I plug and unplug headphones and micropphones to my onboard soundcard regularly but I did not notice this problem yet. So it is not obvious to me what exactly is going wrong inside WirePlumber.

@Digitalone1
Copy link
Contributor Author

This issue will be resolved on the next wireplumber release. wireplumber-git already contains the fix.

https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/192#note_1287994

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants