From 5b6a847e54c542bc5e47ad58c69da15f9b76f335 Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Sat, 20 Mar 2010 12:13:01 +0000 Subject: [PATCH] start mpd normally, patch from Stefan Monnier SVN-Revision: 20318 --- sound/mpd/Makefile | 2 +- sound/mpd/files/mpd.init | 24 +++++++++--------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/sound/mpd/Makefile b/sound/mpd/Makefile index 2b1f26c05..e5a7eb911 100644 --- a/sound/mpd/Makefile +++ b/sound/mpd/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mpd PKG_VERSION:=0.15.8 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=@SF/musicpd diff --git a/sound/mpd/files/mpd.init b/sound/mpd/files/mpd.init index 017ad7701..381c592d1 100644 --- a/sound/mpd/files/mpd.init +++ b/sound/mpd/files/mpd.init @@ -4,27 +4,21 @@ START=93 start() { #create mpd directories - md=`grep music_directory /etc/mpd.conf | cut -d "\"" -f 2 | sed "s/~/\/root/g"` - if [ ! -d $md ]; then - mkdir -p $md - fi pld=`grep playlist_directory /etc/mpd.conf | cut -d "\"" -f 2 | sed "s/~/\/root/g"` if [ ! -d $pld ]; then mkdir -p $pld fi - #create mpd db - /usr/bin/mpd --stdout --create-db - - #optional export for mpc - #export MPD_HOST=127.0.0.1 + # Set the initial volume to something manageable + amixer set PCM 40 #start mpd - /usr/bin/mpd - - #generate playlist and start to play - /usr/bin/mpc listall | /usr/bin/mpc add - - /usr/bin/mpc play - /usr/bin/mpc repeat + if [ -x /bin/nice ]; then + # This has real-time constraints, so let's at least tell the OS + # that this should have higher priority to avoid skipping + # when doing other things in the background. + nice="nice -n -10" + fi + $nice /usr/bin/mpd } stop() { -- 2.30.2