mpdPup - Simplified MPD Music Server/Jukebox - v0.9.3

For talk and support relating specifically to Puppy derivatives
Message
Author
bonalux
Posts: 22
Joined: Wed 20 Jun 2012, 11:02

Re: mpd nice -1

#436 Post by bonalux »

willemoes wrote: On a sidenote, do any of the Alix and/or usb-powered Dac users use optimized power-supplies replacing wall-wart/usb-power (regulated or battery power)?
I've upgraded from cheap PSU and usb powered WaveIO to self powered Alix and Wave and the difference in S.Q. is very noticeable, highly recommended this upgrade.

Regarding renice, i've done the same as you but didn't got the time to listen well this changes.

Regards.

willemoes
Posts: 12
Joined: Thu 08 Nov 2012, 09:16

psu

#437 Post by willemoes »

lugili, bonalux

Thanks; I´m comtemplating on battery and/or regulated power suplies for Alix and usb-Dac QNKTC AB-1.2 USB DAC (highly recommended!)

(first try will probably be 12V battery supply for the Alix)

regards, Finn

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

#438 Post by ldolse »

Thread has been busy - didn't see all these updates til the other day.

@Mark Van de Pas, your post about improvements is appreciated and thoughtful. Regarding Tiny Core Linux, I haven't checked it out. Not that I'm opposed to it and similar Linux variants, but when I originally looked for distributions to optimize Puppy Linux was the one that hit all the right notes:
  • Read only file system that's fairly transparent to users
  • Lots of remastering/building tools allowing contributors to spin their own variants (with an active community supporting this)
  • Minimal OS footprint to start with
  • Minimal X GUI for users averse to the CLI
There are a variety of other distributions that perform better at various pieces of this puzzle, and Tiny Core definitely hits all the right notes on the minimal part, but I'm not sure how well it meets the other requirements. And because it starts from a completely different premise it's hard to know which parts of it's configuration would be worth translating over to Puppy.

@Dynobot, wlowes - regarding nice in the mpd startup script, I see now I forgot to add a dash in front of the 15 in the init file, but is there a specific reason to choose -1 vs. -15 or higher?

About ulimit - this one is pretty interesting, and one I hadn't read about before. This seems like it should be straightforward to add to rc.local or a similar location.

Regarding the startup scripts in /etc/init.d - I'd like to point out that most of those are disabled by default - Puppy linux only starts init scripts which are marked executable, and most are not marked that way. Any that you do want to disable you can just run chmod -x instead of deleting them.

Regarding the various processes to kill, I'd like to understand what causes them to be started in the first place rather than just kill them after the fact - anything swap related can definitely go (problem is I don't know what starts it). udev related processes probably need to stay, but can be reniced. Avahi-daemon is included quite intentionally for user friendliness (and was compiled for bare minimum footprint), but also can be reniced.

@everyone else providing info on processes to renice - all the tips are appreciated and will be noted. I'm thinking of an init script which will re-nice a laundry list of processes after everything has been started.

@supersurfer, thanks for the update regarding mPad, I'll have to see if I can fix my own albums by fixing the tags.
Last edited by ldolse on Wed 03 Jul 2013, 14:25, edited 2 times in total.

Dynobot
Posts: 44
Joined: Wed 05 Dec 2012, 12:04

#439 Post by Dynobot »

@Idolse

I trired putting the ulimit command inside every place I could imagine. But non of them 'seemed' to work. I say seemed because when I change the ulimit via a shell and do a ulimit -a to see the change it shows....however if I close the shell, then reopen and do a ulimit -a the default values show up.

Also I did install util-Linux and was able to set cpu affinity.

As far as the init files I agree the best way is not to delete them but to do a -x, or even better open X and use PuppyLinux's own tools to configure which processes in the init file will be executed.

I installed a fresh copy on MPDPup and tried to do things cleaner and tested the 'tweaks' with more of a methodological approach. One at a time instead of on top of one another and adjusted nice values and listened for a change. To be honest most changes are barely noticeable if at all...

wlowes
Posts: 49
Joined: Fri 08 Jun 2012, 02:30
Location: Toronto, Canada

where to put ulimit

#440 Post by wlowes »

I too have been reading and experimenting where to put ulimit command at startup.

I tried at the end of my startup script which is last in the init.d list. No luck.
Then I tried in the 20.mpd startup right after the renice. Also no luck.

The thing that surprises me most is I leave my system on 7x24. Every evening when I come to listen, ulimit -s & -l are back to the default. I set them to unlimited and the next day they are back to the default.

I can't imagine I get a power failure everyday. Is it possible that logging on to root via ssh or connecting to mpd via a client somehow involkes a script that sets the default?

DenisP
Posts: 56
Joined: Mon 25 Mar 2013, 22:17
Location: Croatia

Squeezebox server possible?

#441 Post by DenisP »

As a sidenote, since I'm tinkering with various music "appliances", I wondered if it would be possible to compile any kind of squeezebox server, either for mpdPup or any other Puppy variant?
I checked, and there were several questions over the past few years, but it seems no one was able to compile it for Puppy (Perl issues?).

I also saw that Idolse once asked about it in another part of the forum a couple of years back, so I wondered if anything came of it?

I know I can run squeezebox server under some other linux variants, but I would much prefer to use any puppy variant for such a server.

I tried the squeezelite player (http://code.google.com/p/squeezelite/) in mpdpup, and it runs without problems :) It appears as another player in the squeeze network, and I can direct my music to it from the main squeezebox server. So, the player works :)

However, the server is another issue....

Could it be compiled for Puppy at all (this exceeds my abilities, though...)?

Sorry for the digression, this does not relate directly to mpdPup, but since we're already tinkering with music hardware/software, I thought I might as well ask here :)

boulogne75
Posts: 15
Joined: Mon 17 Dec 2012, 13:34

Re: where to put ulimit

#442 Post by boulogne75 »

wlowes wrote:I too have been reading and experimenting where to put ulimit command at startup.

I tried at the end of my startup script which is last in the init.d list. No luck.
Then I tried in the 20.mpd startup right after the renice. Also no luck.

The thing that surprises me most is I leave my system on 7x24. Every evening when I come to listen, ulimit -s & -l are back to the default. I set them to unlimited and the next day they are back to the default.

I can't imagine I get a power failure everyday. Is it possible that logging on to root via ssh or connecting to mpd via a client somehow involkes a script that sets the default?
ulimit xxx has effect only on the current login session and for the logged user. That is why it is reseted every time you ssh.
I can't imagine any positive impact on sound unless you ssh under the user executing mpd.

To make these changes apply on boot and for all users or a specific user you shoul use:
/etc/security/limits.conf

boulogne75
Posts: 15
Joined: Mon 17 Dec 2012, 13:34

#443 Post by boulogne75 »

Hi Idolse,

Do you have an easy way to test a real time kernel?
What is actually the kernel shipped with mpdPup (uname -a). I can't find it and don't have mpdPup installed right now :oops:

Did you make progress with nfs support?

Thanks in advance.
Last edited by boulogne75 on Fri 05 Jul 2013, 20:21, edited 1 time in total.

Dynobot
Posts: 44
Joined: Wed 05 Dec 2012, 12:04

#444 Post by Dynobot »

MPDPup ships with kernel 2.6.39

# uname -r
2.6.39
#

StudioPuppy has a real time kernel but only supports an old version of MPD 15.4

Puppy Linux be default only has one user...root.

Every shell is started by root and PuppyLinux does not have a security/limits.conf file nor a security directory in /etc. For this reason the only way to change limts is via shell or by finding the file that invokes the limits in the first place.

The Realtime kernel has benefits of lower latency [however widely disputed as being for record only]. However the realtime kernel allows scheduling and FIFO preferences that the normal kernel does not.

Ideally repositories would be up to date with the latest versions of products and dependencies will be kept up to date and available as well. I think Idolse went through a monumental effort to get MPDPup up to the level its currently all things considered. Installing even rev 16.x of MPD on a normal distro of Puppy Linux is all but impossible for the avg user.

boulogne75
Posts: 15
Joined: Mon 17 Dec 2012, 13:34

#445 Post by boulogne75 »

Thanks for the reply Dynobot,
Dynobot wrote: MPDPup ships with kernel 2.6.39
# uname -r
2.6.39
#
What about uname -a? That is it give any clue if it is a preempt kernel?
Dynobot wrote: StudioPuppy has a real time kernel but only supports an old version of MPD 15.4
How is it?
Dynobot wrote: Puppy Linux be default only has one user...root.
Every shell is started by root and PuppyLinux does not have a security/limits.conf file nor a security directory in /etc. For this reason the only way to change limts is via shell or by finding the file that invokes the limits in the first place.
Ok. Did I a quick search and all that seems to be related. Only one user. Looks like it is the reason pam is not installed by default.
Can you confirm that there is not any /etc/pam or /etc/pam.d directories? If this is the case is it installable via repositories?
Which is the user running mpd, root?
Dynobot wrote: The Realtime kernel has benefits of lower latency [however widely disputed as being for record only]. However the realtime kernel allows scheduling and FIFO preferences that the normal kernel does not.
Scheduling and FIFO are actually possible with any preempt kernel.
RT kernel only adds true real time preemption for all the kernel, that is even lower latency.
Here are interesting links:
https://rt.wiki.kernel.org/index.php/CO ... T_RT_Patch
https://www.osadl.org/Realtime-Linux.pr ... nux.0.html
http://www.artist-embedded.org/docs/Eve ... riques.pdf

The interesting thing here was to test mpdPup with a preempt kernel, threadirqs enabled and rtirq script. I thought it was more easy :lol:
In my case/setup (arch linux, alix, rtirq, nrpacks=1, no mpd tweaks), I found significant improvements when switching:
stock kernel (PREEMPT,CONFIG_HZ=300) -> custom kernel (PREEMPT,CONFIG_HZ=1000) -> rt kernel (FULL PREEMPT,CONFIG_HZ=1000)
Dynobot wrote: Ideally repositories would be up to date with the latest versions of products and dependencies will be kept up to date and available as well. I think Idolse went through a monumental effort to get MPDPup up to the level its currently all things considered. Installing even rev 16.x of MPD on a normal distro of Puppy Linux is all but impossible for the avg user.
The first time I tried mpdPup I was very surprised with its sound quality and praised ldolse. The main and only reason I moved away from mpdPup was the lack of support for nfs (I don't have cifs anymore).
I greatly appreciate his effort, that is why I regularly keep an eye on this thread.

Dynobot, not sure if there was some misunderstanding in my last post. I hope no, I am just trying to help :wink:

Dynobot
Posts: 44
Joined: Wed 05 Dec 2012, 12:04

#446 Post by Dynobot »

Hi no worries boulogje75, didn't mean to come off the wrong way either.

I appreciate your insights :D

boulogne75
Posts: 15
Joined: Mon 17 Dec 2012, 13:34

#447 Post by boulogne75 »

Dynobot wrote:Hi no worries boulogje75, didn't mean to come off the wrong way either.

I appreciate your insights :D
Great, just wanted to make it clear :D

Dynobot
Posts: 44
Joined: Wed 05 Dec 2012, 12:04

#448 Post by Dynobot »

@boulogje75

With regards to studio4 and MPD ver 15.4. To my ears it sounds just a tad bit thick compared to MpdPup. I tried installing newer versions to no avail.

Linux has a way of sucking you in....in that you start out with a seemingly simple task and 12 hours later you are still at square one. As frustration builds you [..I...] tend to become more determined and exhaust all resources along with myself in the process.

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

#449 Post by ldolse »

Regarding the discussion on ulimit - this is starting to sound like a major research project, I'll see what I can find out though - wouldn't be surprised if the defaults are set at compile time for the kernel. I'm pretty sure I don't want to install PAM or any extra background processes to make limits.conf work.

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

#450 Post by ldolse »

@DenisP - compiling Squeeze Server is possible and I've done it successfully while exploring how to package it. The real problem is the packaging - it relies heavily on Perl and numerous CPAN packages. Trying to package dozens of Perl dependencies together is a nightmare for which I've found no solution.

DenisP
Posts: 56
Joined: Mon 25 Mar 2013, 22:17
Location: Croatia

#451 Post by DenisP »

ldolse wrote:@DenisP - compiling Squeeze Server is possible and I've done it successfully while exploring how to package it. The real problem is the packaging - it relies heavily on Perl and numerous CPAN packages.
OK, I understand - but I don't need no packaging :)
I just want to install it on ANY Puppy version in any way possible, so I'd appreciate ANY kind of help - e.g. which version of LMS server to use and how to compile and install everything.
Installing it on mpdPup would be awesome - that way I could choose either mpd or LMS as a server upon startup or something.... Add squeezelite as a player, and I could have a standalone squeezebox ecosystem-in-a-box (if desired for connecting to other players on the network - where other "players" could be thin clients with mpdPup installed, but using "squeezelite" as a player in this case).

I've checked the possibility of using mpdPup (i.e. mpd) with several "players" on the network, but it is not possible - at least not in the way LMS (squeezebox server) does it... :(

boulogne75
Posts: 15
Joined: Mon 17 Dec 2012, 13:34

#452 Post by boulogne75 »

ldolse wrote:Regarding the discussion on ulimit - this is starting to sound like a major research project, I'll see what I can find out though - wouldn't be surprised if the defaults are set at compile time for the kernel. I'm pretty sure I don't want to install PAM or any extra background processes to make limits.conf work.
That is how I understand it:
The values set at kernel level define system wide (for all users) limits which can be changed on the fly via sysctl commands. ulimits allow to change them for a user context. So, I am not sure it is good idea to set them in the kernel.

May be you can try this, assuming mpd is running under mpd user:
(it won't work with pam installed but may be without it...)

# su - mpd
# ulimit -a --> confirm 64
# ulimit -l unlimited
# ulimit -a --> confirm unlimited
# exit

Close ssh session and open it again:

# su - mpd
# ulimit -a --> confirm unlimited

If it works you should be able to add it to your rc script.

About PAM, I don't think it runs any background process. IIRC, It is only accessed whith a user login or when a shell is started.

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

#453 Post by ldolse »

Was having issues posting responses yesterday, a couple more:

Regarding the questions on the kernel - the specific kernel is 2.6.39-4, and it has the BFS scheduler patches. I'm not sure whether this scheduler contributes to any sound quality perception discussions, but theoretically it sounds like a better deal for audio than the stock scheduler.

@boulogne75 - NFS support still isn't in the wizards, but the system has always supported NFS to the best of my knowledge. I've recently picked up a Synology NAS which supports NFS, so I may dig back into it.

Thanks for the extra info on ulimits.

@DenisP, unfortunately I don't remember exactly what I did to get SqueezeServer up and running - it involved installing CPAN and tons of dependencies (using CPAN) - once all the dependencies were installed I was able to compile/install the SqueezeServer software. I think the dependencies were tracked down by installation failure errors. I just grabbed the latest SqueezeServer package from logitech at that time - this was about 18 months ago.

Dynobot
Posts: 44
Joined: Wed 05 Dec 2012, 12:04

#454 Post by Dynobot »

To achieve lowest latency with BFS

Configure your kernel with 1000Hz, preempt ON and disable dynamic ticks.


With the BFS patch schetool cound be used to give MPD top priority.

From the mouth of the creator of BFS...
"Run your audio and video apps SCHED_ISO:
schedtool -I -e amarok
This will run amarok as an unprivileged real-time task. Note that if you start
an application that tries to get real-time scheduling (eg jackd) and you are
not starting it as root, BFS will automatically elevate it to SCHED_ISO for
you to give it the next best thing."


With BFS, once MPD is given unprivileged real-time priority it will be auto-magically run in a 'core' that give best performance.


From the mouth of the creator of BFS.
"Because BFS uses one global runqueue
for all tasks on the system, when a realtime task wants CPU time, BFS will
find the most suitable CPU anywhere in the system to run it on, by kicking
off the lower priority task running anywhere."



http://ck.kolivas.org/patches/bfs/bfs-faq.txt


Looks like this one command [schedtool -I -e mpd] after schedtool is installed will increase performance.


Update:

Yes schedtool does seem to work as advertised. It can be added to the start up script.

Two birds down via one stone. :D[quote][/quote]

Dynobot
Posts: 44
Joined: Wed 05 Dec 2012, 12:04

#455 Post by Dynobot »

Bug in MPD with wav file for version 17.x

I remember this awhile back and I bought it up to the MPD folks...I found the fix for it back then and will work with MpdPup.

Indeed wav files did not play on my machine with rev 17.x installed. The fix is, you have to insert this line in the mpd.conf file.

decoder {
plugin "sndfile"
enabled "no"
}

Post Reply