Browse Source

weitere nicht lauffähiger versuch

Toastie 2 years ago
parent
commit
c4e6c6fab4
1 changed files with 24 additions and 31 deletions
  1. 24 31
      mpd.sh

+ 24 - 31
mpd.sh

@@ -1,28 +1,5 @@
-
-
-sudo apt install mpd mpc ncmpc ffmpeg
-sudo cp /usr/share/sounds/alsa/Noise.wav /var/lib/mpd/music/
-
-mpc update
-mpc ls | mpc add
-mpc repeat
-mpc play
-
-
------
-
-
-sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl
-sudo chmod a+rx /usr/local/bin/youtube-dl
-
-youtube-dl -g https://www.youtube.com/watch?v=FJWd92Vi5Ww
-
-
-------------
-
-
-docker run -it --rm --device=/dev/snd:/dev/snd --name mpd -p 6600:6600 -p 8000:8000 arm32v6/alpine
-apk --no-cache add mpd mpc
+docker run -it --rm --privileged --device=/dev/snd:/dev/snd --name mpd -p 6600:6600 -p 8000:8000 arm32v6/alpine
+apk --no-cache add mpd mpc ncmpc ffmpeg alsa-utils
 
 
 mkdir -p /var/lib/mpd/music
@@ -38,6 +15,19 @@ defaults.ctl.card 1
 }
 EOF
 
+cat <<EOF | tee /etc/asound.conf
+pcm.!default {
+        type plug
+        slave {
+                pcm "hw:1,0"
+        }
+}
+
+ctl.!default {
+        type hw
+        card 1
+}
+EOF
 
 cat <<EOF | tee /etc/mpd.conf
 music_directory         "~/music"
@@ -68,10 +58,13 @@ audio_output {
 }
 EOF
 
-mkdir -p /var/lib/mpd/music
-mkdir -p /var/lib/mpd/.mpd/playlists
-touch /var/lib/mpd/.mpd/database
-touch /var/lib/mpd/.mpd/state
-chown -R mpd:audio /var/lib/mpd/
+su mpd -s /bin/sh -c \
+"wget -O /var/lib/mpd/music/toto.wav https://www.ee.columbia.edu/~dpwe/sounds/music/africa-toto.wav"
+
+cp /usr/share/sounds/alsa/Noise.wav /var/lib/mpd/music/
+
+mpc update && mpc ls | mpc add && mpc play
+
+/usr/bin/mpd --no-daemon --stdout &
+fg
 
-/usr/bin/mpd --no-daemon --stdout