Skip to content

MPD mizy customization

Art Nikpal edited this page Apr 15, 2018 · 5 revisions

MPD music player demon - miZy - mod

**ATTENTION! MPD in miZy has its own peculiarities ** - we do not use any OpenWrt or other binaries, and we build it ourselves with our patches and other build options - (the main goal is to keep the smallest size - not to the detriment of the features)

added many of the experimental features that are not in the standard MPD

  • webdav
  • extra ffmpeg usage
  • much more

MPD files and configs

root@miZy:~# mpd --version

Music Player Daemon 0.20.9

Copyright (C) 2003-2007 Warren Dukes <[email protected]>
Copyright 2008-2017 Max Kellermann <[email protected]>
This is free software; see the source for copying conditions.  There is NO
warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Database plugins:
 simple proxy

Storage plugins:
 local curl

Decoders plugins:
 [ffmpeg] 16sv 3g2 3gp 4xm 8svx aa3 aac ac3 adx afc aif aifc aiff al alaw amr anim apc ape asf atrac au aud avi avm2 avs bap bfi c93 cak cin cmv cpk daud dct divx dts dv dvd dxa dsf alac eac3 film flac flc fli fll flx flv g726 gsm gxf iss m1v m2v m2t m2ts m4a m4b m4v mad mj2 mjpeg mjpg mka mkv mlp mm mmf mov mp+ mp1 mp2 mp3 mp4 mpc mpeg mpg mpga mpp mpu mve mvi mxf nc nsv nut nuv oga ogm ogv ogx oma ogg omg opus psp pva qcp qt r3d ra ram rl2 rm rmvb roq rpl rvc shn smk snd sol son spx str swf tak tgi tgq tgv thp ts tsp tta xa xvid uv uv2 vb vid vob voc vp6 vmd wav webm wma wmv wsaud wsvga wv wve
 [pcm]

Filters:
Tag plugins:
Output plugins:
 null alsa

Input plugins:
 file alsa curl ffmpeg

Playlist plugins:
 extm3u m3u pls xspf asx rss cue embcue

Protocols:
 file:// http:// https:// http:// https:// mms:// mmsh:// mmst:// mmsu:// tcp:// udp:// gopher:// rtp:// rtsp:// rtmp:// rtmpt:// rtmps:// alsa://

Other features:
 epoll inotify ipv6 tcp un

/opt/mpd_daemon - start mpd script

root@miZy:~# cat /opt/mpd_daemon 
#!/bin/sh

## hyphop ##

. /opt/mpd.config

exec nice -n -20 mpd 

/opt/mpd.config - mpd config

root@miZy:~# cat /opt/mpd.config
#!/bin/sh

## hyphop ##
base=/home/mpd
music=$base/music
pls=$base/playlists
unx=/tmp/mpd_socket

[ -d $music ] || mkdir -p $music
[ -d $pls ] || mkdir -p $pls

ln -s /tmp/mounts $music/mounts

cp /opt/mpd_state_1 /tmp/mpd_state

/opt/mpd_state_1 - the status file example content

root@miZy:~# cat /opt/mpd_state_1
sw_volume: 76
audio_device_state:1:alsa default
audio_device_state:0:alsa equal
audio_device_state:1:null
state: play
current: 4
time: 0
random: 0
repeat: 1
single: 0
consume: 0
crossfade: 1
mixrampdb: 0.000000
mixrampdelay: -1.000000
playlist_begin
song_begin: http://ai-radio.org/mp3
Name: http://ai-radio.org/mp3.192
song_end
song_begin: http://ai-radio.org/ogg320
Name: http://ai-radio.org/ogg.320
song_end
song_begin: http://ai-radio.org/aac320
Name: http://ai-radio.org/aac.320
song_end
song_begin: http://ai-radio.org/flac
Name: http://ai-radio.org/flac
song_end
song_begin: http://ai-radio.org/opus128
Name: http://ai-radio.org/opus.128
song_end
playlist_end

ATTENTION! it is not necessary to write it by hand (although it is possible) - it is written by mpd itself. When we need to save it (for further use after reboots), we do so

cp /tmp/mpd_state /opt/mpd_state_1 

save changes on the spi or sd flash drive

save_changes

now the desired state will survive reboots

MPD playlists

root@miZy:~# ls -l1 /home/mpd/playlists/
-rw-r--r--    1       374 Jul 13  2017 ai-radio.org.m3u
-rw-r--r--    1       786 Jul 13  2017 radio.m3u