OLD: mpdPup - Simplified MPD Music Server/Jukebox - v0.9.2

For talk and support relating specifically to Puppy derivatives
Post Reply
Message
Author
ldolse
Posts: 367
Joined: Fri 23 Oct 2009, 16:33

OLD: mpdPup - Simplified MPD Music Server/Jukebox - v0.9.2

#1 Post by ldolse »

This version is superceded by 0.9.3, please refer to this thread:
http://murga-linux.com/puppy/viewtopic.php?p=662902

This project is for anyone that has or is thinking of building a dedicated music server as a replacement for traditional CD transports. The basic goal is to provide the simplest possible avenue for someone to get a Linux system based around Music Player Daemon up and running. There are a lot of people building dedicated music servers on the hifi and audio boards, and it seems like the majority of them go for Windows or Mac as Linux is too complex a pill to swallow. I've always been a big fan of Music Player Daemon and am hoping a simplified setup like this may introduce more users to the project.

Basic Features:
  • Music Player Daemon 0.16.6, full complement of codecs and streaming support
  • Wizards for MPD & basic system setup
  • Smart shuffle functions built in courtesy of Albumbler and mpd sima
  • Remote control & LCD support for platforms using Soundgraph iMon via LCDProc, empcd & lcdmpdclient
  • Small size - iso is 60MB
  • LastFM/Scrobbling support built in
  • Built in webserver for serving up cover art to clients
  • Avahi/Zeroconf built in for simplified mpd client discovery
  • Hardened to always run in a read-only mode - treat it like an appliance
  • Various (optional) audio manipulation capabilities, e.g. libsamplerate, ALSA equalizer
  • A variety of MPD CLI clients and utilities included
Everything is pre-configured except for the music library location and sound-card configuration. IP address config is optional if your client supports Bonjour.


Installation/Ugrade
  • Download links version 0.9.2 (md5 is 3cab315025270d23c43a18c473c5237b ): Installation Prerequisites
    • Flash Media, minimum 256MB (USB Stick or CF-SATA, or whatever you can boot off of)
      Format using FAT32, Single partion
      Unetbootin or similar software
      A network file share (i.e. NAS, Windows, or Mac CIFS/SMB share) or separate hard disk with your music library.
    Installation, Prep the Flash Media:
    • Download the iso file from one of the links above.
      Insert your formatted USB Stick/Flash media into your computer
      Install and Launch unetbootin
      Select the second 'Diskimage' option, browse to and select the ISO image
      Drive type will be USB drive, make sure you've selected the same drive letter/designator as the flash media.
      Click 'ok' and wait for the installation to complete.
      Remove the flash media and insert into the music server
    Using unetbootin or similar will put all the mpd state/database files in the correct locations allowing read/write. A frugal install should be possible, but then you'll need to create those directories in /mnt/home/ yourself.

    Upgrading from a previous release to 0.9.2:
    • You can optionally back up the 'mpd' folder on your flash media device, which contains your mpd database and playlists. Any other files that were created by the previous installer should be deleted. Follow the new installation instructions and restore the mpd folder afterward.
First Boot
  • You have a choice between doing the basic configuration using point and click or remotely from a CLI.
    If you're using a USB DAC make sure it's plugged in before booting.
    Make sure the machine is plugged into the network.
  • Monitor/Keyboard/Mouse Install
    • Hit whatever keys are required to get into the BIOS during the bootup.
      Make certain the BIOS is configured to boot from the right media.
      Disable on-board sound in the BIOS if you're not planning on using it.
      Go through the self explanatory monitor wizard and Xwindows should start.
      Xwindows will launch the MPD Configuration Wizard automatically at this point.
    SSH Console
    • This works best if Bonjour/Zeroconf is on your system (default on Mac and many Linux installs. Also installs with iTunes on Windows. Download here if you need it.
      Once the system is booted, SSH to tunes.local
      user/pass is root/woofwoof
      On the initial boot the MPD Config Wizard will automatically launch.
      To navigate the ssh dialogs you use a combination of tab and arrow keys. Enter to confirm the specified settings.
MPD Config Wizard
  • Sound Configuration
    • The Wizard goes through Soundcard, Storage Configuration, and Static IP Config. Except for the Static IP the steps are basically identical for Console or GUI users.
      Go through the Welcome Screen, Select your sound output to your DAC from the list.
      You'll be given an opportunity to check the sound output to make sure you got it right. Make sure your stereo is on and correctly hooked up to your sound device. If you don't hear any sound you can go back and choose another output.
      Provide a name for the Sound Output.
      You'll be asked to optionally configure an equalized output and volume control.
      Continue on to the storage configuration.
    Storage Configuration
    • The first dialog will ask you whether your audio is stored locally or via a network share.
      The CIFS configuration dialogs will first ask you for the IP address, username, and password for your network share.
      The next dialog will ask for the name of the Share itself.
      If the root of the share is above your Music library then enter the sub-folder for the music library here. Be sure to get the case correct. If the Music library is the root of the share then leave the second box blank.
      You'll then get a chance to confirm and test these settings. Go through those options, and if the test fails you can go back and change the settings.

      Note local storage support is new and the audio directory currently limited to a separate drive or partition from the boot device.
      The local storage wizard will have you select a drive and subdirectory where your audio data is located.
    Remote Control/LCD Config
    • If the wizards detect a Soundgraph iMon LCD/Remote then you'll be asked whether you want those functions enabled, along with the default settings for the LCD screen.
    Static IP (optional)
    • You'll be asked after this if you want to set up a static IP. This is optional but recommended as most MPD Clients don't support Bonjour.
      The setup is slightly different for GUI vs. SSH users. SSH is self explanatory.
      For GUI User's you'll see a list of interfaces, and you'll need to select a button for your interface, in most cases Eth0.
      Then Click the 'Static IP' button. Enter the IP in the following window, then click through the various confirmation/Done dialogs.
    Password
    • GUI users will be asked to change the default Password at this point - this is strongly recommended.
      Because of the security context the CLI based MPD Wizard is running in this isn't possible for SSH users, so you'll need to do this later.
Note any of these settings along with several others can be modified later by typing 'mpdwizard' at the command line.

Saving the Config
  • The final step in the wizard will ask you to reboot. This is recommended unless there is something else you want to change.
    During the shutdown you'll be asked to create a save file, follow these steps, any size save file should be sufficient, smaller is fine.
    After rebooting the server will be fully operational.
Using MPD - Clients
  • MPD requires a separate client, there are many to choose from.
    For iPhone/iPad users there is MPoD/MPaD, both of which will auto-discover your new server on the network.
    Most other clients will require you to configure the IP address of your music server.
    Look here for a full list of clients.
    MPDPup has a full complement of CLI clients built in if you like to access your system using SSH: mpc, ncmpc, ncmpcpp, Practical Music Search (pms)

Contributing/Hacking on mpdPup
  • I'm happy to announce that mpdPup now has it's own optional development files for people who would like to hack on or contribute to it.
    Download here: (md5 is 62fd02533781cd70f4bc5c65624a3b77 )To use this file, just place it on the flash media used in the installation instructions.
    Then launch the Puppy Linux boot manager and configure it to load the devx file at startup.
    I've taken a different approach with this devx vs. other Puppy Linux variations. Several 'heavy' applications such as Geany & Firefox are only available when using the devx file. Since mpdPup is hard-coded to run from RAM I wanted to make the base file as small as possible, but provide maximum flexibility to anyone developing on the platform.

    mpdPup is binary compatible with Debian Squeeze, so you should also be able to use any of those Debian packages. Better package management is a future to-do item.
Future
  • This release is marked 0.9.2 There are a variety of minor known issues with this release:
    • The ESI Juli@ seems to have problems with 176/192 Khz audio files. My own ESI Juli@ died, and it's possibly related to my specific card - if this is an issue for you and important then stick with 0.9.1,download here or here.
    • empcd is unable to call albumbler when the system is started - this will work if the user manually restarts empcd from the local console.
    • Albumbler will attempt to queue directories which contain no audio data
    • JWM's themes are a bit messed up, as is a fair amount of basic desktop usability. Since a full functioning desktop isn't one of this project's goals that's not a barrier to incrementing a release, but I would like to improve this in the future.
    Other potential changes will be based on user interest/feedback, things I'm thinking about are:
    • Support for automount/hotplug actions for USB drives and expand local storage support.
      Realtime Kernel (The BFS scheduler may make this moot)
      Serial Console Support (partially implemented in 0.9.2)
      Improve/Expand the remote control/LCD support
      Continue Improving the wizards for various MPD/Client features
      More MPD community projects built in
      Add Web Interfaces
      Package Management
      Squeezebox Support
159, 224
Last edited by ldolse on Tue 06 Nov 2012, 19:16, edited 38 times in total.

ldolse
Posts: 367
Joined: Fri 23 Oct 2009, 16:33

#2 Post by ldolse »

  • Troubleshooting - GUI doesn't start
    • Xwindows is only configured to launch automatically on the first boot. Type xwin to launch it on subsequent boots. If it fails for some reason on the first boot you can try typing xorgwizard and xwin afterward to try and start it.
      Alternatively skip the GUI and just type mpdwizard to go through the same CLI wizard that ssh users use.
  • Note for underpowered device users e.g. Alix/Soekris
    • After setting the basic settings the initial reboot can take a very long time - approximately 10 minutes on my AMD Geode based Soekris.
      This is a one time event while Puppy Linux optimizes the save file to work with optimally with SquashFS/UnionFS. Since there is no serial console you won't be able to see this happening at this time.
  • No sound after the initial setup/reboot though everything appears to be working
    • In rare occurrences with a few types of sound cards, ALSA may default to have the device muted. You need to go to the CLI and type alsamixer to launch a mixer application.
      Use the left and right arrow keys on the keyboard to highlight each sound device/channel, then press M to unmute it. When everything is unmuted press escape to get out of the mixer.
      If you get a 'mixer not found error, use the following command instead:

      Code: Select all

      alsamixer -c 1
      You may need to change the number '1' to correspond with your sound device. aplay -l will list out the sound devices and their corresponding numbers.
      To make sure the mute setting is saved across reboots, enter the following commands:

      Code: Select all

      alsactl -f /etc/asound.state store
      reboot
  • Low Memory Devices (256MB or less)
    • By default mpdPup runs the whole operating system/file system from RAM. This will boot fine with as low as 128 megs of RAM, but if you have a large music collection there may be problems the first time the database is built. You can edit the syslinux.cfg file in the USB stick to retain maximum memory for applications, at the expense of not running the OS from RAM. Find the line which includes 'pmedia=cd', and add 'pfix=nocopy' (no quotes) to the end of the line.
    Last edited by ldolse on Fri 15 Jun 2012, 17:59, edited 9 times in total.

    J.Allen
    Posts: 5
    Joined: Sat 06 Aug 2011, 12:23

    #3 Post by J.Allen »

    Hi Idolise.

    I’m a bit surprised there isn’t a queue of frustrated audio enthusiasts, Linux wannabes, much like myself standing in line to shake your hand.
    No worries, let me be the first then.

    I’ve got Voyage MPD running on a music server atm thanks to considerable help from a friend who “knows

    ldolse
    Posts: 367
    Joined: Fri 23 Oct 2009, 16:33

    #4 Post by ldolse »

    Glad you appreciate the release - I'm haven't promoted this all that thoroughly yet, so I don't think that many audio enthusiasts are aware of the effort. I'm working on the next release, trying to increase the ease of deployment/setup. The next release will have install wizards instead of hand-editing the files, headless setup (no monitor/keyboard) will be an option, and I'm going to go ahead and bundle as many mpd 'toys' as possible.

    The Alsa 1.0.24 upgrade will wait til later, been banging my head against that wall and decided to take a break and focus on the wizards, not sure if my problems are with Alsa or something else.

    SBP
    Posts: 43
    Joined: Wed 06 Apr 2011, 15:45

    #5 Post by SBP »

    Hi
    This is very nice, makes it easy to use a low powered PC as a media server and audio player.

    Do you think it would be possible for you to include a Squeezebox server.

    The Squeezebox Server is needed in order to serve audio to Logitechs audio equipment (Touch, Duet, Boom and Radio). It can be found here: http://downloads.slimdevices.com/Squeez ... 7.6.1_rc1/

    The Logitech players are quite popular.

    ldolse
    Posts: 367
    Joined: Fri 23 Oct 2009, 16:33

    #6 Post by ldolse »

    I'll look into Squeezebox - probably won't enable it by default, but shouldn't be a problem to bundle it.

    edit - just saw the size of the package - will more likely go the PET package route to keep the iso size down, but anyway I'll give it a shot.

    SBP
    Posts: 43
    Joined: Wed 06 Apr 2011, 15:45

    #7 Post by SBP »

    Thanks, I really hope you can get it running

    I have previously tried myself, but as a complete beginner, I was not able to get Squeezeboxserver running on puppy - it needs Perl

    Here you can find the newest version: http://forums.slimdevices.com/showthread.php?t=89619

    ldolse
    Posts: 367
    Joined: Fri 23 Oct 2009, 16:33

    #8 Post by ldolse »

    SBP wrote:Thanks, I really hope you can get it running

    I have previously tried myself, but as a complete beginner, I was not able to get Squeezeboxserver running on puppy - it needs Perl

    Here you can find the newest version: http://forums.slimdevices.com/showthread.php?t=89619
    I've spent several hours and two different versions of perl (5.8.8 and 5.10.1) trying to get this running, no luck. Downloaded the source code from SVN, rebuilt on Puppy, and the problem comes down to CPAN module, YAML::Syck - CPAN says this module is installed, Squeezeserver says it can't load it. Google searches seem to indicate this is a very common Squeezebox problem, but I didn't come up with any solutions - most indicated a different perl version might help, but the best version is unclear. If you can find any info with regard to a solution I can give it another shot.

    Edit - got past that issue - it's still not working, but there's a new set of errors to solve, so making progress.

    SBP
    Posts: 43
    Joined: Wed 06 Apr 2011, 15:45

    #9 Post by SBP »

    Idolse

    Thank you for your effort, I really hope you will succeed.
    Regarding the "best PERL version"; I don't know but perl it seems like Perl > than 5.10 will be the best.

    I noticed that the CPAN/PERL modules can be found here: http://svn.slimdevices.com/repos/slim/7 ... ndor/CPAN/

    I found this, where they build squeezebox for archlinux:
    http://aur.archlinux.org/packages.php?I ... mments=all


    Here is some information on building on FreeBSD (had initially same YAML problem): http://forums.slimdevices.com/showthrea ... 765&page=2

    gcmartin

    Can this be operate from an ISO (live media)

    #10 Post by gcmartin »

    This thread seems to imply USB only.

    Several Questions
    • Do you have an ISO that is available with Music Player Daemon ready?
    • And, is there some reason that this may not intended for LiveCD use?
    • And, what types of media files does it expect on the NAS?
    Thanks in advance

    P.S. @ldolse, Check your PM

    ldolse
    Posts: 367
    Joined: Fri 23 Oct 2009, 16:33

    #11 Post by ldolse »

    Not sure if you mean USB in terms of sound card or installation.

    In terms of sound, the ISO is ALSA only, but not USB only - I use this build myself with a ESI Juli@, and I've also tested with a few USB DACS. Any card supported by ALSA should work fine with this ISO.

    The ISO in the first post has MPD pre-configured and ready to go aside from the sound card selection and network share. The music directory may also require a change if it's not the root directory of your network share.

    The iso 'should' work perfectly fine as a LiveCD, but it won't work out of the box per my instructions in the first post. The most important thing the USB install does is automatically create a separate read/write area outside the main file system for MPD's working directory. (/mnt/home/mpd/)

    If instead you run it from a LiveCD then the entire system is read-only, and you'd need to create a separate area for read/write working space - which likely brings the user into gparted-land, which I wanted to avoid. Once that's done you also need to create the requisite working directories for mpd and point it there. That said, livecd is the only way I've found to get this working on a Mac (because of Apple's crappy bootloader), so it's something I can document better in the future.

    Lastly, the Livecd may be running in a Pupmode I haven't QA'd - all my work has been in Pupmode5 and 13 - some of the scripts I've added/modified do specific things based on the Pupmode. If there is problem on this point I can certainly make the scripts support a liveCD installation.

    My personal install is to Compact Flash in a CF->Sata Adapter, so a USB stick isn't required if a more complete install is desired.

    As far as media files go, I've compiled MPD and all the associated libraries so any common media format should be supported - my personal collection is a mix of aiff, flac, mp3, and m4a - I haven't personally done much testing for other formats, but all the latest libs are compiled/installed, so they should work without a hitch.

    Note I'll be releasing an update soon which will have an SSH daemon built in, a setup wizard that runs from ssh or X, and will also ship with a variety of mpd cli clients and playlist tools.

    plan9
    Posts: 6
    Joined: Sat 27 Aug 2011, 21:14

    Equalizer Use with mpdPup

    #12 Post by plan9 »

    ldolse - this looks great!

    I would be setting mpdPup up on a Alix 1C with ESI Juli@ soundcard via SPDIF to a Benchmark non-USB DAC.

    For most files I want straight bit perfect passthrough to my DAC without any resampling/ upsampling. I do however have a mix of recordings up to 96/24 needing equalization - simple high frequency boost or bass attenuation, etc.

    How would you recommend equalization be handled with mpdPup and a Alix 1C? Is the Alix 1C powerful enough or would I need something more powerful like an Atom D525?

    One day I would like to explore room correction, let me know if this changes the answer.

    Thanks!

    ldolse
    Posts: 367
    Joined: Fri 23 Oct 2009, 16:33

    #13 Post by ldolse »

    I'm not sure how well the Alix would do for equalization, that's probably partially dependent on the software package you were using to do it. I'm thinking either ecasound or bruteFIR? These are both packages I was thinking about bundling into an later release, but I don't have any real experience with either one - I've read that both can use a fair amount of CPU depending on the application, so an Atom based board might be a better bet.

    Also note most of the Alix boards don't have a vga output - the current version of mpdPup requires a monitor/keyboard. The next release will have a better chance of working on an Alix board when ssh is included by default. If you don't have a monitor and are looking for something now then VoyageMpd might be a better fit, but I'm trying to get the next iteration wrapped up soon.

    plan9
    Posts: 6
    Joined: Sat 27 Aug 2011, 21:14

    #14 Post by plan9 »

    1 Does anyone know of any mpd clients with native equalizer functionality?

    2 If Yes, is the equalizer CPU processing taking place on:

    a) the device running the mpd client (i.e. iPad, laptop, etc.)

    b) the PC/NAS on which the files are stored?

    c) the PC with soundcard/USB out connected to the receiving DAC?

    3 Can player applications such as DeaDBeeF with equalizer functionality be used with mpdPup?

    4 libsamplerate is described as "Secret Rabit Code" under mpdPup - when/how is it invoked (i.e. generally want straight bit perfect file passthrough)?

    Thanks.

    ldolse
    Posts: 367
    Joined: Fri 23 Oct 2009, 16:33

    #15 Post by ldolse »

    I don't know of any mpd clients with equalizers built-in, but I think you could get hardcoded equalization pre-sets by defining multiple MPD audio outputs.

    Libsamplerate is similar to the above statement - default settings per the instructions in the first post don't do any resampling.

    The way you use audio manipulation engines such as BruteFir or Ecasound is to use MPD's pipe output - basically you can create multiple audio outputs in MPD and you define the unique characteristics of that output - whether it talks directly to the hardware, whether it uses the ALSA mixer, whether MPD does it's own resampling (libsamplerate), or whether it pipes to another application (e.g. Ecasound or BruteFIR). All of those outputs will show up most mpd clients, so you can enable/disable them to get whatever effect is configured for that output. I think the only scenario you'd need to be careful of is enabling multiple conflicting outputs simultaneously (e.g. mpd and Brutefir both outputting to the same sound device).

    CPU processing would take place on the same machine running MPD, not on the client - the only way around this was if you piped it across the network using something like JACK (not currently a part of this distribution and not on my to-do list at the moment).

    DeaDBeeF integration probably wouldn't happen as that's a full featured player app with a GUI, and this project is about creating a headless system.

    ldolse
    Posts: 367
    Joined: Fri 23 Oct 2009, 16:33

    Equalizer

    #16 Post by ldolse »

    Looks like it's possible to implement an equalizer through a LADSPA plugin. I'll look into getting something along these lines working as an optional function for the next version.

    Some links for further reading and so I don't need to bookmark them:

    http://www.thedigitalmachine.net/alsaequal.html
    http://quitte.de/dsp/caps.html
    http://wiki.linuxmce.org/index.php/Equalizer_for_ALSA
    http://pastebin.com/g9jtTGxM
    http://mpd.wikia.com/wiki/Music_Player_ ... _Equalizer
    http://mpd.wikia.com/wiki/Talk:Music_Pl ... _Equalizer
    http://plugin.org.uk/faq.php

    plan9
    Posts: 6
    Joined: Sat 27 Aug 2011, 21:14

    #17 Post by plan9 »

    I am very appreciative of the research as well as your looking into adding equalizer functionality in a future release. While I value audio purity, some files really benefit from judicious EQ. Making it optional should harm no one.

    If implemented this would improve an already impressive app.Thanks.

    ldolse
    Posts: 367
    Joined: Fri 23 Oct 2009, 16:33

    New version 0.9.1

    #18 Post by ldolse »

    I've just posted the newest version of mpdPup, 0.9.1:
    • Changes
      • New setup wizard (runs from GUI or CLI)
      • latest mpd 0.16.4 (plus patch fixing longstanding wav/aiff issue)
      • Supports headless install -- no monitor/keyboard/mouse required, SSH built in. This enables support for embedded systems like Soekris/Alix (only Soekris tested)
      • LastFM support (and scrobbling with mpdscribble)
      • CLI Clients: mpc, ncmpc, ncmpcpp, Practical Music Search (pms)
      • Various MPD Utilities: MPDToys
      • ALSA/LADSPA Equalizer as an optional output
      • Eliminated the majority of desktop apps and reduced the iso by 10MB
    First post is updated to reflect the changes, so more can be read there.
    Note while the basic setup has been tested extensively, I haven't tested every single add on like LastFM, mpdscribble, mpdtoys, etc. Let me know if you see problems there.

    icswainx
    Posts: 1
    Joined: Mon 29 Aug 2011, 19:17

    Shutting down remotely and other errors

    #19 Post by icswainx »

    Hi,

    Firstly, thanks idolse for such an awesome tool - have been looking for something like this for a while.
    I've installed mpdPup on a small HP thin client, and it sounds great. The system has a meagre 256MB RAM and a 256MB CF disk. I use it completely headless, over ssh.
    I'm having some problems shutting down the system - both shutdown and wmpoweroff seem to require X to be running, and fail if it is not. I can do a save2flash to write the state and then manually push the power off button, but it seems a bit hacky. Am I missing something?
    Secondly - and this may not be related to mpdPup (it may be an issue with mpd in general) - mpd is being killed by the kernel due to "out of memory" when creating the initial database via 'mpc update' on my large music collection. It appears to cache the database in memory before writing it to disk. Working on a subset of my music collection works fine - it seems to be a problem with the size of the collection.

    Any help would be very much appreciated.

    Thanks for your time and greetings from sunny New Zealand!

    ldolse
    Posts: 367
    Joined: Fri 23 Oct 2009, 16:33

    #20 Post by ldolse »

    Hi icswainx,

    Thanks for the feedback, glad it's working for you more or less. Regarding the shutdown issues, that seems a bit odd that the shutdown command isn't working. wmpoweroff makes sense, as I believe this is designed to run from X only (wm - window manager) - I can try to make that smarter and have it shut down differently if runnning without X. The shutdown command should be working, but I'll have to admit I may not have tested it, I'll dig into it. I actually do the hacky thing you mention more often than not, or I use the reboot command because I'm testing some change.

    Right now the shutdown scripts manually confirm whether you want to save the running state to flash - perhaps you're closing your ssh session before getting a chance to answer that question?

    The second issue is probably more of an MPD issue in general. That said how big is your music collection? I have 1 terabyte of music, albeit mostly uncompressed. This creates a 5 MB mpd database when finished, so even 256 megs of RAM shouldn't be a problem. However perhaps there is some sort of memory leak during the building of the database itself. I haven't tried creating the DB from scratch on my geode system - that only has 128 megs of RAM, I'll see if I can reproduce the behavior there.

    The other issue as you've noted is it won't flush the in memory database to disk until the database is update is completed, which can take many hours for an empty database. I think I'll ask the MPD team about this point, I think it would be a very good thing to implement.

    What you could do is create your database on another piece of equipment with more memory that can also run mpdPup - once the database is created you can use it on the HP, and future updates won't run into the issue since they'll be tiny - I know 256 megs of RAM should be fine after the db is built as I'm already running it with 128 on one system. If you've installed to flash media as the first post describes you could probably even boot off the same media so there wouldn't be any files to move.

    Post Reply