You are not logged in.

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

Spheerys
Member
Registered: 2012-05-01
Posts: 86

[mpd] Play sound from a mpd server on a smartphone (solved)

Hi,

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...

Last edited by Spheerys (2018-03-24 08:22:39)

Offline

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

opt1mus
Member
From: UK
Registered: 2011-12-31
Posts: 212
Website

Re: [mpd] Play sound from a mpd server on a smartphone (solved)

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.

edit0;

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.

edit1;

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 "0.0.0.0"               # 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 0.0.0.0 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 127.0.0.1, save you folks some typing.

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

Offline

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

progandy
Member
Registered: 2012-05-17
Posts: 5,190

Re: [mpd] Play sound from a mpd server on a smartphone (solved)

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.

https://github.com/abarisain/dmix/issues/219
https://github.com/abarisain/dmix/wiki/Configure-MPD

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


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

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

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: [mpd] Play sound from a mpd server on a smartphone (solved)

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

Offline

#5 2018-03-24 08:17:06

Spheerys
Member
Registered: 2012-05-01
Posts: 86

Re: [mpd] Play sound from a mpd server on a smartphone (solved)

Thanks for your answers !
I used with success the opt1mus's solution smile

I notived 2 sides effects :
- I need to use another player on my smartphone because I didn't found the way to play the stream from mpdroid nor malp.
- I notice a cache delay when I'm changing song

But I'm not sure we can't avoid this...

Offline

#6 2018-03-24 09:15:44

progandy
Member
Registered: 2012-05-17
Posts: 5,190

Re: [mpd] Play sound from a mpd server on a smartphone (solved)

https://github.com/gateship-one/malp/wiki/FAQ

How can I use MPDs remote streaming capability?

    Enable the option "Enable streaming from server" under the server profile and enter a valid streaming URL. Afterwards you can start streaming from the NowPlayingViews menu


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#7 2018-03-24 12:53:38

Spheerys
Member
Registered: 2012-05-01
Posts: 86

Re: [mpd] Play sound from a mpd server on a smartphone (solved)

OK thanks !

Last edited by Spheerys (2018-03-24 21:05:32)

Offline

Board footer

Powered by FluxBB