2012-08-28

Running MPD as user

Setting up mpd was already explained a few posts ago. I enjoy each day since then. However, I came across some strange problems at startup (I do not restart this computer really often, mostly using stand-by instead).

After a bit of search, I found the culprit: mpd itself. Using the sudo apt-get install mpd is setting up mpd as system service, using /etc/mpd.conf as configuration. Since I wanted to get mpd started at user login, not as system service, I had mpd ~/mpd/.mpdcon & in the .profile. This collided with the already started mpd service...

The explanation found on Wikia is well done and detailed. The interesting part is the second step:

/etc/init.d/mpd stop
sudo update-rc.d mpd disable
Once this is done, the system wide mpd service is disabled. One can use also the next tip using START_MPD=false in the config file that should not be used (this one: /etc/mpd.conf).

2012-08-26

MPD remote and LAN

My fist tries with mpd were limited to local use with a dedicated machine, and web access using client175 (see previous post). Now, since I also have an android phone, I wanted to control the music from there.

I tried to use MPDroid to do this. The setup is simple, just requiring server address and port (eventually login if necessary with your config). However, MPDroid could not connect...

It simply requires a small change in the mpd configuration:
bind_to_address "localhost"
should be changed to:
bind_to_address "0.0.0.0"
or just commenting out the bind_to_address line from the config.

Now I can control the music from my phone, turning up the volume when it should be loud :)

As side note, writing the server address instead of 0.0.0.0 (or commenting out) will allow mpd to work through every client able to connect to the server address, but disable localhost connections. In my case, I had "connection refused" when using mpc. No specific address allows both local and remote access.