mate-desktop / mate-settings-daemon

MATE settings daemon
https://mate-desktop.org
GNU General Public License v2.0
44 stars 46 forks source link

media volume keys don't work fine when switching HDMI configuration #343

Open mchehab opened 3 years ago

mchehab commented 3 years ago

Expected behaviour

The media hot keys will always change the volumes for the @DEFAULT_SINK@

Actual behaviour

When the audio output switch is changed, sometimes it doesn't follow the default volume change.

When pulseaudio is used, the OSD is updated, but the volume is not touched.

When it is replaced with pipewire, the OSD doesn't even appear.

Steps to reproduce the behaviour

The best way to reproduce the bug is using pipewire, on a machine with two monitors connected via snd-hda-intel driver.

# copr https://copr.fedorainfracloud.org/coprs/jafd/pipewire-unstable/repo/fedora-33/jafd-pipewire-unstable-fedora-33.repo
# dnf swap pulseaudio pipewire-pulseaudio --allowerasing 

Then, use pavucontrol to switch the output of the HDMI monitor.

MATE general version

1.24.1

Package version

mate-notification-daemon-1.24.1-1.fc33.x86_64 pipewire-libs-0.3.17-3.fc33.x86_64 pipewire-0.3.17-3.fc33.x86_64 pipewire-pulseaudio-0.3.17-3.fc33.x86_64 pipewire-alsa-0.3.17-3.fc33.x86_64 pipewire-gstreamer-0.3.17-3.fc33.x86_64 pipewire-libjack-0.3.17-3.fc33.x86_64 pipewire-plugin-jack-0.3.17-3.fc33.x86_64 pipewire-utils-0.3.17-3.fc33.x86_64

Linux Distribution

Fedora 33

Link to bugreport of your Distribution (requirement)

https://bugzilla.redhat.com/show_bug.cgi?id=1907617

raveit65 commented 3 years ago

I have uninstalled pipewire because it make problems in my f32 installation :)

mchehab commented 3 years ago

I have uninstalled pipewire because it make problems in my f32 installation :)

Well, there's a proposal to make it default on Fedora 34:

So, better to have it fixed before that ;-)

I installed it here yesterday, in order to give it a try. Its support for both Jack and PA clients seems really cool. I did a few tests with both PA-based and Jack-based apps. So far, I didn't notice too much problems.

raveit65 commented 3 years ago

Np, systemctl --user mask pipewire pipewire-pulse

NinjaCowboy commented 7 months ago

I'm experiencing this problem as well. It may be related to https://github.com/mate-desktop/mate-media/issues/164. In my case, this is caused by a race condition between pipewire and mate-settings-daemon. Simply adding the pipewire command to Startup Applications will not work, since doing that will cause mate-settings-daemon to start before pipewire. For the volume keys to work properly, pipewire must be started before mate-settings-daemon. I haven't figured out a clean way to do this yet. There is a configurable delay in Startup Applications, but mate-settings-daemon seems to completely ignore it for some reason (possibly a bug).

As a workaround, I've disabled both mate-settings-daemon and pipewire in Startup Applications, then added a new command to do sh -c 'pipewire & /usr/libexec/mate-settings-daemon'. However, this ends up starting after Caja, so all Caja windows end up with the wrong (Adwaita) theme.

NinjaCowboy commented 7 months ago

I've finally found a solution that works! I leave mate-settings-daemon enabled in Startup Applications like it normally is. Then I add a pipewire entry with the command sh -c 'pipewire & /usr/libexec/mate-settings-daemon --replace' and set its delay to 3 seconds. This allows mate-settings-daemon to start first like it normally does, then pipewire gets started and then mate-settings-daemon gets started again, replacing the previous instance.

You can also drop this file (remove the .txt extension) into ~/.config/autostart for the same effect.