You are not logged in.

#1 2018-03-06 21:41:06

Registered: 2012-05-01
Posts: 22

[mpd] Play sound from a mpd server on a smartphone : possible ?


I have a working mpd server, which I can control by MALP or MPDroid.
The output is the speakers which are connected to the server, via alsa.

My question is the following : is it possible to add another output called for example "My smartphone" to play sound on it from the distant mpd server ?

And if yes, how to do this ?
I have difficulties to founding doc to do this...


#2 2018-03-06 22:20:56

From: UK
Registered: 2011-12-31
Posts: 200

Re: [mpd] Play sound from a mpd server on a smartphone : possible ?

Yes it is possible.

I've done this on an old N900, MPD for a while now comes with a HTTP streamer, so I enabled it in the mpd config (it is configured with a sound block, it should be there as an example, modify as needed), then pick up the HTTP stream through a network - I had this working through SSH incidentally, this way I could use a curses client to manipulate MPD - with some appropriate player, in my case I used mpv.


Depending on who you want to give access to the stream, where you point the HTTP stream, I pointed it to localhost and forwarded the ports w/ SSH to pick it up with mpv.


You'll see this block in the MPD config;

audio_output {
       type            "httpd"
       name            "My HTTP Stream"
       encoder         "vorbis"                # optional, vorbis or lame
       port            "8000"
       bind_to_address ""               # optional, IPv4 or IPv6
       quality         "5.0"                   # do not define if bitrate is defined
       bitrate         "128"                   # do not define if quality is defined
       format          "44100:16:1"
       max_clients     "0"                     # optional 0=no limit

In my case I set localhost as the bind address, instead of as I was only ever picking it up through the SSH forwarded port (8000). Then it'd play on whatever I was SSHing into the server from with;

mpv http://127.1:8000

Toptip 127.1 resolves to, save you folks some typing.

Last edited by opt1mus (2018-03-06 22:36:53)


#3 2018-03-06 22:38:31

Registered: 2012-05-17
Posts: 2,710

Re: [mpd] Play sound from a mpd server on a smartphone : possible ?

mpdroid should be able to pick up the http stream from mpv. If you use http basic auth with a reverse proxy, you should also be able to use simple password protection.  ssh is more complicated. I wonder how well https (e.g. with letsencrypt) would work in conjunction with basic auth.

Last edited by progandy (2018-03-06 22:40:12)


#4 2018-03-07 05:53:17

From: Germany
Registered: 2007-08-14
Posts: 1,887

Re: [mpd] Play sound from a mpd server on a smartphone : possible ?

Mpdroid is dead though and has nasty network handling. but there is also M.A.L.P. which is properly maintained and also supports this feature.

He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams


Board footer

Powered by FluxBB