Install the MPD Music Server & Configure audio service in Raspberry Pi
MPD ( Music Player Daemon ) is a lightweight server for sharing a music library both locally and over a network. The MPD allows not only the music to be shared and played over the network, but also allows for numerous different front end clients.
Installing MPD is very easy and lightweight. Just update your system and install using the package manager. For Ubuntu :
sudo apt-get update sudo apt-get install mpd --no-install-recommends
|Disable automatic recommendations|
Disable recommendations temporally (for single package installation), adding the
Disable recommendations permanently, using
That's all. Now you can check the status of mpd by using
| Start MPD service automatically on boot|
MPD uses a text configuration file. If you are working from the command line , open the following file with Vim, Nano or any favourite editor. For GUI, you can use multiple editors.
sudo vim /etc/mpd.conf
As a reference, you can use this file :
The Raspberry Pi has two audio output modes: HDMI and headphone jack. You can switch between these modes at any time.
The following command, entered in the command line, will switch the audio output to headphone:
amixer cset numid=3 2
Here the output is being set to
2, which is HDMI. Setting the output to
1switches to analogue (headphone jack). The default setting is
0 which is automatic.
Open up raspi-config by entering the following into the command line:
Select Option 7
Advanced Options and press
Enter, then select Option A6:
Audio and press
If you're still not getting sound via HDMI
In some rare cases, it is necessary to edit
config.txt to force HDMI mode (as opposed to DVI mode, which does not send sound). You can do this by editing
/boot/config.txt and setting
hdmi_drive=2, then rebooting for the change to take effect. -Source: https://www.raspberrypi.org