-
-
Notifications
You must be signed in to change notification settings - Fork 265
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
Easyeffect doesn't recconect to the "default" device #2920
Comments
Kill it and restart in debug mode |
In the debug log I see the event when the device is turned on again but then we had an error. Here the sequence after I turn off and on the device:
|
Does it change to the
I definitely do not see these errors here on Arch Linux. If they are the cause of the problem I do not know. But it is not normal to have them. What PipeWire version is being reported by EasyEffects logs? |
At least not in the native package. I am not sure if in the Flatpak package this is a normal. |
The log was just after the device switched on. Here the sequence usb device on and play e.g. spotify client and then stop:
Device off
Device on
|
Ok. So EasyEffects sees that your usb device came back. In the beginning of its logs it shows which devices PipeWire reports as default. What is there? Also try to do the following test. Go to the pipewire tab in EasyEffects and set your usb device as EasyEffects output instead of the automatic default device selection. Does the audio comes back when the usb device comes back? |
I've already tested this. When the usb device power off it switch to the "fallback" internal device. When it is power on it stay on the "fallback device" also if I have specifically selected the usb one before power off. Of course If I manually switch there after the usb device comes back it is going to work again. |
Could this be related to https://gitlab.freedesktop.org/pipewire/wireplumber/-/merge_requests/384? But it seems it was fixed a long time ago. |
As I see in the previous pasted logs: |
This error is only relevant for the preset autoloading. But besides the fact that it is not always a reason for concerning the issue you are facing can not be caused by a broken autoloading. The most that a broken autoloading can do is not loading your preset automatically. You would still have audio. |
Based on the logs and on the bug it seems that the reason is PipeWire not broadcasting the default device change signal even if at the end of the day the default device actually changed. Otherwise you would see EasyEffects printing lines about the "new default device". I wonder if usb devices make PipeWire behave differently somehow. When I switch the default device between my onboard card and the hdmi cards on my gpu everything is fine. Even if I disable the cards in Pavucontrol nothing breaks. It seems that having an external usb device that can actually be turned off on the hardware level changes something... |
@wwmm I agree that it's probably pipewire (or some other system component); since the device is not simply disabled, it's gone, there must be some hidden complexity in identifying that the same device was plugged back in, and should be made default automatically. |
But why instead clients are able to play again on the right device without Easy effects? |
That is easy to understand. WirePlumber and PipeWire always know which is the default device because they are the ones managing them. But clients like EasyEffects will only know about a new device if PipeWire emits a signal to broadcast the change. If this signal does not come EasyEffects will behave like nothing happened. What so far seems to be the case. |
WirePlumber is the one moving streams to the correct devices. In EasyEffects when you "enable effects" to a stream what happens at the end of the day is that we ask wireplumber to move the stream to our virtual devices. So as long as a link is managed directly by wireplumber things will always work. That is the case for links between streams and devices. But links involving filters require manual management. Unfortunately... These ones EasyEffects has to create itself. And for that it needs to know the correct output device. |
How can we debug what the current default device is? |
You should be able to see by just looking what device has the checkmark button enabled in pavucontrol |
No I meant the event that you are looking for as the default with |
When you run EE in debug mode you will see at the beginning of its logs lines similar to these ones
After this when you change the default in a program like pavucontrol lines similar to these ones are shown
Pay attention to the log message that starts with "new default output device". The absence of a line like this one in your logs is probably related to the bug. |
What I don't understand is that I see the device in the EE dropdown list when it is again power on but it is not the default one. So you see in the device list but not as the default? is it here? easyeffects/src/pipe_manager_box.cpp Lines 621 to 640 in 68fe843
|
An interesting hint.. when we put down the usb device we don't have any default sinks with |
So I think that we need to manage this on our side right? |
Just seeing that the device is there is not enough. There has to be a reason for EE to use it. Either the user manually selected it as custom output device or the device is the system default device.
I think that what makes sense to be done on our side is already there. If EE is set to use the default PipeWire just has to tell which device is default. And if EE is configured to use a custom device all that is needed is that the device comes back with the same node name easyeffects/src/stream_output_effects.cpp Line 195 in 68fe843
But it seems that both conditions are somehow false...
I do not think that it is possible to actually not have a default device. Wpctl may be showing just what was explicitly set byt the user and not what wireplumber does on its own. For example plenty of EE users had problems caused by the fact wireplumber decided to set EE virtual devices as default without asking. There is definitely something set as default. |
The code at line 621 will only be executed if PipeWire emits the default device changed signal. |
I did some tests with my soundcards and I see now that this is not going to work. The reason is that if the device disappears we have to do something. And the "something" at this moment is setting the output device to the default device. So even if the other device comes back EE internal variable has already been updated with the default device name... |
The problem is that it does not make sense to keep the output device variable set to a node that may never come back. So the ideal solution would be the default device signal to be triggered when the external usb device is turned on again. |
Hum... But if it was "just recovered" I would assume that the previous default device information that was set would still be useful. But if EasyEffects automatically switched to your onboard card after the usb device was turned off then pipewire probably emitted a signal telling that the default device is another. Are you sure that your log does not have any line about default device changes? |
If you recheck the device off log at #2920 (comment) We don't have any new default just a termination of the usb one. it is consistent with |
So my opinion is that the EE logic need to be that when an new event |
But it is not only related to USB. If am going to manually set EE to the internal device and I disable it with So are we doing something wrong in EE flatpack? |
This is a different thing. When The manual selection completely disables the use of the automatic switch to the default device. The current default not necessarily being used in the manual mode can even be what is desired in systems with multiple cards. The real issue here is happening when |
I understand your logic but the point, with all the tests that we have done (and I've just checked it again) is that also when I set the system default to the internal one and I disable it with This why I think it has something to do with flatpack and not a usb specific pipewire issue. |
Yes. This shouldn't be happening to the onboard card too.
But somehow it does not seem to be happening to all Flatpak users. So we are still missing something. |
It is something else as I've tested with a non flatpack EE and I don't see |
I have updated the master branch with a fix for the dropdown messing with the
Ok. So we can exclude a Flatpak issue. |
Did you see that "spa_pod_array" error outside of Flatpak too? |
Yes Also if we don't use |
Strange. As far as I know both programs are still Pulseaudio apps and should be using the same functions to deal with devices. It is unexpected that they lead to different results. |
I don't know if it is the same or not but if I switch the sink command line with So disable and enable the device with |
I understand |
In any case I do not think that Pulseaudio's compatibility layer should be broken. It is supposed to just work for things related to default device management. |
Gnome shell is calling (with the gjs introspection) this underline function when we switch the device: |
I looked at the code in gnome's gvc libray and it still uses Pulseaudio's calls. So PipeWire's compatibility layer does not seem to the what is causing the difference. |
What I can tell you is that in |
Also I want to confirm that switching device with the Gnome official selector: It is going to effectively change the wireplumber default Instead switching on and off the device from So it seems that the pulseaudio API called by Do you know what is it calling as I don't find exactly the widget? |
In Pavucontrol we change the card profile to off to disable it. They seem to do this in this line https://gitlab.freedesktop.org/pulseaudio/pavucontrol/-/blob/master/src/cardwidget.cc?ref_type=heads#L125 through a call to |
I am not sure I understand. Switching devices and changing card profiles are very different operations. |
I meant that switching the device profile to off we don't have any Instead they are aligned and we regularly receive
|
I know that with workaround that we have in main it will solve when the default device is not manually selected in EasyEffect UI but do you want to investigate more on the general case? What do you think about my last message? |
I think that just like it happened in #2951 we will need some feedback from PipeWire's or WirePlumber's developers about the facts at #2920 (comment). Some kind of corner case not well handled by the audio server is at play here. |
Mhh but I don't know exactly how to describe this issue on pipewire or wireplumber cause I don't know what is the expected behavior. Cause what I see in |
I think that there are two things that are not making sense in the server behavior. The first is why the default device shown by |
Are you sure about this? Is this in the wireplumber or in the pipewire ownership? Cause if this is in the wireplumber ownership this doesn't seem to be its logic as it doesn't change the default and it could recover it when the device is on without any notification of new default. |
PipeWire and WirePlumber are doing it on my computer. It does not matter which program I use to set the default. The signal about default device changes is always emitted when plug/unplug my bluetooth headset or usb microphone. The signal is emitted even if the default device change was triggered without manual intervention. For example if my bluetooth device is plugged and I turn it off my onboard card becomes the default automatically. And the signal is emitted without the need for me to set anything manually. That is what should be happening on your setup. |
Before opening an upstream Pipewire ticket let see if @wtay can give us a feedback here. |
In the meantime I have also a ticket on wireplumber: |
@wwmm The different behavior we had between the two systems probably it is fixed in wireplumber https://gitlab.freedesktop.org/pipewire/wireplumber/-/merge_requests/615 |
Fixed in |
EasyEffects Version
7.1.4
What package are you using?
Flatpak (Flathub)
Distribution
Ubuntu
Describe the bug
When we have easyeffect running and we switch off and on an usb output device easyeffect doesn't reconnect to the "default" device.
Without easyeffect running clients correctly reconnect to the default sink device.
Check
Expected Behavior
No response
Debug Log
Debug Log
Additional Information
No response
The text was updated successfully, but these errors were encountered: