⬆️ ⬇️

MPD, home audio storage

I would like to tell how the other day I solved the problem of organizing a home audio storage.



For a start, what we have:


1) stationary computer (OS - ArchLinux);

2) a laptop to which home acoustics are often connected (OS - ArchLinux x64);

3) a music library ~ 500 GB, which is located on (1).



What I would like to receive as a result of (tasks):


1) a centralized library, for example, so that the playlist created on one machine is available on the other too;

2) the ability to control playback from any computer;

3) the ability to output sound to the audio output of any computer, for example, working on a hospital and controlling it to listen to music on the acoustics connected to the laptop.

')

Implementation.


It was decided to use mpd that I will not write this, so much has been written about it.

Gpmc was selected as a client on both computers (there is also under Windows), the main reason for this choice is the ability to switch the audio output of mpd on the fly. Because I use Gnome 3, my sound subsystem is, by default, based on PulseAudio, in fact only it provides the necessary functionality in this situation.



We put everything you need:


At the hospital:

sudo pacman -S mpd gmpc

On the laptop:

sudo pacman -S gmpc paprefs



Customize:


1. Configure mpd.

my mpd.conf:

music_directory "/var/Shared/Media/Music_mp3"

playlist_directory "/home/useer/.mpd/playlists"

db_file "/home/useer/.mpd/mpd.db"

log_file "/home/useer/.mpd/mpd.log"

pid_file "/home/useer/.mpd/pid"

state_file "/home/useer/.mpd/state"

default_permissions "read,add,control,admin"

volume_normalization "yes"

user "mpd"

bind_to_address "any"

port "6600"

audio_output {

type "pulse"

name ""

}

audio_output {

type "pulse"

name ""

server "192.168.4.3" #ip-

}

filesystem_charset "UTF-8"

id3v1_encoding "UTF-8"





2. Run the daemon:

sudo /etc/rc.d/mpd start



3. Go to the beech. We configure PulseAudio (if that - we read below "Difficulties"):

paprefs

Put a tick:

image



4. Run gmpc on any computer.



Result:


We have a single music library, control playback from any PC and output sound to any PC.

Switching outputs is conveniently done through the gmpc menu:

image



Difficulties:


When I start paprefs, all settings items are not available (gray). This is due to the fact that the current version of paprefs in the repositories is compiled with support for the older version of PulseAudio and cannot find plug-ins, I have them in /usr/lib/pulse-1.1, and paprefs searches in /usr/lib/pulse-1.0



The easiest way to solve this is to see where paprefs is looking for and create a link with this name:

strace paprefs 2>&1 |grep /lib/pulse -

ln -s /usr/lib/pulse-1.1/ /usr/lib/pulse-1.0 -




Enjoy your listening!

Source: https://habr.com/ru/post/132573/



All Articles