Firmware: A-410 [01 Apr. 2014] | A-400 [12 Mar. 2014] | C-300 [13 Feb. 2014] | A-300 [24 Feb. 2014] | C-200 [11 July 2013] | A-200/A-210 [11 July 2013] | Popbox V8 [3 Dec 2013]

Just got your NMT | WIKI has the answers | Search the forum | Forum Rules/Policy | Firmware & Official NMT News | Popcornhour manuals



User(s) browsing this thread: 1 Guest(s)
Thread Closed 
Music Player Daemon (MPD) 2009-10-01 Re-Release
10-01-2009, 07:01 AM (This post was last modified: 10-01-2009 07:15 AM by alanh.)
Post: #1
Music Player Daemon (MPD) 2009-10-01 Re-Release
After much deliberation, I'm satisfied I've met the last requirement to be GPLv2 compliant - independent recompilation by anyone. For the MPD source, if you wish to make modifications, you can pull the latest snapshot from the GIT repository, apply the patch file included in the binary distribution below, modify source and options to your hearts content, recompile and run. You will also need to build the component libraries for whatever options you want to support (mine includes FLAC, AAC, WAV, MP2/3, & Ogg+Vorbis, MMS, Last.fm, etc). Of course you can alway use the binaries supplied below as is.

The output plug-in source is still available, released under the GPLv2, and included in the binary package. However you need the Sigma SDK to recompile that bit. But I firmly believe (backed up by some correspondence from the FSF) that the binary release of said plug-in qualifies under the System Library Exception to the GPLv2 (full license file including with MPD below). This despite what the MPD project maintainer claims. Thus I consider the MPD code based forked in a sense.

I've also 'fixed' most of the interoperability bugs with mono - that is I've come to a compromise that from limited testing seems to minimize them to the largest extent. I've been able to switch back and forth between MPD and mono playback a few dozen times without rebooting. You can technically still play both (no way for me to detect and prevent atm), but I would not recommend doing that as a normal practice. You can also go to and come out of stand-bye and resume MPD playback without lock-ups. Again due to lack of state detection in gaya, you can also initiate playback while in stand-bye. However did experience a couple lock-ups with MPD actively playback running while going in or coming out of stand-bye. Playing while in stand-bye is s nice under certain circumstances to keep the screen saver off while playing - though the smart HD spin-down attempt sometimes glitches MPD playback.

The HDMI initialization issue is still present. You must play any file with audio through the normal gaya+mono interface betore you will get audio out of the HDMI port. That will be fixed in the coming weeks (hopefully).

Finally, please don't spam me or this thread with 'Can you recompile MPD with feature XXX turned on?' I keep kidding myself with how much time I think I have to work on this. I just can't. However now that there isn't anything preventing anyone from recompiling the MPD server, project maintainers are welcome. I will share any notes I have on configure/compile options for the mips4k target.

Due to the GPLv2 licensing compliance mess, there are 2 tar files - one for a compiled MPD server with my patch applied (and included) and the other for the output plug-in. This limits the scope of any future GPLv2 disputes to just the plug-in and not the core MPD code base. The 2 files should always be installed separately - even eventually on CSI. The tar files are designed to be unpacked from the root ('/') path as they create everything under "share/Apps/mpd". The plug-in package actually contains the config file and startup script for NMT. If you use a USB+Alsa audio device with MPD, you are welcome to use the supplied MPD server package plus your own config file and modules.

I haven't been able to get MPDJB fully running yet on my own B-110. I get a File not Found error on the main page. I'm sure it's a permissions issue on my end, but I would appreciate if someone could post back here if this MPD distribution works with it. I normally use Minion and Sonata and they both work fine.

mpd-20091001.tgz
mpd-smp86xx_plugin-20091001.tgz

Enjoy! And sorry for the length of time I took to get here. Karma is drop kicking me this weekend though as my C-200 arrives while I'm in Tampa, FL Sad
I just noticed stand-bye actually does not interfere with MPD playback other than it mutes the DSP. Not sure what the desired behaviour really should be here. I'm open to suggestions.

I could periodically (<1s) check for the DSP being muted and auto-pause playback maybe?
Find all posts by this user
[+] 29 users say Thank You to alanh for this post
10-01-2009, 07:56 AM (This post was last modified: 10-01-2009 07:56 AM by dooly.)
Post: #2
RE: Music Player Daemon (MPD) 2009-10-01 Re-Release
(10-01-2009 07:01 AM)alanh Wrote:  I haven't been able to get MPDJB fully running yet on my own B-110. I get a File not Found error on the main page. I'm sure it's a permissions issue on my end, but I would appreciate if someone could post back here if this MPD distribution works with it. I normally use Minion and Sonata and they both work fine.

Did you install the lighttpd package?
If so, you have to create a soft link (well, I had to) :
# ln -s /share /share/Apps/AppInit/websites/HARD_DISK

If you want to use the slideshow feature, you also have to modify the start script to change permissions in the MPDJB/tmp/ directory (file owner is changed after reboot, and lighttpd cannot write to them anymore) :
# chmod 666 /share/Apps/MPDJB/tmp/*

I had to use the MPDJB sourcecode, and not the precompiled one (because this one requires the Turck MMcache, it doesn't work with the lighttpd package).

A110 (1.5 TB 3.5" HDD) / A200 (fanless case by moovika, 500 GB 2.5" HDD) / C200 (no HDD, no BD)
Yamaha RX-V3900 - Panasonic TX-P42V10 - B&W CT7.5 + Velodyne CHT-10Q - Logitech Harmony 525
Linksys WRT320N - Netgear GS608 - Fit-PC2 + USB HDD (NFS, SMB, DLNA server) - Synology DS411j
Find all posts by this user
[+] 2 users say Thank You to dooly for this post
10-01-2009, 10:10 AM (This post was last modified: 10-01-2009 10:21 AM by bellissimo.)
Post: #3
RE: Music Player Daemon (MPD) 2009-10-01 Re-Release
Well done for persevering alanh!

Will give it a try when I get home. Hopefully now this will be the end of any disputes, and we can all relax and actually enjoy the software.

@dooly - That is very intersting information regarding MPDJB and lighttpd. I was wondering why I could not get it to work Smile. Probably worth posting that on the MPDJB thread too.
Find all posts by this user
10-01-2009, 01:28 PM
Post: #4
RE: Music Player Daemon (MPD) 2009-10-01 Re-Release
Awesome, thank you.
Hadn't gotten around to actually modifying the source yet, though. Had some issues with getting the toolchain to work properly. Took up my limited time so far :/
Find all posts by this user
10-01-2009, 03:17 PM (This post was last modified: 10-01-2009 03:46 PM by 6p14pev.)
Post: #5
RE: Music Player Daemon (MPD) 2009-10-01 Re-Release
Hi Alan,

Thanks very much for your efforts.

Just out of curiosity, I was going over your code in smp86xx_plugin.c and came across this piece:

Code:
    case 24:
        /*
         * The Sigma platform will do 24-bit just fine, however
         * it expects packed samples and MPD delivers the samples
         * signed extended to 32-bit.  I understand why it is
         * delivered this way due to dword alignment, however IMO
         * MPD is broken in calling this a 'true 24-bit' format.
         * So I'm falling through to forcing 16-bit output below
         * where packing naturally equals alignment
         */
    default:
        audio_format->bits = 16;
        break; // override

Please pardon my naive question, but does this mean that the output plug in will throw away the most significant (or is it the least significant) 8 bits of a 24-bit sample?

Thanks
Find all posts by this user
10-01-2009, 03:37 PM (This post was last modified: 10-01-2009 03:38 PM by gcf.)
Post: #6
RE: Music Player Daemon (MPD) 2009-10-01 Re-Release
Thanks for your effort on this.
Can I install this over a previous version, and if not, how do I uninstall the previous version?
Find all posts by this user
10-01-2009, 03:56 PM (This post was last modified: 10-01-2009 04:01 PM by alanh.)
Post: #7
RE: Music Player Daemon (MPD) 2009-10-01 Re-Release
(10-01-2009 03:17 PM)6p14pev Wrote:  Please pardon my naive question, but does this mean that the output plug in will throw away the most significant (or is it the least significant) 8 bits of a 24-bit sample?

Well if you are playing a true 24 bit source, then yes, the least significant bits will be dropped. It's a problem with MPD in that it doesn't support packed 24-bit samples. The samples could be packed before being sent by the driver. Decoding mp3 I rarely see top usage spike above 15% (but top can be misleading). So there should be room to do that. I'm also kicking around the idea of using the DMA controller to pack the samples. But I'm not sure when that will happen.
(10-01-2009 03:37 PM)gcf Wrote:  Thanks for your effort on this.
Can I install this over a previous version, and if not, how do I uninstall the previous version?

To be honest, I haven't really looked at what gwillams packaging was like or how it gets dropped in by CSI. If you used CSI, I would think it has an uninstall feature. Otherwise, you might want to delete or prevent the old MPD from starting and then install the new one. If you are shell savvy, you can also just pull the binaries from this new tar file to replace the old ones and merge the config file changes in with your existing install.

For most people, I think it will be worthwhile to just wait for CSI update.
Find all posts by this user
[+] 1 user says Thank You to alanh for this post
10-01-2009, 05:28 PM
Post: #8
RE: Music Player Daemon (MPD) 2009-10-01 Re-Release
Awesome.

Finally we are back on track with mpd.

GO CSI!!
Find all posts by this user
10-01-2009, 05:34 PM
Post: #9
RE: Music Player Daemon (MPD) 2009-10-01 Re-Release
(10-01-2009 10:10 AM)bellissimo Wrote:  @dooly - That is very intersting information regarding MPDJB and lighttpd. I was wondering why I could not get it to work Smile. Probably worth posting that on the MPDJB thread too.

Yep, but before posting in the MPDJB thread, I'll have to check all the differences between the original MPDJB and my installation. I think I also had to change 2 or 3 lines in the php code : it was not using the same tcp port as lighttpd (or maybe it's my lighttpd installation that's not using the "standard" port... I can't remember... I'll have to check that...)

A110 (1.5 TB 3.5" HDD) / A200 (fanless case by moovika, 500 GB 2.5" HDD) / C200 (no HDD, no BD)
Yamaha RX-V3900 - Panasonic TX-P42V10 - B&W CT7.5 + Velodyne CHT-10Q - Logitech Harmony 525
Linksys WRT320N - Netgear GS608 - Fit-PC2 + USB HDD (NFS, SMB, DLNA server) - Synology DS411j
Find all posts by this user
10-01-2009, 08:28 PM
Post: #10
RE: Music Player Daemon (MPD) 2009-10-01 Re-Release
Alanh Thanks! Will this work on the c200? I tried installing the old verion and was getting:

sh install.sh
grep: /mnt/syb8643/etc/ftpserver.sh: No such file or directory
No generic daemon launcher found, installing...
sed: /mnt/syb8643/etc/ftpserver.sh: No such file or directory
sed: /mnt/syb8643/etc/ftpserver.sh: No such file or directory

I miss my mPod controler Wink

C200 -HDMI Video & Toslink to Sony 5.1 DTS Reciever
HDD: 500GB WD Blue 2.5" BEVTx
DVD drive: Samsung SH-203B
TV: One 400LBS 36" Sony MEGA CRT 16:9 for my c200 & a Panasonic 42" Plasma (TCP42C1) 720p for the bedroom.
Find all posts by this user
10-01-2009, 08:56 PM (This post was last modified: 10-01-2009 08:58 PM by dipje.)
Post: #11
RE: Music Player Daemon (MPD) 2009-10-01 Re-Release
Thanks very much for this great work!!
Gonna try it right away!
Find all posts by this user
10-01-2009, 10:27 PM
Post: #12
RE: Music Player Daemon (MPD) 2009-10-01 Re-Release
(10-01-2009 08:28 PM)Caddie Wrote:  Alanh Thanks! Will this work on the c200? I tried installing the old verion...

No, this will NOT work in the C-200.
Find all posts by this user
10-01-2009, 11:18 PM
Post: #13
RE: Music Player Daemon (MPD) 2009-10-01 Re-Release
(10-01-2009 05:34 PM)dooly Wrote:  Yep, but before posting in the MPDJB thread, I'll have to check all the differences between the original MPDJB and my installation. I think I also had to change 2 or 3 lines in the php code : it was not using the same tcp port as lighttpd (or maybe it's my lighttpd installation that's not using the "standard" port... I can't remember... I'll have to check that...)

Here is what I did to run MPDJB with the CSI lighttpd package.

A110 (1.5 TB 3.5" HDD) / A200 (fanless case by moovika, 500 GB 2.5" HDD) / C200 (no HDD, no BD)
Yamaha RX-V3900 - Panasonic TX-P42V10 - B&W CT7.5 + Velodyne CHT-10Q - Logitech Harmony 525
Linksys WRT320N - Netgear GS608 - Fit-PC2 + USB HDD (NFS, SMB, DLNA server) - Synology DS411j
Find all posts by this user
10-02-2009, 12:30 AM
Post: #14
RE: Music Player Daemon (MPD) 2009-10-01 Re-Release
AlanH,
Thank you for your time, effort and dedication to this project, it is appreciated.

Best,
Ed
Find all posts by this user
10-02-2009, 08:33 PM (This post was last modified: 10-02-2009 08:38 PM by shadowcode.)
Post: #15
RE: Music Player Daemon (MPD) 2009-10-01 Re-Release
Hi all!

When playing an AAC (without DRM) file it locks up.
So.. I've grabbed the source, applied the patch set the following exports:
Code:
export LINUX=/usr/local/mips/mipsel-linux-uclibc
export TOOLBASE=/usr/local/mips/bin/mipsel-linux-uclibc
export TPREFIX=$LINUX/usr
export CC=$TOOLBASE-gcc
export CXX=$TOOLBASE-g++
export CPP=$TOOLBASE-cpp
export CXXCPP=$CPP
export AR=$TOOLBASE-ar
export RANLIB=$TOOLBASE-ranlib
export STRIP=$TOOLBASE-strip
export LDFLAGS="-L$TPREFIX/lib -L$LINUX/lib -L$LINUX/usr/lib -l__smp8634__portability"
export CFLAGS="-O2 -march=mips32r2 -mtune=mips32r2 -I$TPREFIX/include -I$LINUX/sys-include -I$LINUX/include -I$LINUX/usr/include"
export CPPFLAGS="-O2 -march=mips32r2 -mtune=mips32r2 -I$TPREFIX/include -I$LINUX/sys-include -I$LINUX/include -I$LINUX/usr/include"
#CPPFLAGS are the same as the CFLAGS.. Am I supposed to do that?
export PKG_CONFIG_PATH=$LINUX/usr/lib/pkgconfig
#
# CCexe is the compiler used to compile apinames.c in freetype-2.2.1
export CCexe=gcc
#
export PATH=/usr/local/mips/mipsel-linux-uclibc/bin:$PATH
export PATH=/usr/local/mips/bin:$PATH
export FLAC_LIBS="-lFLAC -logg -Wl,--rpath -Wl,$LINUX/usr/lib"

I'm using the official toolchain, which uses uClibc.

built all of the dependency libraries including FAAD2; configured it with:
Code:
./configure --host=mipsel-linux --prefix=$TPREFIX --with-mp4v2

Then I configured MPD with:
Code:
./configure --with-faad=/usr/local/mips/mipsel-linux-uclibc/usr --with-faad-libraries=/usr/local/mips/mipsel-linux-uclibc/usr/lib --enable-mad --with-mad-libraries=/usr/local/mips/mipsel-linux-uclibc --enable-smp86xx --host=mipsel-linux --prefix=$TPREFIX --with-libOggFLAC="$LINUX/usr" --with-libOggFLAC-libraries="$LINUX/usr/lib/" --with-libOggFLAC-includes="$LINUX/usr/include/"

Code:
file src/mpd
says:
Code:
src/mpd: ELF 32-bit LSB executable, MIPS, MIPS64 version 1 (SYSV), dynamically linked (uses shared libs), not stripped

I then copied the libs and the bin to the mediatank and fired up the daemon. Playing an AAC now works, but incredibly slow! One second of music is stretched to 3 seconds. top says that CPU usage is between 80% and 95%.. seems a bit high.

Did I miss something obvious?
Find all posts by this user
Thread Closed 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
Music MPD installation howto (updated 4 May 2009) gwillem 497 382,592 11-05-2013 11:50 PM
Last Post: hindibuff
  Music player minion connection problems webkocken 6 4,896 09-24-2013 12:18 AM
Last Post: glorifyday
Rainbow Music Player Daemon (MPD) - v0.16.2 shadowcode 124 53,632 09-23-2013 01:11 AM
Last Post: glorifyday
  Music Browser for NMT - Updated August, 2nd, 2011 gkreidl 14 11,033 01-19-2013 04:07 PM
Last Post: winfried_laane
  Is it possible to code a HULU player for the A-110? mulderfox 0 1,131 01-05-2013 11:11 AM
Last Post: mulderfox
  Any music jukebox that syncs with itunes? superflysocal 0 1,401 07-04-2012 02:57 PM
Last Post: superflysocal
  Music Player Daemon (MPD) 2010-04-04 v0.15.9 shadowcode 245 107,868 03-10-2012 01:05 AM
Last Post: ianny
Music fuppes 0.629 for NMT - dlna, upnp media server [UPDATED: 31-May-2009] Mr Segfault 53 54,797 10-12-2011 01:04 AM
Last Post: spud
  Stream music to the popcornhour snakeboots 1 3,146 08-30-2011 02:56 PM
Last Post: minio
  Disable amule daemon drunkendonkey 0 1,836 02-04-2011 12:33 AM
Last Post: drunkendonkey

Forum Jump: