Second MPD instance for HTTP streaming

Cool stuff you can do with MPD. A place for you to put your hacks and patches, or be inspired by others'.
Post Reply
haok
Posts: 6
Joined: September 19th, 2014, 11:51 pm

Second MPD instance for HTTP streaming

Post by haok » September 9th, 2019, 5:58 am

Hi, I would like to run a 2nd MPD instance specifically for HTTP streaming. How can this be achieved? Thanks, Henry

max
Forum team
Posts: 922
Joined: January 15th, 2013, 3:43 pm

Re: Second MPD instance for HTTP streaming

Post by max » September 9th, 2019, 10:28 am

By creating a second configuration file with a different port and different output configuration, optionally attached to the first MPD with the "proxy" database plugin (https://www.musicpd.org/doc/html/user.html#satellite).
Then you can create a copy of "mpd.service" which specifies the second configuration file, and launch it with "systemctl". (This assumes that you're using systemd to start MPD. I don't know that, because you didn't provide any insight into your setup.)

haok
Posts: 6
Joined: September 19th, 2014, 11:51 pm

Re: Second MPD instance for HTTP streaming

Post by haok » September 10th, 2019, 1:59 am

Thanks for the tips, directions and help. I now have a second instance of a mpd service active.

However, I'm not able connect to my mpd library.

I tried the satellite sharing using the proxy database plugin, but it did not connect.

This is an extract of the 2nd conf file:

music_directory "/media/4tb/music"
playlist_directory "/media/4tb/config/mpd/playlists"
#db_file "/var/lib/mpd/tag_cache"
database {
plugin "proxy"
}
log_file "/home/henry/.mpd/mpd2.log"
pid_file "/run/mpd/pid2"
state_file "/var/lib/mpd/state2"
sticker_file "/var/lib/mpd/sticker2.sql"
port "6600"
log_level "verbose"
auto_update "yes"
follow_outside_symlinks "yes"
follow_inside_symlinks "yes"
zeroconf_enabled "yes"
zeroconf_name "Music Player"
input {
plugin "curl"
}
audio_output {
type "httpd"
name "My Stream"
encoder "lame" # optional, vorbis or lame
port "6608"
quality "3.0" # do not define if bitrate is defined
format "44100:16:2"
always_on "yes"
tags "yes"
}
replaygain "track"
replaygain_preamp "12"
volume_normalization "no"
audio_buffer_size "4096"
buffer_before_play "50%"
samplerate_converter "Best Sinc Interpolator"
id3v1_encoding "UTF-8"

max
Forum team
Posts: 922
Joined: January 15th, 2013, 3:43 pm

Re: Second MPD instance for HTTP streaming

Post by max » September 10th, 2019, 7:46 am

Your configuration doesn't make sense. You configured port 6600, but what port is your first MPD running on? And your "proxy" database by default connects to localhost:6600, which means your second MPD connects to itself.

haok
Posts: 6
Joined: September 19th, 2014, 11:51 pm

Re: Second MPD instance for HTTP streaming

Post by haok » September 10th, 2019, 8:37 am

Thanks Max. The primary MPD is configured for port 6700. No problems with this install at all.

max
Forum team
Posts: 922
Joined: January 15th, 2013, 3:43 pm

Re: Second MPD instance for HTTP streaming

Post by max » September 10th, 2019, 8:55 am

Then you should configure the "proxy" to connect to port 6700.

haok
Posts: 6
Joined: September 19th, 2014, 11:51 pm

Re: Second MPD instance for HTTP streaming

Post by haok » September 12th, 2019, 12:17 am

Thanks Max so much for you help. I now have satellite mode working seamlessly. So cool.

These are conf settings from my secondary player:

music_directory "/media/4tb/music"
playlist_directory "/media/4tb/config/mpd/playlists"
#db_file "/var/lib/mpd/tag_cache"
database {
plugin "proxy"
port "6700"
}
log_file "/home/henry/.mpd/mpd2.log"
pid_file "/run/mpd/pid2"
state_file "/var/lib/mpd/state2"
sticker_file "/var/lib/mpd/sticker2.sql"

Post Reply