[snap] cannot pause video with bluetooth headset buttons any more (MPRIS denied by apparmor)

Bug #1849105 reported by Marius Gedminas
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
chromium-browser (Ubuntu)
Fix Released
Medium
Olivier Tilloy

Bug Description

On Ubuntu 19.04 I could press the button on my Bluetooth headset and the YouTube video playing in my Chromium would pause/resume. This no longer works in 19.10. What happens instead is I get an OSD popup with a NO ENTRY symbol (circle with a diagonal backslash) from gnome-shell.

I suspect the additional sandboxing of the snap package is the culprit.

ProblemType: Bug
DistroRelease: Ubuntu 19.10
Package: chromium-browser 76.0.3809.100-0ubuntu1~snap1
ProcVersionSignature: Ubuntu 5.3.0-13.14-generic 5.3.0
Uname: Linux 5.3.0-13-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.11-0ubuntu8
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
DRM.card0-DP-1:
 enabled: disabled
 dpms: Off
 status: disconnected
 edid-base64:
 modes:
DRM.card0-DP-2:
 enabled: disabled
 dpms: Off
 status: disconnected
 edid-base64:
 modes:
DRM.card0-HDMI-A-1:
 enabled: disabled
 dpms: Off
 status: disconnected
 edid-base64:
 modes:
DRM.card0-HDMI-A-2:
 enabled: disabled
 dpms: Off
 status: disconnected
 edid-base64:
 modes:
DRM.card0-eDP-1:
 enabled: enabled
 dpms: On
 status: connected
 edid-base64: AP///////wAGry1aAAAAAAAcAQSlHRF4Au6Vo1RMmSYPUFQAAAABAQEBAQEBAQEBAQEBAQEBtDeAoHA4PkA6KjUAJaUQAAAYAAAADwAAAAAAAAAAAAAAAAAgAAAA/gBBVU8KICAgICAgICAgAAAA/gBCMTMzSEFOMDUuQSAKAHA=
 modes: 1920x1080
Date: Mon Oct 21 15:04:13 2019
DiskUsage:
 Filesystem Type Size Used Avail Use% Mounted on
 /dev/nvme0n1p5 ext4 284G 208G 62G 78% /
 tmpfs tmpfs 7,7G 122M 7,6G 2% /dev/shm
 /dev/nvme0n1p5 ext4 284G 208G 62G 78% /
EcryptfsInUse: Yes
InstallationDate: Installed on 2019-06-12 (130 days ago)
InstallationMedia: Ubuntu 19.04 "Disco Dingo" - Release amd64 (20190416)
MachineType: LENOVO 20Q0CTO1WW
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-5.3.0-13-generic root=UUID=ad2946f7-6a38-471f-b7d1-779e8e9fd109 ro quiet splash vt.handoff=7
Snap.ChromeDriverVersion: ChromeDriver 77.0.3865.120 (416d6d8013e9adb6dd33b0c12e7614ff403d1a94-refs/branch-heads/3865@{#884})
Snap.ChromiumVersion: Chromium 77.0.3865.120 snap
SourcePackage: chromium-browser
UpgradeStatus: Upgraded to eoan on 2019-10-18 (2 days ago)
dmi.bios.date: 07/18/2019
dmi.bios.vendor: LENOVO
dmi.bios.version: N2JET73W (1.51 )
dmi.board.asset.tag: Not Available
dmi.board.name: 20Q0CTO1WW
dmi.board.vendor: LENOVO
dmi.board.version: SDK0J40697 WIN
dmi.chassis.asset.tag: No Asset Information
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.version: None
dmi.modalias: dmi:bvnLENOVO:bvrN2JET73W(1.51):bd07/18/2019:svnLENOVO:pn20Q0CTO1WW:pvrThinkPadX390:rvnLENOVO:rn20Q0CTO1WW:rvrSDK0J40697WIN:cvnLENOVO:ct10:cvrNone:
dmi.product.family: ThinkPad X390
dmi.product.name: 20Q0CTO1WW
dmi.product.sku: LENOVO_MT_20Q0_BU_Think_FM_ThinkPad X390
dmi.product.version: ThinkPad X390
dmi.sys.vendor: LENOVO

Revision history for this message
Marius Gedminas (mgedmin) wrote :
Revision history for this message
Marius Gedminas (mgedmin) wrote :

I'm seeing this in journalctl -b -g chromium:

spal. 19 15:00:35 blynas dbus-daemon[4473]: apparmor="DENIED" operation="dbus_bind" bus="session" name="org.mpris.MediaPlayer2.chromium.instance5306" mask="bind" pid=5306 label="snap.chromium.chromium"
spal. 19 15:00:35 blynas chromium_chromium.desktop[4596]: [5306:5650:1019/150035.747129:ERROR:bus.cc(555)] Failed to get the ownership of org.mpris.MediaPlayer2.chromium.instance5306: Connection ":1.116" is not allowed to own the service "org.mpris.MediaPlayer2.chromium.instance5306" due to AppArmor policy

There's also

spal. 19 14:45:47 blynas kernel: audit: type=1107 audit(1571485547.156:75): pid=1458 uid=103 auid=4294967295 ses=4294967295 msg='apparmor="DENIED" operation="dbus_method_call" bus="system" path="/" interface="org.freedesktop.DBus.ObjectManager" member="GetManagedObjects" mask="send" name="org.bluez" pid=5306 label="snap.chromium.chromium" peer_pid=1496 peer_label="unconfined"
                                  exe="/usr/bin/dbus-daemon" sauid=103 hostname=? addr=? terminal=?'

but I think it the bluetooth headset button works via MPRIS, rather than directly through bluez.

summary: - cannot pause video with bluetooth headset buttons any more
+ [snap] cannot pause video with bluetooth headset buttons any more (MPRIS
+ denied by apparmor)
Revision history for this message
Marius Gedminas (mgedmin) wrote :

I've been googling, and it appears that Chromium should enable the mpris interface in the snapcraft YAML for this to work: https://snapcraft.io/docs/mpris-interface

Except if Chromium actually uses what looks like a dynamic part ("instance" + pid) in the dbus interface name, can it be made to work without patching Chromium's source?

Revision history for this message
Olivier Tilloy (osomon) wrote :

Confirmed, and adding the mpris slot fixes the issue.

Changed in chromium-browser (Ubuntu):
assignee: nobody → Olivier Tilloy (osomon)
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Olivier Tilloy (osomon) wrote :
Changed in chromium-browser (Ubuntu):
status: Triaged → Fix Committed
Olivier Tilloy (osomon)
Changed in chromium-browser (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Marius Gedminas (mgedmin) wrote :

I can confirm that the fix works with chromium snap 78.0.3904.70 (rev 909).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.