aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@dailly.me>2022-05-25 19:34:17 +0200
committerSébastien Dailly <sebastien@dailly.me>2022-05-25 19:34:17 +0200
commit48fc60fcf46bf1257232378e43d4e732982a777f (patch)
treead2ada58141936e284f26e910c0cb1fc5e354420
parent6bb0a807c676366446f3f54dd8b121c01a5f190f (diff)
Added mpd in satellite mode
-rw-r--r--board/mpd.sh47
-rwxr-xr-xboard/post-build.sh1
-rw-r--r--configs/config30
3 files changed, 66 insertions, 12 deletions
diff --git a/board/mpd.sh b/board/mpd.sh
new file mode 100644
index 0000000..7644b94
--- /dev/null
+++ b/board/mpd.sh
@@ -0,0 +1,47 @@
+create_missing_dir "/var/lib/mpd/"
+if ! grep -qE '/var/lib/mpd' "${TARGET_DIR}/etc/fstab"; then
+ cat << __EOF__ >> "${TARGET_DIR}/etc/fstab"
+tmpfs /var/lib/mpd tmpfs rw 0 0
+__EOF__
+fi
+
+cat << __EOF__ > "${TARGET_DIR}/etc/mpd.conf"
+# Use a proxy to another instance
+music_directory "nfs://192.168.0.4/home/mpd/music"
+database {
+ plugin "proxy"
+ host "192.168.0.4"
+ port "6600"
+}
+
+
+# Directory where user-made playlists are stored (RW)
+#playlist_directory "nfs://192.168.0.4/home/mpd/playlists"
+playlist_directory "/tmp/"
+
+# Log file (RW)
+# disable the logs
+log_file "/dev/null"
+
+# Process ID file (RW)
+pid_file "/var/run/mpd.pid"
+
+# State file (RW)
+state_file "/var/lib/mpd/state"
+
+# User id to run the daemon as
+#user "nobody"
+
+# TCP socket binding
+bind_to_address "any"
+#bind_to_address "localhost"
+
+# Unix socket to listen on
+bind_to_address "/var/lib/mpd/socket"
+
+audio_output {
+ type "pulse"
+ name "Pulseaudio"
+ server "127.0.0.1"
+}
+__EOF__
diff --git a/board/post-build.sh b/board/post-build.sh
index cfdaec0..5501359 100755
--- a/board/post-build.sh
+++ b/board/post-build.sh
@@ -18,6 +18,7 @@ sed -ie '/^\/dev\/root/ s/rw 0 1/ro 0 0/' "${TARGET_DIR}/etc/fstab"
. "${BR2_EXTERNAL_PIAUDIO_PATH}/board/network.sh"
. "${BR2_EXTERNAL_PIAUDIO_PATH}/board/pulseaudio.sh"
. "${BR2_EXTERNAL_PIAUDIO_PATH}/board/bluetooth.sh"
+. "${BR2_EXTERNAL_PIAUDIO_PATH}/board/mpd.sh"
mkdir -p "${TARGET_DIR}"/etc/systemd/system/getty.target.wants
# Add a console on ttyAMA0 and enable auto login
diff --git a/configs/config b/configs/config
index e19b275..af988fc 100644
--- a/configs/config
+++ b/configs/config
@@ -149,15 +149,21 @@ BR2_PACKAGE_UTIL_LINUX_RFKILL=y
BR2_PACKAGE_AVAHI=y
BR2_PACKAGE_AVAHI_DAEMON=y
-
-#BR2_PACKAGE_MPD=y
-#BR2_PACKAGE_MPD_AVAHI_SUPPORT=y
-#BR2_PACKAGE_MPD_LIBNFS=y
-#BR2_PACKAGE_MPD_MPG123=y
-#BR2_PACKAGE_MPD_FLAC=y
-#BR2_PACKAGE_MPD_VORBIS=y
-#BR2_PACKAGE_MPD_LIBSNDFILE=y
-#BR2_PACKAGE_FFMPEG=y
-#BR2_PACKAGE_MPD_CURL=y
-#BR2_PACKAGE_MPD_ZZIP=y
-#BR2_PACKAGE_MPD_BZIP2=y
+BR2_PACKAGE_AVAHI_DEFAULT_SERVICES=y
+
+BR2_PACKAGE_MPD=y
+BR2_PACKAGE_MPD_PULSEAUDIO=y
+# Used to connect to another one mpd throught the proxy plugin
+BR2_PACKAGE_MPD_LIBMPDCLIENT=y
+BR2_PACKAGE_MPD_AVAHI_SUPPORT=n
+BR2_PACKAGE_MPD_LIBNFS=y
+BR2_PACKAGE_MPD_MPG123=y
+BR2_PACKAGE_MPD_FLAC=y
+BR2_PACKAGE_MPD_VORBIS=y
+BR2_PACKAGE_MPD_LIBSNDFILE=y
+BR2_PACKAGE_MPD_FFMPEG=y
+BR2_PACKAGE_MPD_FAAD2=y
+BR2_PACKAGE_MPD_OPUS=y
+BR2_PACKAGE_MPD_CURL=y
+BR2_PACKAGE_MPD_ZZIP=y
+BR2_PACKAGE_MPD_BZIP2=y