mirror of
https://github.com/OpenVoiceOS/OpenVoiceOS
synced 2025-06-05 22:19:21 +02:00
More MPRIS support work
This commit is contained in:
@@ -22,7 +22,6 @@ BR2_TARGET_GENERIC_ISSUE="Welcome to OpenVoiceOS"
|
|||||||
BR2_INIT_SYSTEMD=y
|
BR2_INIT_SYSTEMD=y
|
||||||
# BR2_TARGET_ENABLE_ROOT_LOGIN is not set
|
# BR2_TARGET_ENABLE_ROOT_LOGIN is not set
|
||||||
BR2_SYSTEM_BIN_SH_BASH=y
|
BR2_SYSTEM_BIN_SH_BASH=y
|
||||||
# BR2_TARGET_GENERIC_GETTY is not set
|
|
||||||
BR2_SYSTEM_DHCP="eth0"
|
BR2_SYSTEM_DHCP="eth0"
|
||||||
# BR2_ENABLE_LOCALE_PURGE is not set
|
# BR2_ENABLE_LOCALE_PURGE is not set
|
||||||
BR2_GENERATE_LOCALE="en_US.UTF-8"
|
BR2_GENERATE_LOCALE="en_US.UTF-8"
|
||||||
|
@@ -0,0 +1,25 @@
|
|||||||
|
From 97ae976abdfa5a722bc32885e1ef498a04af2f3d Mon Sep 17 00:00:00 2001
|
||||||
|
From: Peter Steenbergen <info@j1nx.nl>
|
||||||
|
Date: Sun, 31 Oct 2021 13:36:46 +0100
|
||||||
|
Subject: [PATCH 1/1] Switch to system dbus
|
||||||
|
|
||||||
|
---
|
||||||
|
src/dbus_mpris.rs | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/dbus_mpris.rs b/src/dbus_mpris.rs
|
||||||
|
index 838f3b3..1e97540 100644
|
||||||
|
--- a/src/dbus_mpris.rs
|
||||||
|
+++ b/src/dbus_mpris.rs
|
||||||
|
@@ -114,7 +114,7 @@ fn create_spotify_api(token: &RspotifyToken) -> Spotify {
|
||||||
|
async fn create_dbus_server(api_token: RspotifyToken, spirc: Arc<Spirc>, device_name: String) {
|
||||||
|
// TODO: allow other DBus types through CLI and config entry.
|
||||||
|
let (resource, conn) =
|
||||||
|
- connection::new_session_sync().expect("Failed to initialize DBus connection");
|
||||||
|
+ connection::new_system_sync().expect("Failed to initialize DBus connection");
|
||||||
|
tokio::spawn(async {
|
||||||
|
let err = resource.await;
|
||||||
|
panic!("Lost connection to D-Bus: {}", err);
|
||||||
|
--
|
||||||
|
2.33.1
|
||||||
|
|
@@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0"?><!--*-nxml-*-->
|
||||||
|
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
|
||||||
|
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
|
||||||
|
|
||||||
|
<busconfig>
|
||||||
|
|
||||||
|
<!-- System-wide Mycroft services run as 'mycroft' user. -->
|
||||||
|
|
||||||
|
<policy user="mycroft">
|
||||||
|
<allow own="com.openvoiceos"/>
|
||||||
|
<allow send_destination="com.openvoiceos.mycroft.audio"/>
|
||||||
|
<allow receive_sender="com.openvoiceos.mycroft.audio"/>
|
||||||
|
</policy>
|
||||||
|
|
||||||
|
</busconfig>
|
@@ -0,0 +1,23 @@
|
|||||||
|
<!-- initial version, based on /etc/dbus-1/system.d/avahi-dbus.conf, with thanks -->
|
||||||
|
<!DOCTYPE busconfig PUBLIC
|
||||||
|
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
|
||||||
|
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
|
||||||
|
<busconfig>
|
||||||
|
|
||||||
|
<!-- Allow users "root" and "mycroft" to own the Shairport Sync service -->
|
||||||
|
<policy user="root">
|
||||||
|
<allow own="org.gnome.ShairportSync"/>
|
||||||
|
</policy>
|
||||||
|
<policy user="mycroft">
|
||||||
|
<allow own="org.gnome.ShairportSync"/>
|
||||||
|
</policy>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Allow anyone to invoke methods on Shairport Sync server -->
|
||||||
|
<policy context="default">
|
||||||
|
<allow send_destination="org.gnome.ShairportSync"/>
|
||||||
|
<allow receive_sender="org.gnome.ShairportSync"/>
|
||||||
|
</policy>
|
||||||
|
|
||||||
|
</busconfig>
|
||||||
|
|
@@ -0,0 +1,21 @@
|
|||||||
|
<!-- initial version, based on /etc/dbus-1/system.d/avahi-dbus.conf, with thanks -->
|
||||||
|
<!DOCTYPE busconfig PUBLIC
|
||||||
|
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
|
||||||
|
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
|
||||||
|
<busconfig>
|
||||||
|
|
||||||
|
<!-- Allow users "root" and "mycroft" to own the Shairport Sync MPRIS service -->
|
||||||
|
<policy user="mycroft">
|
||||||
|
<allow own="org.mpris.MediaPlayer2.ShairportSync"/>
|
||||||
|
</policy>
|
||||||
|
<policy user="root">
|
||||||
|
<allow own="org.mpris.MediaPlayer2.ShairportSync"/>
|
||||||
|
</policy>
|
||||||
|
|
||||||
|
<!-- Allow anyone to invoke methods on Shairport Sync MPRIS server -->
|
||||||
|
<policy context="default">
|
||||||
|
<allow send_destination="org.mpris.MediaPlayer2.ShairportSync"/>
|
||||||
|
<allow receive_sender="org.mpris.MediaPlayer2.ShairportSync"/>
|
||||||
|
</policy>
|
||||||
|
|
||||||
|
</busconfig>
|
@@ -0,0 +1,21 @@
|
|||||||
|
<!-- initial version, based on /etc/dbus-1/system.d/avahi-dbus.conf, with thanks -->
|
||||||
|
<!DOCTYPE busconfig PUBLIC
|
||||||
|
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
|
||||||
|
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
|
||||||
|
<busconfig>
|
||||||
|
|
||||||
|
<!-- Allow users "root" and "mycroft" to own the SpotifyD MPRIS service -->
|
||||||
|
<policy user="mycroft">
|
||||||
|
<allow own="org.mpris.MediaPlayer2.spotifyd"/>
|
||||||
|
</policy>
|
||||||
|
<policy user="root">
|
||||||
|
<allow own="org.mpris.MediaPlayer2.spotifyd"/>
|
||||||
|
</policy>
|
||||||
|
|
||||||
|
<!-- Allow anyone to invoke methods on SpotifyD MPRIS server -->
|
||||||
|
<policy context="default">
|
||||||
|
<allow send_destination="org.mpris.MediaPlayer2.spotifyd"/>
|
||||||
|
<allow receive_sender="org.mpris.MediaPlayer2.spotifyd"/>
|
||||||
|
</policy>
|
||||||
|
|
||||||
|
</busconfig>
|
@@ -66,6 +66,7 @@
|
|||||||
"backends": {
|
"backends": {
|
||||||
"local": {
|
"local": {
|
||||||
"type": "ovos_common_play",
|
"type": "ovos_common_play",
|
||||||
|
"dbus_type": "system",
|
||||||
"active": true
|
"active": true
|
||||||
},
|
},
|
||||||
"vlc": {
|
"vlc": {
|
||||||
|
29
buildroot-external/rootfs-overlay/etc/profile
Normal file
29
buildroot-external/rootfs-overlay/etc/profile
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
export PATH="/usr/bin:/usr/sbin"
|
||||||
|
|
||||||
|
if [ "$PS1" ]; then
|
||||||
|
if [ "`id -u`" -eq 0 ]; then
|
||||||
|
export PS1='# '
|
||||||
|
else
|
||||||
|
export PS1='$ '
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if test -z "${XDG_RUNTIME_DIR}"; then
|
||||||
|
export XDG_RUNTIME_DIR=/run/user/${UID}
|
||||||
|
if ! test -d "${XDG_RUNTIME_DIR}"; then
|
||||||
|
mkdir "${XDG_RUNTIME_DIR}"
|
||||||
|
chmod 0700 "${XDG_RUNTIME_DIR}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if test -z "${DBUS_SESSION_BUS_ADDRESS}"; then
|
||||||
|
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${UID}/bus
|
||||||
|
fi
|
||||||
|
|
||||||
|
export EDITOR='/bin/vi'
|
||||||
|
|
||||||
|
# Source configuration files from /etc/profile.d
|
||||||
|
for i in /etc/profile.d/*.sh ; do
|
||||||
|
if [ -r "$i" ]; then
|
||||||
|
. $i
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
unset i
|
@@ -1,4 +1,6 @@
|
|||||||
general = {
|
general = {
|
||||||
name = "OpenVoiceOS";
|
name = "OpenVoiceOS";
|
||||||
output_backend = "pa";
|
output_backend = "pa";
|
||||||
|
dbus_service_bus = "system";
|
||||||
|
mpris_service_bus = "system";
|
||||||
};
|
};
|
||||||
|
@@ -1,11 +1,16 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Shairport-sync
|
Description=Shairport-sync
|
||||||
Wants=network.target
|
Wants=sound.target
|
||||||
|
After=sound.target
|
||||||
|
Wants=network-online.target
|
||||||
|
After=network-online.target
|
||||||
|
After=pulseaudio.service
|
||||||
Requires=avahi-daemon.service
|
Requires=avahi-daemon.service
|
||||||
After=network.target sound.target avahi-daemon.service
|
After=avahi-daemon.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
|
User=mycroft
|
||||||
# Avahi daemon needs some time until fully ready
|
# Avahi daemon needs some time until fully ready
|
||||||
ExecStartPre=/bin/sleep 3
|
ExecStartPre=/bin/sleep 3
|
||||||
ExecStart=/usr/bin/shairport-sync
|
ExecStart=/usr/bin/shairport-sync
|
||||||
|
Reference in New Issue
Block a user