You are not logged in.
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
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
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
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
Thanks for your answers !
I used with success the opt1mus's solution
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
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
OK thanks !
Last edited by Spheerys (2018-03-24 21:05:32)
Offline