Binding to port 6600 as well as a unix socket at /run/mpd/socket - this allows browsing for files outside of your configured music directory via ncmpcpp. I keep the port configured so I can connect with an android client (see below.)

An explicit value for user and group to ensure that the daemon runs as my user and group.

I added an explicit log file location, for sending that off to ELK (for real!)

Here's where things get interesting. I recently bought a keyboard with some music control buttons on it and I wanted to actually be able to use these (it's a Logitech G610 if you are curious about the exact keys/keyboard.) In all I would need to set up bindings for:

The volume-tweak command seen above is actually a wrapper script that sets the Pulse Audio sink volume level - I wrote it so that I'd have a way to seamlessly control the volume of my bluetooth speaker if it was connected. Perhaps I'll go into details about this in another entry...

In truth, my actual .xbindkeysrc is all wrappers - the core commands are the same as above but I've wrapped them to include the usage of notify-send so I can get desktop notifications from them.

As with volume-tweak, mute-or-not is another wrapper designed to do the right thing if my bluetooth speaker is connected or not, as well as send a desktop notification about the current status.

With a little bit of configuration, I now have working music control keys and they do in fact work quite slick-ly!

Nothing has really changed with my speaker setup; I'm still using both my laptop speakers as well as some external bluetooth speakers. What has changed is how I interract with them, specifically the wrapper scripts for volume and muting that I touched upon above. Details about them might come in a future entry.

In the above snippet, I've declared a new output of the httpd type and given it a pretty generic name. It'll run on port 8340 and I've selected vorbis as my encoder because it's a good, Free encoder and it is supported on modern browsers. MPD supports a wide variety of encoders, run mpd --version to see what your version supports.

Of course, I can't recommend just running this wide open; it's pretty simple to add some iptables rules to limit access to specific hosts that you want to have access to your stream:

The above rules would allow the hosts 192.168.1.103 and 192.168.1.104 to reach both your HTTP stream on port 8430 (TCP) as well as connect directly to MPD over port 6600 (TCP.) This is just the right thing to do when you are broadcasting services on your machine, and it's not at all hard to do.

This isn't seen above as part of the 'whole' MPD config file because it does add some CPU overhead. Depending on the machine it might not be feasible due to resource constraints. At any rate it's pretty easy to switch on and off via mpc or some other MPD client:

I'm quite happy with my setup but am of course always on the lookout for new things I can improve. Even config files I don't touch for years can sometimes undergo small changes and yield vast improvements. Until next time!