netblue30 / firejail

Linux namespaces and seccomp-bpf sandbox
https://firejail.wordpress.com
GNU General Public License v2.0
5.79k stars 567 forks source link

rhythmbox: media keys do not work #3822

Open reinerh opened 3 years ago

reinerh commented 3 years ago

Someone reported at #977455 that meda keys (play, pause, next, ...) are not working when using Rhythmbox in firejail. He assumes that it might be related to dbus filtering. Does someone know how this could be debugged, or is even able to reproduce it?

rusty-snake commented 3 years ago

Works for me.

Rhythmbox: 3.4.4 OS: Fedora-32 GNOME: 3.36.8 rhythmbox.local:

include deny-python2.inc
include deny-python3.inc

mkdir ${HOME}/.local/share/rhythmbox
whitelist ${HOME}/.local/share/rhythmbox
include whitelist-common.inc

dbus-system none

We have org.mpris.MediaPlayer2.rhythmbox, org.gnome.UPnP.MediaServer2.Rhythmbox and org.gnome.SettingsDaemon.MediaKeys in the profile.

$ flatpak remote-info --system flathub -m  org.gnome.Rhythmbox3
[Application]
name=org.gnome.Rhythmbox3
runtime=org.gnome.Platform/x86_64/3.38
sdk=org.gnome.Sdk/x86_64/3.38
command=rhythmbox

[Context]
shared=network;ipc;
sockets=x11;wayland;pulseaudio;fallback-x11;
devices=dri;
filesystems=xdg-run/dconf;xdg-music;~/.config/dconf:ro;

[Session Bus Policy]
org.mpris.MediaPlayer2.rhythmbox=own
org.gnome.UPnP.MediaServer2.Rhythmbox=own
org.gtk.vfs.*=talk
org.gnome.SettingsDaemon.MediaKeys=talk
org.freedesktop.Notifications=talk
org.gtk.vfs=talk
ca.desrt.dconf=talk

[System Bus Policy]
org.freedesktop.Avahi=talk

[Environment]
GIO_USE_VOLUME_MONITOR=unix
DCONF_USER_CONFIG_DIR=.config/dconf

If D-Bus is the problem, firejail --ignore="dbus-user filter" rhythmbox should work.

Other guesses:

EDIT: D-Bus errors are usually printed to the terminal (GTK just says failed, while KDE also says what failed). (AT-SPI is expected to fail).

eighthave commented 3 years ago

Media keys seem to work after reboot for a while. I think what breaks it is if another app steals the media key. For example, if Chromium is playing a YouTube video, the media key are sent to that instead of Rhythmbox. After that happens, Rhythmbox cannot receive them again. Running with firejail --ignore="dbus-user filter" rhythmbox did fix the media keys in this state.

Some more debug info:

 ~ $ dpkg -l firejail*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name              Version          Architecture Description
+++-=================-================-============-===============================================
ii  firejail          0.9.64-1~bpo10+1 amd64        sandbox to restrict the application environment
ii  firejail-profiles 0.9.64-1~bpo10+1 all          profiles for the firejail application sandbox
 ~ $ 
 ~ $ export |grep -e LC_ -e LANG
declare -x GDM_LANG="en_US.UTF-8"
declare -x LANG="en_US.UTF-8"
declare -x LC_MEASUREMENT="de_AT.UTF-8"
declare -x LC_MONETARY="de_AT.UTF-8"
declare -x LC_NUMERIC="de_AT.UTF-8"
declare -x LC_PAPER="de_AT.UTF-8"
declare -x LC_TIME="de_AT.UTF-8"

(rhythmbox:5): Rhythmbox-WARNING **: 14:55:03.025: Unable to send property changes for MediaServer2 container /org/gnome/UPnP/MediaServer2/Library: The connection is closed

(rhythmbox:5): Rhythmbox-WARNING **: 14:55:03.025: Unable to emit Updated signal for MediaServer2 container /org/gnome/UPnP/MediaServer2/Library/all: The connection is closed

(rhythmbox:5): Rhythmbox-WARNING **: 14:55:03.025: Unable to send property changes for MediaServer2 container /org/gnome/UPnP/MediaServer2/Playlists/94922477141136: The connection is closed

(rhythmbox:5): Rhythmbox-WARNING **: 14:55:03.025: Unable to emit Updated signal for MediaServer2 container /org/gnome/UPnP/MediaServer2/Playlists/94922477141136: The connection is closed



* `/usr/bin/rhythmbox` works
* `firejail --ignore="dbus-user filter" rhythmbox` works
* `firejail rhythmbox --disable-plugins` works, but without media keys (provided by MPRIS plugins)
rusty-snake commented 3 years ago

Any progress here?