Hi Guys,

I present myself, I'm Thomas Guillem I'm an android developer, and I use
MPD since a very long time and can't use anything else to play my music.

I have an Android TV stick plugged to my TV and to an Hi-fi amplifier and I
wanted to listen to my music and control it with a MPD client.

So I ported MPD on android, not an other client, but the real server.

The first release is ready, free and available on github
https://github.com/tguillem/android-ampd

This repo contains the aMPD source code, and git submodules I hosted on my
github. Thoses submodules contains MPD dependencies slightly modified to
build on android (android-curl, android-libav, android-glib,
android-libiconv and android-mpd).

You can see the patches I made on MPD here:
https://github.com/tguillem/android-mpd/commits/master

 - I added the android output plugin, don't look at the code, it's quite
ugly: I used Android AudioTrack class in C via a dlopen to "libmedia.so"
and dlsym to AudioTrack symbols since you can't use C++ here. Indeed, if
you do a "new  AudioTrack" in c++, the object size will depend on
AudioTrack header. From my experience, a lot of android constructors change
the c++ headers, and using and allocating an object with wrongs headers can
lead to severe memory corruption.

 - I added android logs via logcat.

 - I added libmpd.c copied from main.c. That way I can run MPD from a lib
call. Indeed you can't run any binaries from an Android app, so I created a
service that spawn a thread that run mpd via this lib call.

The app is quite basic for now. When you run it, you get a Settings
Activity that allow you to configure some basic MPD options (music
directory, port and if you want to run MPD on device boot).

I had one small issue during the port, MPD can't be run, stopped, and run
again in the same process. I started to fix some finish and init function
to free and reset NULL pointers. It worked but it was quite instable on the
second run and I had some serious memory leaks, and then I choose the wrong
and easy path: I decided to kill the Service on second run. It's
transparent for the user since the Settings UI and the background service
are in 2 different processes.

You can download and test the apk from
https://github.com/tguillem/android-ampd/releases or from the play store:
https://play.google.com/store/apps/details?id=be.deadba.ampd.

Yep I know, MPD server on android is not a very common use case, but
anyway...

Cheers,
Thomas Guillem
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Musicpd-dev-team mailing list
Musicpd-dev-team@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team

Reply via email to