diff --git a/buildroot-external/configs/rpi4_64-gui_defconfig b/buildroot-external/configs/rpi4_64-gui_defconfig index 6fb10756..770981e9 100644 --- a/buildroot-external/configs/rpi4_64-gui_defconfig +++ b/buildroot-external/configs/rpi4_64-gui_defconfig @@ -22,7 +22,6 @@ BR2_TARGET_GENERIC_ISSUE="Welcome to OpenVoiceOS" BR2_INIT_SYSTEMD=y # BR2_TARGET_ENABLE_ROOT_LOGIN is not set BR2_SYSTEM_BIN_SH_BASH=y -# BR2_TARGET_GENERIC_GETTY is not set BR2_SYSTEM_DHCP="eth0" # BR2_ENABLE_LOCALE_PURGE is not set BR2_GENERATE_LOCALE="en_US.UTF-8" diff --git a/buildroot-external/package/spotifyd/0001-Switch-to-system-dbus.patch b/buildroot-external/package/spotifyd/0001-Switch-to-system-dbus.patch new file mode 100644 index 00000000..221a0b57 --- /dev/null +++ b/buildroot-external/package/spotifyd/0001-Switch-to-system-dbus.patch @@ -0,0 +1,25 @@ +From 97ae976abdfa5a722bc32885e1ef498a04af2f3d Mon Sep 17 00:00:00 2001 +From: Peter Steenbergen +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, 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 + diff --git a/buildroot-external/rootfs-overlay/etc/dbus-1/system.d/mycroft.conf b/buildroot-external/rootfs-overlay/etc/dbus-1/system.d/mycroft.conf new file mode 100644 index 00000000..d51aabd2 --- /dev/null +++ b/buildroot-external/rootfs-overlay/etc/dbus-1/system.d/mycroft.conf @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + diff --git a/buildroot-external/rootfs-overlay/etc/dbus-1/system.d/shairport-sync-dbus-policy.conf b/buildroot-external/rootfs-overlay/etc/dbus-1/system.d/shairport-sync-dbus-policy.conf new file mode 100644 index 00000000..6c22c57b --- /dev/null +++ b/buildroot-external/rootfs-overlay/etc/dbus-1/system.d/shairport-sync-dbus-policy.conf @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/buildroot-external/rootfs-overlay/etc/dbus-1/system.d/shairport-sync-mpris-policy.conf b/buildroot-external/rootfs-overlay/etc/dbus-1/system.d/shairport-sync-mpris-policy.conf new file mode 100644 index 00000000..e44e6d46 --- /dev/null +++ b/buildroot-external/rootfs-overlay/etc/dbus-1/system.d/shairport-sync-mpris-policy.conf @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + diff --git a/buildroot-external/rootfs-overlay/etc/dbus-1/system.d/spotifyd-mpris-policy.conf b/buildroot-external/rootfs-overlay/etc/dbus-1/system.d/spotifyd-mpris-policy.conf new file mode 100644 index 00000000..eb0db39f --- /dev/null +++ b/buildroot-external/rootfs-overlay/etc/dbus-1/system.d/spotifyd-mpris-policy.conf @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + diff --git a/buildroot-external/rootfs-overlay/etc/mycroft/mycroft.conf b/buildroot-external/rootfs-overlay/etc/mycroft/mycroft.conf index d0001d15..9fdc2d01 100644 --- a/buildroot-external/rootfs-overlay/etc/mycroft/mycroft.conf +++ b/buildroot-external/rootfs-overlay/etc/mycroft/mycroft.conf @@ -66,6 +66,7 @@ "backends": { "local": { "type": "ovos_common_play", + "dbus_type": "system", "active": true }, "vlc": { diff --git a/buildroot-external/rootfs-overlay/etc/profile b/buildroot-external/rootfs-overlay/etc/profile new file mode 100644 index 00000000..99671327 --- /dev/null +++ b/buildroot-external/rootfs-overlay/etc/profile @@ -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 diff --git a/buildroot-external/rootfs-overlay/etc/shairport-sync.conf b/buildroot-external/rootfs-overlay/etc/shairport-sync.conf index c920f8a2..f371eb52 100644 --- a/buildroot-external/rootfs-overlay/etc/shairport-sync.conf +++ b/buildroot-external/rootfs-overlay/etc/shairport-sync.conf @@ -1,4 +1,6 @@ general = { name = "OpenVoiceOS"; output_backend = "pa"; + dbus_service_bus = "system"; + mpris_service_bus = "system"; }; diff --git a/buildroot-external/rootfs-overlay/usr/lib/systemd/system/shairport-sync.service b/buildroot-external/rootfs-overlay/usr/lib/systemd/system/shairport-sync.service index df8c9857..3e713c67 100644 --- a/buildroot-external/rootfs-overlay/usr/lib/systemd/system/shairport-sync.service +++ b/buildroot-external/rootfs-overlay/usr/lib/systemd/system/shairport-sync.service @@ -1,11 +1,16 @@ [Unit] 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 -After=network.target sound.target avahi-daemon.service +After=avahi-daemon.service [Service] Type=simple +User=mycroft # Avahi daemon needs some time until fully ready ExecStartPre=/bin/sleep 3 ExecStart=/usr/bin/shairport-sync