You are not logged in.

#1 2015-02-11 02:40:16

emacsomancer
Member
Registered: 2014-09-20
Posts: 211

connecting to mpd over the Internet (outside home network) - error

I'm trying to connect to an mpd instance running on my home computer from my computer at work.  I have an OpenVPN server at home, and so I can securely connect to my home network from work.  I've set up a second instance of mpd and icecast at home, and I'm trying to connect to this at work.  I can connect to the extent of being able to pull my library, playlist info over, but I can't actually seem to play anything.

When I look at the mpd error messages, I find:

shout_output: Failed to open "exelion HD mpd stream" [shout]: problem opening connection to shout server localhost:8000: Login failed
output: Failed to open audio output

I'm trying to connect using Cantata (which I use at home and like). 

Things I've played with:

originally in my mpd config I had:

user            "source" 

I tried commenting that out and just letting mpd use whatever the default user is, but that didn't seem to help.

The other thing I wonder about but haven't tried is different settings for "admin-user" in the icecast config.

I currently have

<admin-user>my-home-usernamer</admin-user>

.  Should I change this to "admin"?  Does it matter? 

The passwords match between the mpd and icecast configs.

Offline

#2 2015-02-11 02:50:34

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,804

Re: connecting to mpd over the Internet (outside home network) - error

Just a sanity check -- suppose this worked.  Where do you expect the sound to be?  If there is no one there to hear it, is there any sound?

Usually when you connect to mpd over a TCP link, you are controlling the sound on the sound system of the computer that is running mpd.  The idea being that you can have a media server in a rack in a closet somewhere and control the music in the local environment from some other device - a computer, a tablet, a phone.  In other words, the music is not going to play wherever it is that you are, it will play at home.  I think the permission problems is that the sound system is not associated with the VPN link, it is associated with the console of the computer at your house.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2015-02-11 02:59:12

emacsomancer
Member
Registered: 2014-09-20
Posts: 211

Re: connecting to mpd over the Internet (outside home network) - error

ewaller wrote:

Just a sanity check -- suppose this worked.  Where do you expect the sound to be?  If there is no one there to hear it, is there any sound?

Usually when you connect to mpd over a TCP link, you are controlling the sound on the sound system of the computer that is running mpd.  The idea being that you can have a media server in a rack in a closet somewhere and control the music in the local environment from some other device - a computer, a tablet, a phone.  In other words, the music is not going to play wherever it is that you are, it will play at home.  I think the permission problems is that the sound system is not associated with the VPN link, it is associated with the console of the computer at your house.

I have the mpd instance in question outputting to "shout", and have icecast running, and (I think I) have Cantata set up to accept the icecast http:// stream as input.  So I think that my setup should be sane, in theory.

In general, computers on a network should be able to control mpd instances running on other machines in the network, right?  So, once I'm connected via VPN, I'm another machine on the network, no?

Offline

#4 2015-02-11 03:15:21

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: connecting to mpd over the Internet (outside home network) - error

This doesn't appear to have anything to do with your client config; it seems pretty clearly an authentication issue between the mpd server when connecting to the icecast server:

shout_output: Failed to open "exelion HD mpd stream" [shout]: problem opening connection to shout server localhost:8000: Login failed
output: Failed to open audio output

Offline

#5 2015-02-11 03:50:47

emacsomancer
Member
Registered: 2014-09-20
Posts: 211

Re: connecting to mpd over the Internet (outside home network) - error

fukawi2 wrote:

This doesn't appear to have anything to do with your client config; it seems pretty clearly an authentication issue between the mpd server when connecting to the icecast server:

shout_output: Failed to open "exelion HD mpd stream" [shout]: problem opening connection to shout server localhost:8000: Login failed
output: Failed to open audio output

When I run icecast, I get the following warnings:

[2015-02-10  20:48:42] WARN CONFIG/_parse_root Warning, <hostname> not configured, using default value "localhost". This will cause problems, e.g. with YP directory listings.
[2015-02-10  20:48:42] WARN CONFIG/_parse_root Warning, <location> not configured, using default value "Earth".
[2015-02-10  20:48:42] WARN CONFIG/_parse_root Warning, <admin> contact not configured, using default value "icemaster@localhost".

Offline

#6 2015-02-11 08:41:03

Foucault
Member
From: Athens, Greece
Registered: 2010-04-06
Posts: 214

Re: connecting to mpd over the Internet (outside home network) - error

Just in case you are not aware of it, MPD has built-in HTTP streaming to mp3/ogg/whatever. Unless you need any of the more advanced Icecast features, just use the httpd audio_output and get done with it.

Last edited by Foucault (2015-02-11 08:41:28)

Offline

#7 2015-02-11 18:22:24

emacsomancer
Member
Registered: 2014-09-20
Posts: 211

Re: connecting to mpd over the Internet (outside home network) - error

Foucault wrote:

Just in case you are not aware of it, MPD has built-in HTTP streaming to mp3/ogg/whatever. Unless you need any of the more advanced Icecast features, just use the httpd audio_output and get done with it.


Thanks. I didn't know that. But that seems much easier.  I tried this, but I'm still having trouble.  From the mpd server I get the following report:

path: SetFSCharset: fs charset is: UTF-8
libsamplerate: libsamplerate converter 'Fastest Sinc Interpolator'
vorbis: Xiph.Org libVorbis 1.3.4
opus: libopus 1.1
sndfile: libsndfile-1.0.25
db: reading DB
curl: version 7.40.0
curl: with OpenSSL/1.0.2
avahi: Initializing interface
avahi: Client changed to state 2
avahi: Client is RUNNING
avahi: Registering service _mpd._tcp/Music Player
avahi: Service group changed to state 0
avahi: Service group is UNCOMMITED
avahi: Failed to add service _mpd._tcp: Local name collision
state_file: Loading state file /home/user/.mpd/icecast-state
server_socket: bind to '0.0.0.0:8000' failed: Address already in use (continuing anyway, because binding to '[::]:8000' succeeded)
playlist: play 0:"Bob Marley/Bob Marley & the Wailers (1972-1980) - The Unreleased Studio Sessions/Disc 01 - The 'Catch A Fire' Sessions/1-01 Concrete Jungle (Studio Demo).mp3"
replay_gain: replay gain mode has changed -1->1
replay_gain: scale=1.000000
replay_gain: replay gain mode has changed -1->1
replay_gain: scale=1.000000
config: option 'quality' on line 19 was not recognized
playlist: queue song 1:"Bob Marley/Bob Marley & the Wailers (1972-1980) - The Unreleased Studio Sessions/Disc 01 - The 'Catch A Fire' Sessions/1-02 Slave Driver (Studio Demo).mp3"
decoder: audio_format=48000:24:2, seekable=true
client: [0] opened from 192.168.1.5:53478
client: [1] opened from 192.168.1.5:53479
client: [1] process command "channels"
client: [1] command returned 0
client: [1] process command "idle"
client: [1] command returned 1
client: [0] process command "status"
client: [0] command returned 0
client: [0] process command "stats"
client: [0] command returned 0
client: [0] process command "urlhandlers"
client: [0] command returned 0
client: [0] process command "tagtypes"
client: [0] command returned 0
client: [0] process command "currentsong"
client: [0] command returned 0
client: [0] process command "replay_gain_mode off"
replay_gain: replay gain mode has changed 1->-1
replay_gain: replay gain mode has changed 1->-1
client: [0] command returned 0
client: [0] process command "listallinfo"
buffered_socket: error on client 0: Output buffer is full
client: [0] command returned 0
client: [0] closed
client: [2] opened from 192.168.1.5:53480
client: [2] process command "playlistinfo"
client: [2] command returned 0
client: [2] process command "status"
client: [2] command returned 0
client: [2] process command "status"
client: [2] command returned 0
client: [2] process command "listallinfo"
buffered_socket: error on client 2: Output buffer is full

Offline

#8 2015-02-11 21:21:01

Foucault
Member
From: Athens, Greece
Registered: 2010-04-06
Posts: 214

Re: connecting to mpd over the Internet (outside home network) - error

It's very difficult to debug the problem without your configuration file. However I suggest starting with a simple config file and work your way up, something like this from my configuration, adjust to your pleasure

music_directory "/path/to/music"
playlist_directory "/path/to/playlists"
db_file "/path/to/mpd/database"
log_file "/path/to/log/file"
pid_file "/path/to/pid/file"
state_file "/path/to/state/file"

user "MPD-USER-HERE"
group "MPD-GROUP-HERE"
bind_to_address "::"
port "6600" # mpd port
log_level "secure" # whatever you want

restore_paused "yes"
follow_outside_symlinks "yes"
follow_inside_symlinks "yes"

input {
  plugin "curl"
}

# Either this, for plain ALSA
audio_output {
  type "alsa"
  name "MPD ALSA"
  mixer_type "software"
}

# or this for pulseaudio
audio_output {
  type "pulse"
  name "MPD Pulseaudio"
}

# http streaming
audio_output {
  type "httpd"
  name "MPD MP3 Stream"
  encoder "lame"
  port "9999" # or whatever
  bitrate "128" # or whatever
}

When the "MPD MP3 Stream" output is enabled (mpc enable "MPD MP3 Stream", name must be the same as the one defined in the audio_output) you can connect your player at port 9999 (that's the stream port, not MPD port) on the computer that MPD is running and stream MPD's playlist.

Offline

#9 2015-02-12 00:37:13

emacsomancer
Member
Registered: 2014-09-20
Posts: 211

Re: connecting to mpd over the Internet (outside home network) - error

Foucault wrote:

It's very difficult to debug the problem without your configuration file. However I suggest starting with a simple config file and work your way up, something like this from my configuration, adjust to your pleasure

That's true - I should have included that.

But, in fact, I have finally got it to work --- in the sense that I can control music with cantata, but for some reason cantata won't access the stream.  I can access it via a webbrowser though.  Has anyone here successfully configured Cantata to accept audio from a remote (http://) source?

Offline

#10 2015-02-12 14:23:40

Foucault
Member
From: Athens, Greece
Registered: 2010-04-06
Posts: 214

Re: connecting to mpd over the Internet (outside home network) - error

I don't believe you can use cantata as BOTH and mpd client AND audio streamer at the SAME time. Can you access the stream from the command line? eg. mpv http://ip.of.mpd:9999 (or whatever player you want)

Offline

#11 2015-02-12 19:52:03

emacsomancer
Member
Registered: 2014-09-20
Posts: 211

Re: connecting to mpd over the Internet (outside home network) - error

Foucault wrote:

I don't believe you can use cantata as BOTH and mpd client AND audio streamer at the SAME time. Can you access the stream from the command line? eg. mpv http://ip.of.mpd:9999 (or whatever player you want)

The interface suggests that it should work as both mpd client and streamer simultaneously:
AoRI4ZK.png

[I was able to access the stream via a webbrowser, so I would assume I would be able to access it via mpv as well.]

Offline

#12 2015-02-13 18:23:37

Foucault
Member
From: Athens, Greece
Registered: 2010-04-06
Posts: 214

Re: connecting to mpd over the Internet (outside home network) - error

You must enable the stream first. Click on the settings button on top right -> Play Stream. It seems to buffer quite a lot though, so expect latency between commands and playback.

Offline

Board footer

Powered by FluxBB