Release 'music player daemon'-package (mpd+mpc+ncmpc)


lomaxx

Active Member
Joined
Sep 22, 2008
Messages
747
I've created a pnd containing:


- the music player daemon (mpd).


- "mpc", a command-line-player for mpd


- "ncmpc", a console-player (text-mode) for mpd


- "ncmpcpp", a fork of "ncmpc" with some additional features.


- hopefully all libraries needed to run the above.


- a small bash-menu


In addition you might need to have the codec-pack installed as well as the timidiy-midi-installer for mid-file-playback. I'm not sure about that though.


For changes in 0.4.0 look -> here.


Known issues:


- Adding a directory containing many NSFs (Nintendo Sound Files) can easily make your System freeze. This might also refer to other formats supported by libgme. I experienced the same problem on my desktop-PC. Disabling the scanning of tags in mpd.conf (metadata_to_use "none") seems to improve the situation a little bit, but still I can not recommend to add many of such files.


- mid-support is broken for some reason when running mpd from within the PND for some reason. I didn't manage to track the problem down. All I can say is that it works when I run MPD before PNDing it. You should be able to get mid-support going if you unpack the content of the pnd into some directory on your SD-card and run "./run.sh" from there.


- MPD does support browsing through ZIP-files, but I noticed that modules (tracked music played through modplug) are not being played. You can add them to the playlist, but the songlength won't be shown and they won't play. You need to unpack them if you want to play them.


- in ncmpcpp unicode does not work which results in strange looking character-sequences for characters like "ä" "ö" "ß". This is due to the configuration of the PandoraOS. Unicode in MPD does work as I tested by remotely logging with a client from another PC.


The current mpd-configuration is:


########### MPD CONFIGURATION ############


Archive support:


(+bzip2) (-ISO9660) (+ZIP)


Client support:


(+IPv6) (+TCP) (+UNIX Domain Sockets)


File format support:


(+AAC) (+C64 SID) (-FFMPEG) (+FLAC) (-FluidSynth) (+GME) (-libsndfile)


(-MikMod) (+MODPLUG) (+MAD) (-MPG123) (+MP4) (+Musepack)


(-OggTremor) (+OggVorbis) (+WAVE) (-WavPack) (+WildMidi)


Other features:


(+libsamplerate) (+inotify) (-SQLite)


Metadata support:


(+ID3)


Playback support:


(+ALSA) (-FFADO) (+FIFO) (+File Recorder) (+HTTP Daemon) (-JACK)


(-libao) (-Media MVP) (+OSS) (-OpenAL) (-OS X) (-Pipeline)


(-PulseAudio) (-ROAR) (-SHOUTcast) (-Solaris) (-WinMM)


Streaming encoder support:


(+FLAC) (+LAME) (+Ogg Vorbis) (+TwoLAME) (+WAVE)


Streaming support:


(-CDIO_PARANOIA) (+CURL) (-Despotify) (+Last.FM) (+Soundcloud)


(+MMS) (+SOUP)


##########################################


I decided to leave out the following support:


- iso9660 as it's unlikely that someone wants to browse through iso-files on the Pandora


- ffmpeg as i didn't know what additional benefits this would bring (maybe it does though)


- fluidsynth as I am currently not sure if both - wildmidi AND fluidsynth - is needed or which one is better. fluidsynth is also probably more complicated to be ported.


- libsndfile: Is there a need for this?


- mikmod as I decided to use modplug instead. Any reason to use mikmod instead or as well?


- despotify as i had no time to think about it so far. ;)


Either use the bash-menu or from within the integerated terminal you can run the wrapper-scripts manually:


./mpd.sh


./mpc.sh


./ncmpc.sh


./ncmpcpp.sh


This is the only way to use "mpc" and might be useful if you want to specify parameters to the other three programs.


"./mpd.sh" should start mpd and on the first run create a "./.mpd/mpd.conf" with modified absolute paths to some other config-files. If you decide to move the whole mpd-directory to some other place you need to delete that config-file. This is a workaround as i can not enter relative paths in the config-file and changing the HOME-environment-variable does not seem to help. mpd seems to have it's own mechanism of expanding the "~".


To start you need to create soft-symlinks in ./.mpd/music/ pointing to directories containing your music-files. Something like:


"ln -s /path/to/your/mp3-collection/ ./.mpd/music/mp3s"


This will not work on fat-filesystems. See the implemented documentation or further down in this thread for a solution. Once you did that, you should be ready to update the mpd-database. For example by running:


"./mpc.sh update"


Next try to run ncmpcpp If ncmpcpp starts, then try buttons 1 to 3. Button 1 will show you the help and get you started. Try pressing "3". If setting the symlinks worked, then you should see at least one entry in the window. You can press "Space" to add all songs of that directory to the playlist. Now press "2", choose some song and press enter to start playing a song. I hope you can now enjoy listening to your music while learning more about ncmpcpp from it's help-section (button "1"). You can also quit ncmpcpp by pressing "q". Your music will continue to play as the daemon is still running.


More help by typing in the terminal:


./mpd.sh --help


./mpc.sh help (without --)


./ncmpc.sh --help


Use your favorite editor to edit "./.mpd/mpd.conf". There are some useful options and most of them are explained decently.


Download-link: http://repo.openpand...app=mpd-package
 
Last edited by a moderator:
Well, i can try that as well. I was just getting SOME player up so far.


I am not very experienced with any of the two players. I got the one running on the Pandora and the other one running on my Gentoo-box. But not for more than about two weeks.


Why do you prefer ncmpcpp?
 
Porting-diary: Day #dunno:


I tried to get gme-support implemented, but failed. Compiling libgme was not that much of a problem, although I first had to install cmake. I decided to install cmake via opkg, which worked and after that libgme compiled and installed without further trouble.


Unfortunately the configure-mechanism of mpd still does not recognize that libgme is installed. And I didn't manage to find out why. I tried to use different --prefix-values for libgme installation, applied a patch that comes with the gentoo-repository-package of my desktop-pc, tried to use various CPPFLAGS- and LDFLAGS-values when configuring mpd, but nothing worked.


At least I got lastfm-support implemented, which was as easy as simply adding "--enable-lastfm" to the configure-command-line.


After maybe 2 hours I gave up and tried to compile ncmpcpp. First I had issues when using the latest git-version. I tried to run "./autogen.sh" but that spitted some errors at me that I didn't really understand. So I decided to use the latest stable version. That gladly came with a "./configure.sh" which worked, but some time later I noticed that it needs libgcrypt. When trying to compile that I was told that it needs libgpg-error. So I compiled and installed that, after that libgcrypt and last but not least tried ncmpcpp again.


This time it worked.


So now I have a running ncmpcpp-version on my pandora which will be packed the next time when i reupload the tarbal (not now).


btw: Did you, dreamer, or anyone else already test the package? I could use some feedback even if it works flawless. Otherwise I won't know. ;)
 
Last edited by a moderator:
Hmmm, I'll test it later this week. I'm struggling with some deadlines so I can only comment, not actually do anything ;)


Btw, I always use mpdscribble for last.fm .. or is this for playing last.fm-streams?
 
just an fyi, its 'daemon', not 'demon'; a small difference (and historically, the terms are interchangeable in Greek mythology), but its the right spelling for the Unix-like background process system :)


jeff
 
The next thing you need to do is to create soft-symlinks in ./.mpd/music/ pointing to directories containing your music-files. Something like:


"ln -s /path/to/your/mp3-collection/ ./.mpd/music/mp3s"
are there other possibilities to divert the directory mpd is looking for music files ? (As probably most) I'm using the Fat32 filesystem on my cards which does not allow symlinks
 
Thanks for correcting me and changing the thread-title. I noticed that i made a spelling-mistake (which sooner or later will probably happen again) right after posting, and even tried if i can fix it myself by editing the post. Unfortunately i can't. Didn't want to bother a moderator with this issue, but now that it's done: Thanks again.


Gruso: hm, interesting problem. I don't know mpd that well so far, but specifying (soft)links was all I did so far. What you can try is


- to modify the music-directory in ./.mpd/mpd.conf and make it point directly to the directory that contains all your music. This way you can only specify one directory, but should be able to use as many subdirectories as you like.


- specify a music-directory which is an empty directory on your NAND and create links there. Then modify the music-dir in mpd.conf to point to that directory. I haven't tried this. I hope that creating links on the NAND-filesystem works. If it does, then this solution should be simple when you run your system from NAND (internal memory), which I guess you do, because otherwise at least the SDcard you boot from would be ext-formated.
 
Last edited by a moderator:
Any advice on how to change the config file? If I alter the config file and then start mpd the config file is reset - if I modify the config file after starting mpd the changes does not seem to be recognized (after making an update of course)


Btw. Maybe you should delete the log file - it is a bit talkative
 
Thanks about mentioning the log-file. I can empty that, you are right. I don't care much about the music being mentioned as its legal, free music from the internet (feel free to try it ;) ), but noone really needs it. So it will be gone.


I see the problem with the config file. My mpd.sh-script is still crappy and ALWAYS replaces ./.mpd/mpd.conf with the modifed content of ./.mpd/mpd.conf.orig.


Note to myself: I need to implement a check if mpd.conf already exists.


My recommendation to you for a quick fix is to modify ./.mpd/mpd.conf.orig instead. Then your changes will be copied over to ./.mpd/mpd.conf every time you run ./mpd.sh and things should work. Sorry for that mess. I will fix it with the next beta-release.


Other than that i made a little progress regarding libgme-support. It's still not building, but I made some progress and am confident at the moment to get it going.


Also I learned a bit about optimisation-flags for compiling. I will probably rebuild everything hoping that mpd uses less cpu-power. It works fine right now, but the fewer the better.
 
Note to myself: I need to implement a check if mpd.conf already exists.


Code:
if [ ! -e .mpd/mpd.conf ];then cp .mpd/mpd.conf.orig .mpd/mpd.conf;fi

Shorter but less easy to read :



Code:
[ ! -e .mpd/mpd.conf ] && cp .mpd/mpd.conf.orig .mpd/mpd.conf
 
Hey, that was at least something I knew myself, lol :D Thanks anyway, copy/pasting is still faster. ;)


I deactivated the download for now. I'll retarball everything as soon as I find the time.


building the GME-support now worked, which should leave us with support for


AY ZX Spectrum, Amstrad CPC


GBS Nintendo Game Boy


GYM Sega Genesis, Mega Drive


HES NEC TurboGrafx-16, PC Engine


KSS MSX Home Computer, other Z80 systems (doesn't support FM sound)


NSF, NSFE Nintendo NES, Famicom (with VRC 6, Namco 106, and FME-7 sound)


SAP Atari systems using POKEY sound chip


SPC Super Nintendo, Super Famicom


VGM, VGZ Sega Master System, Mark III, Sega Genesis, Mega Drive, BBC Micro


But i still need to verify that. Time for bed now. Cya
 
Last edited by a moderator:
Thanks about mentioning the log-file. I can empty that, you are right. I don't care much about the music being mentioned as its legal, free music from the internet (feel free to try it ;) ), but noone really needs it. So it will be gone.
also the remixes of copyrighted music titles ? I'm not so much into music anyway

I see the problem with the config file. My mpd.sh-script is still crappy and ALWAYS replaces ./.mpd/mpd.conf with the modifed content of ./.mpd/mpd.conf.orig.


Note to myself: I need to implement a check if mpd.conf already exists.


My recommendation to you for a quick fix is to modify ./.mpd/mpd.conf.orig instead. Then your changes will be copied over to ./.mpd/mpd.conf every time you run ./mpd.sh and things should work. Sorry for that mess. I will fix it with the next beta-release.
Did as you suggested and it works, will try controlling it via my android tablet this evening - any suggestion for a good mpd - client for android ?


Maybe you should consider also including a GUI oriented player, as there are a lot of Pandora users (like me) that prefer those - maybe Sonata. Its written in Python so, it should not be too hard to "port" (I guess)
 
Did as you suggested and it works, will try controlling it via my android tablet this evening - any suggestion for a good mpd - client for android ?

I only tried "mpdroid" so far. Does what it's supposed to do. Here is a link to a list of many clients for many platforms: http://mpd.wikia.com/wiki/Clients


Search (ctrl+f in most browsers) the site for "android" and you should find a pleasing client.

Maybe you should consider also including a GUI oriented player, as there are a lot of Pandora users (like me) that prefer those - maybe Sonata. Its written in Python so, it should not be too hard to "port" (I guess)

One thing after another. ;) First I want to get the daemon packaged. I chose mpc and ncmpc(pp) as first clients because they are small, easy to be ported and versatile. For example you can use mpc to create keyboard-shortcuts or bash-scripts that control mpd and ncmpc(pp) can still be used in a ssh-terminal over network connected to the pandora when I am running that anyway.


@lunixbochs: Thanks a lot. =) Will try it.
 
I spent some more hours on this. Following changes have happened:


- built a pnd with a simple bash-menu


- added gme-support


- rebuilt everything with optimized compile-flags
 
Updated the pnd to fix some issues with libraries. If you do not manage to start one of the programs, then please try it from the terminal of the terminal-menu (press 6) and start the program manually ("./mpd.sh" or "./mpc.sh" or "./ncmpc.sh" or "./ncmpcpp.sh"). Then post the output here.
 
Last edited by a moderator:
Sorry for taking so long to test the pnd:


This may sound a little stupid, but how (and/or where) do I create the config file for mpd ?


I tried to create one by using the terminal in the pndenvironment (option 6 in the menu), but I'm not permitted to create a new mpd.conf in .mpd (at least not as user / su user)
 
Back
Top