0

I have a small PC running Ubuntu 18.04 which is usually not connected to a monitor. It is an UpBoard (details)

I connected the audio output to my amplifier.

Playing music works if I connect a monitor to the upBoard.

My goal: use the upBoard in headless mode. I would like to choose music with some android device, and then the upBoard should play the songs I selected.

I looked at kodi, but this seems to be for TV output (not headless).

I am unsure which kind of software is needed ..

  • for the upBoard?
  • for the android device?

The audio files which I want to play are on the UpBoard, not on the android device.

guettli
  • 1,765

1 Answers1

1

from here

Music Player Daemon (MPD) is a flexible, powerful, server-side application for playing music. Through plugins and libraries it can play a variety of sound files while being controlled by its network protocol.

It is available in the ubuntu 18.04 repo:

sudo apt install mpd

after installing mpd create the conf file:

sudo cat /etc/mpd.conf | tee ~/.mpdconf

create the mpd dir and some files:

mkdir /home/$USER/Music/mpd
mkdir /home/$USER/Music/mpd/playlists
touch /home/$USER/Music/mpd/{mpd.log,tag_cache,pid}

edit the conf file:

nano ~/.mpdconf

and change appriopriate portions to the values here

music_directory     "/home/USER/Music"
playlist_directory      "/home/USER/Music/mpd/playlists"
db_file         "/home/USER/Music/mpd/tag_cache"
log_file            "/home/USER/Music/mpd/mpd.log"
pid_file            "/home/USER/Music/mpd/pid"
state_file          "/home/USER/Music/mpd/state"
sticker_file                   "/home/USER/Music/mpd/sticker.sql"
#user               "mpd"
bind_to_address     "0.0.0.0"
port                "6600"
#save_absolute_paths_in_playlists   "no"
#auto_update    "yes"
#zeroconf_enabled       "yes"
#zeroconf_name          "MPD Music Player"
#password                        "password@read,add,control,admin"

audio_output {
    type        "alsa"
    name        "My ALSA Device"
{
filesystem_charset      "UTF-8"

It is importtant to that the user parameter is commented else you may get errors during running. Also replace USER with your username

Then kill mpd from running systemwide:

sudo pkill mpd
sudo systemctl disable mpd

and make it start on login: ~/.config/autostart/mpd.desktop

and paste

[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=Music Player Daemon
Comment=Server for playing audio files
Exec=mpd
StartupNotify=false
Terminal=false
Hidden=false

now start the music server:

mpd

Download the android app mpdroid

Afterwards connect both android and the board to the same network. start mpddroid and enter your servers ip and mpd port (6600). Firewall ports should also be properly setup to allow the android client access

refenence: https://help.ubuntu.com/community/MPD

ptetteh227
  • 2,044