Bugzilla – Bug 471
Hooks for playing/not playing notifications possible for re-nicing?
Last modified: 2008-12-18 11:51:24 UTC
I'm very happy with SlimServer (and my SqueezeBox), but have a suggestion for a possible future enhancement. I run SlimServer on a relatively low power x86 machine running Gentoo Linux. Because of this, I keep it nice'd to -10 to prevent audio stuttering if I'm doing anything else on the server at the same time. This works very well, as child process inherit the increased priority. However, while there is no audio playing having the server niced to -10 means that it's a bit CPU hungry when it could really be a bit fairer and run at a normal priority. As SlimServer runs on a number of different architectures and people have their own requirements, this is probably a feature that would not sit well directly implemented in SlimServer. However, a method of hooking notifications to external scripts/programs probably would. My idea is as follows: 1. Have a 'hooks' folder within the SlimServer directory tree. This folder would normally be empty, but could contain scripts to hook into notifications from SlimServer. 2. Introduce a couple of hooks: * First streaming started * Last streaming stopped (The reason this wouldn't be playing/stopped is there may be multiple players) 3. I could write scripts that received these notifications and did any re-nicing as appropriate. 4. Other hooks could be added for other things, I suppose. If anyone needs clarification then just shout.
I happen to have an Execute plugin that currently triggers on a selection of events: open file, stop, play, power-on. For each event, you can choose a script to run from a scripts directory. This could be used to renice on play and stop if you so wish. This might work for you: http://www.deane-freeman.com/slimserver/Execute.pm
Ah ha, that looks very interesting. I'll have a gander. Just need to check whether I could get multiple players to correctly nice/renice on first play and last stop without some awful reference counting, but that'll give me something to do! Thanks very much for the pointer. Stuart
Looks like a different approach, using plugins, will be better.
Routine bug db maintenance; removing old versions which cause confusion. I apologize for the inconvenience.