Installing mpd & mpc & remote control apps - smx06/DIYorange GitHub Wiki

NB: You can find all text files in repository!

Checking audio out (jack) works ok

install alsa(audio): "apt-get alsa-base"

run "alsamixer"

(needs hdmi connection to watch it most possibly, ssh seems displays not so good, but possible to do needed actions)

select "lineout" , select "M" (shows Off by default, after M -> must show On)

test sound: "aplay your.mp3"

NB: useful command to control volume level "amixer set 'Lineout volume control' 90%"

MPD (main radio/player)

install MPD: "apt-get mpd"

making folders:

  • mkdir /root/mpd
  • mkdir /root/music
  • mkdir /root/mpd/playlists

editing configuration:

nano /etc/mpd.conf

paste this:

# Сonfiguration file for MPD.

music_directory "/root/music"

playlist_directory "/root/mpd/playlists"

db_file "/root/mpd/database"

bind_to_address "any"

input { plugin "curl" }

audio_buffer_size "8192"

save it: Ctrl+X - yes

nano /root/mpd/playlists/kpopjpop.m3u

paste:

#EXTM3U

#EXTINF:-1, Big B Radio #KPOP http://bigbradio.net/kpop/

http://184.95.62.170:9002/

#EXTINF:-1, caprice kpop

http://79.111.119.111:9097/

#EXTINF:-1, http://bigbradio.net/jpop/

http://50.7.184.106:8734/

#EXTINF:-1, caprice jpop

http://79.111.119.111:9065/

MPC (mpd control client)

install: "apt-get mpc"

list of commands: http://linux.die.net/man/1/mpc

usefull commands:

  • mpc lsplaylists
  • mpc load radio //radio.m3u
  • mpc play 1 //2,3,4...

Making mpc autostart (to start playing radio):

Creating autostart service script:

/etc/systemd/system/autompc.service

[Unit]

Description=myscript service

After=syslog.target network.target sound.target

[Service]

Type=forking

ExecStartPre=/bin/sh -c '/usr/bin/mpc load radio > /dev/null 2>&1 || :' #your radio.m3u

ExecStart=/usr/bin/mpc play 1

ExecStop=/usr/bin/mpc clear

RemainAfterExit=yes

[Install]

WantedBy=default.target

Run in console “systemctl enable autompc”

says: ..created symlink…

"systemctl start autompc"

playing..

Remote control apps

  • MPDroid (android)
  • MPDjs (ios)
  • Cantata (windows)
  • etc