Page 1 of 1

Remote Connection To MPD

Posted: March 27th, 2021, 8:37 pm
by JamesCRocks
Hi,

Having installed and configured MPD, I set about demonstrating that it worked on the same machine (aka SERVER). I used the client MPDCtrl on Microsoft Store. It worked fine on the host system, using 127.0.0.1 as the host and 6600 as the port.

Unfortunately, I have not been as successful in running the same client, same parameters (IP changed to 192.168.1.xx) on a remote client machine (aka CLIENT). The error message I get from MPDCtrl is:
"Connection Error: TCP connection error: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond"

In pursuit of resolving this I have configured the relevant port (6600, TCP & UDP, in & out) on the SERVER and tested it using TELNET on both SERVER & CLIENT; I have also tested it with a served game (BZFlag) running on 6600, which worked fine.

The following is my mpd.conf file.

Code: Select all

music_directory "c:/mpd/"
log_file "c:/mpd/mpd.log"
db_file "c:/mpd/mpd.db"
playlist_directory "c:/mpd/playlists"
bind_to_address "0.0.0.0"
audio_output {
    type "winmm"
    name "Speakers"
    device "Speakers (Sound Blaster Play! 3)"
}
audio_output {
    type "httpd"
    name "My HTTP Stream"
    encoder "vorbis" # optional, vorbis or lame
    port "6600"
    # quality "5.0" # do not define if bitrate is defined
    bitrate "128" # do not define if quality is defined
    format "44100:16:1"
}
To recap:
  • MPD is installed and seems to work fine. I can play music locally (on the SERVER machine) using MPDCtrl (IPs tested: 127.0.0.1 & 192.168.1.xx, port 6600).
  • SERVER firewall is configured to allow TCP & UDP traffic in both directions on port 6600. I have tested this as working using a game (BZFlag both SERVER & CLIENT - IP: 192.168.1.xx, Port: 6600) as well as TELNET (when the game server is running).
  • When MPD is running neither telnet or MPDCtrl (both testing IP: 192.168.1.xx, port 6600) can connect.
  • MPDCtrl running on the CLIENT machine cannot communicate with MPD running on the SERVER machine (IPs: 192.168.1.xx, Port: 6600), generating the message:
    "Connection Error: TCP connection error: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond".
Since everything else has been demonstrating as working correctly, I have to assume I have incorrectly configured MPD and would appreciate someone perusing my MPD.CONF with a view to figuring out what I've done.

Cheers :)

James

Re: Remote Connection To MPD

Posted: March 28th, 2021, 9:42 am
by max
You configured your "httpd" output on port 6600, but the control port also defaults to port 6600 (since you did not specify a different non-standard port). That doesn't make sense.

Re: Remote Connection To MPD

Posted: March 28th, 2021, 9:16 pm
by JamesCRocks
Hi Max,
max wrote: March 28th, 2021, 9:42 amYou configured your "httpd" output on port 6600, but the control port also defaults to port 6600 (since you did not specify a different non-standard port). That doesn't make sense.
I don't understand. The only port I have been using is 6600, which is configured multi-directionally for TCP & UDP. Is there a control port setting I am missing from mpd.conf? I honestly wouldn't know, I stole that from some guy's blog page (he seemed to know his stuff) and edited it to suit my test setup.

James

Re: Remote Connection To MPD

Posted: March 28th, 2021, 9:33 pm
by max
JamesCRocks wrote: March 28th, 2021, 9:16 pmThe only port I have been using is 6600, which is configured multi-directionally for TCP & UDP.
Not exactly true. UDP is not used. And what does "multi-directional" mean?
JamesCRocks wrote: March 28th, 2021, 9:16 pmIs there a control port setting I am missing from mpd.conf?
Yes, and it's all documented: https://www.musicpd.org/doc/html/user.html#listeners

You configured only a streaming port. But how would you be able to tell MPD what to play?
JamesCRocks wrote: March 28th, 2021, 9:16 pmhe seemed to know his stuff
Haha.

Re: Remote Connection To MPD

Posted: March 29th, 2021, 4:58 pm
by JamesCRocks
max wrote: March 28th, 2021, 9:33 pmNot exactly true. UDP is not used. And what does "multi-directional" mean?
I can remove the firewall rules for UDP but would that really be a problem (having something there that it isn't using)? Multi-directional i.e. both ways (inbound and outbound).
JamesCRocks wrote: March 28th, 2021, 9:16 pmIs there a control port setting I am missing from mpd.conf?
max wrote: March 28th, 2021, 9:33 pmYes, and it's all documented: https://www.musicpd.org/doc/html/user.html#listeners

You configured only a streaming port. But how would you be able to tell MPD what to play?
I can see it's all documented, but it's very "linuxy" and doesn't make a great deal of sense to me.

Should my "bind to address" line be: bind_to_address "192.168.1.xx" (the IP of my SERVER machine)?

James

Re: Remote Connection To MPD

Posted: March 29th, 2021, 5:59 pm
by max
Why do you want to configure bind_to_address?

This isn't "linuxy", this is "IPy", this is about configuring servers for the Internet Protocol, and that's the same on Windows and Linux. But on most Windows programs, you usually don't have options like "bind_to_address" - those programs just bind to everything. MPD gives you this level of control, but you don't need to use it. If you omit it, MPD works just like those Windows programs.
That's why I asked: why do you use it?

(Probably because you took bad advice from that guy's blog.)

Re: Remote Connection To MPD

Posted: April 2nd, 2021, 2:46 pm
by JamesCRocks
max wrote: March 29th, 2021, 5:59 pmWhy do you want to configure bind_to_address?
Like I said, I just copied it from some guy's blog.
max wrote: March 29th, 2021, 5:59 pmThis isn't "linuxy", this is "IPy", this is about configuring servers for the Internet Protocol, and that's the same on Windows and Linux. But on most Windows programs, you usually don't have options like "bind_to_address" - those programs just bind to everything. MPD gives you this level of control, but you don't need to use it. If you omit it, MPD works just like those Windows programs.
That's why I asked: why do you use it?
Because Windows programs rarely seem to get configured that way these days, usually it's some kind of graphical interface ... that's why I said "linuxy" :)

Are you saying I don't need the bind_to_address at all?
max wrote: March 29th, 2021, 5:59 pm(Probably because you took bad advice from that guy's blog.)
This is the page: https://www.chriswarrick.com/blog/2013/ ... n-windows/

He seemed to know his stuff.

James

Re: Remote Connection To MPD

Posted: April 2nd, 2021, 5:06 pm
by max
JamesCRocks wrote: April 2nd, 2021, 2:46 pm Are you saying I don't need the bind_to_address at all?
Correct.

Re: Remote Connection To MPD

Posted: April 10th, 2021, 7:48 am
by mascaret
Hi!
Did you authorize mpd to go through win10's firewall?
Working fine here (mpd on win10, MALP on android).

Re: Remote Connection To MPD

Posted: April 11th, 2021, 1:53 pm
by JamesCRocks
Hi Mascaret,
mascaret wrote: April 10th, 2021, 7:48 amDid you authorize mpd to go through win10's firewall? Working fine here (mpd on win10, MALP on android).
If you mean is there are firewall port configured, yes.

As said in my initial post, SERVER firewall is configured to allow TCP & UDP traffic in both directions on port 6600. I have tested this as working using a game (BZFlag both SERVER & CLIENT - IP: 192.168.1.xx, Port: 6600) as well as TELNET (when the game server is running).

Thanks :)

James

Re: Remote Connection To MPD

Posted: April 11th, 2021, 2:56 pm
by JamesCRocks
max wrote: March 28th, 2021, 9:42 amYou configured your "httpd" output on port 6600, but the control port also defaults to port 6600 (since you did not specify a different non-standard port). That doesn't make sense.
Thank you. That worked :)

James