Enabling PulseAudio Equalizer for MPD in Ubuntu 16.10
Posted on 2017-02-17 08:07:30
by Geert Vandeweyer
Enabling PulseAudio Equalizer for MPD in Ubuntu 16.10
I've been using MPD for over 10 years now as my favourite music player. It has an intuitive interface in through the GMPD package, and allowes easy binding of hotkeys and custom management through the CLI interface of mpc. Right now, I'm using it to stream music from my NAS at home to my laptop at work (or wherever I am), through an ssh-fs mounted music database. One feature that's still missing in my opinion is a built-in equalizer. Sort of the good old winamp sliders back in the 90's
Working on (k)ubuntu now, I'm using PulseAudio equalizer for this. But since PulseAudio is userspace, and MPD runs as dedicated user by default through service scripts, it escaped control. Below are some steps to force running MPD in userspace under the control of PA-E.
1. Install MPD
First, install MPD and the GMPC interface.
sudo apt-get install mpd gmpc mpc
Then make default setup in /etc/mpd.conf:
# set music folder:
music_directory "/mnt/My_Music"
Restart MPD to apply changes, and check the connection
# restart mpd
sudo /etc/init.d/mpd restart
# check status
mpc status
# initialize the DB
mpc update
# check if update is running
mpc status
If this is working, we'll disable the default MPD instance and make it run as your user.
2. Switch to userspace.
First, we remove mpd from the default runlevels.
# disable the startup scripts
sudo update-rc.d mpd disable
Next, create a folder to hold your mpd config files, and copy the working config file to it.
mkdir ~/.mpd/
cp /etc/mpd.conf ~/.mpd/
Open your private mpd config file with your favourite text editor and change the following items:
# point config files to the new folder
playlist_directory "~/.mpd/playlists"
db_file "~/.mpd/tag_cache"
log_file "~/.mpd/mpd.log"
pid_file "~/.mpd/pid"
state_file "~/.mpd/state"
sticker_file "~/.mpd/sticker.sql"
# disable the default user specification
#user "mpd"
# enable pulse output
audio_output {
type "pulse"
name "My Pulse Output"
# server "remote_server" # optional
# sink "remote_server_sink" # optional
}
Finally, MPD kept restarting itself for some dubious reason on my system. I had to remove the /etc/mpd.conf file to keep it from restarting.
sudo mv /etc/mpd.conf /etc/mpd.conf.global
3. Create an autostart script.
This is tested only on Kubuntu. So it might be different for ubuntu. Create a desktop file as: ~/.config/autostart/mpd.desktop. Fill it as follows, replacing the Exec statement with your homefolder name:
[Desktop Entry]
Comment[en_GB]=
Comment=
Comment[en_US]=
Exec=/usr/bin/mpd /home/gvandeweyer/.mpd/mpd.conf
GenericName[en_GB]=
GenericName=
GenericName[en_US]=
Icon=system-run
MimeType=
Name[en_GB]=mpd_userspace
Name=mpd_userspace
Name[en_US]=
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-SubstituteUID=false
X-KDE-Username=
now reboot, and mpd should be running as your user. You can check with:
ps aux | grep mpd
mpd, Ubuntu
Comments
Loading Comments