💾 Archived View for tilde.cafe › ~chrono › blog › 2021-04-09-mpd-android-streaming.gmi captured on 2022-03-01 at 15:15:34. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

..

So, this morning I was watching a video by HexDSL, where he rambles about many things (as usual). However, he mentioned something that got my attention. He is now streaming music to his phone[^1], using MPD[1].

I decided to try and do the same. Streaming my own music has been something I've wanted for a while. I looked around for ways to achieve it and I found a blog by Joran Schrijver[^2] where he shares the solution I chose to follow, and that I am going to share here, as well as some troubleshooting I had to go to get this working. *You don't even need to have MPD installed on your desktop!*

Install an android client

Now, we first need to install MPD itself, you can find it here[2]. We also need a client to play our music from. There are many options, MPDroid[3] is one of them, it has not been updated in a while, but its interface is still decent if you want it. MAFA[4] is the solution suggested by Joran, but it is paid, and I am not sure if it's FOSS, but if you don't mind, go for it. HexDSL however, suggested M.A.L.P[5] and it's actually a really good FOSS option too, which is a little more recent, since its last update was 4 months ago.

Satellite setup on your desktop

So, before we configure MPD on your client device, we have to setup a server. The way Joram did is with a quick Python command.

python -m http.server --directory ~/music 8000

I assume you can setup any other way you like.

Configuring your Android device

Up until now, you could say I am just stealing Joram's blog, but here is where things change just a little bit. By following it, I got a bit stuck, so I went to the Arch Wiki[^3] for help with this problem.

Setting up MPD on Android

First things first, create a text file and name it `mdp.conf` and put it in Android's home directory (`/storage/emulated/0/mdp.conf`).

After that, you have to add the following lines to it. I got this additions from the wiki

# located at /storage/emulated/0/mpd.conf
music_directory "http://desktop_ip_address:8000/"

database {
  plugin "proxy"
  host "desktop_ip_address"
}

audio_output {
  type "sles"
  name "Any name you want"
}

In order to know your PC's IP address, just run `ip address` on your terminal and look for it, It should be something like `192.168.0.x`

Now just run the MPD app, there might be some exceptions or things that look like errors on the log, but as far as I can tell, it should be nothing serious. **Make sure to look for a line mentioning the loading of the config file**, you might have not placed it correctly, or have some mistake.

Setting up your MPD Client

Now, you have to set up the Music player. Depending on your app, there might be some different paths to take. These are the settings that show up by default (and it works), so I just want to share them to make sure we are on the same page.

MPDroid

Go to Settings -> Connection Settings -> Default Connection Settings.

You can play around with the settings. Also, there is a dark theme and you **must** enable it.

M.A.L.P

You can go to Profiles, and set up the same things. However, there might be one already setup for you.

In both cases you will be able to see the output with the same name as the one you gave to it in `mpd.conf`

In case something doesn't work

Now play some music!, and finish this up

If you did everything correctly, your music app of choice should begin to load your music library, and you should be able to play it with no problems.

Once again, I am not here to guarantee that this will work. You can check the footnotes for more help if you still did not manage to get your MPD streaming working.

The caveat of this, is that you have to keep your machine running that pyhton command. But you could figure out a way to make this better, the Arch wiki has some suggestions that you might want to take a look at.

This has been day 31 of #100DaystoOffload[6]

[^1]: HexDSL tutorial here[7] [^2]: Joram's tutorial here[8] [^3]: MPD Tips and Tricks (Arch Wiki)[9]

1: https://www.musicpd.org/

2: https://f-droid.org/en/packages/org.musicpd

3: https://f-droid.org/en/packages/com.namelessdev.mpdroid/

4: https://play.google.com/store/apps/details?id=software.indi.android.mpd

5: https://f-droid.org/en/packages/org.gateshipone.malp/

6: https://100DaystoOffload.com

7: https://hexdsl.co.uk/posts/i-setup-mpd-streaming.html

8: https://www.joram.io/blog/android-streaming-mpd/

9: https://wiki.archlinux.org/index.php/Music_Player_Daemon/Tips_and_tricks#Music_streaming_with_the_satellite_setup