Bug 471 - Hooks for playing/not playing notifications possible for re-nicing?
: Hooks for playing/not playing notifications possible for re-nicing?
Status: RESOLVED WORKSFORME
Product: Logitech Media Server
Classification: Unclassified
Component: Misc
: 5.x or older
: All All
: P2 enhancement (vote)
: ---
Assigned To: Blackketter Dean
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-08-04 02:42 UTC by Stuart Hickinbottom
Modified: 2008-12-18 11:51 UTC (History)
0 users

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stuart Hickinbottom 2004-08-04 02:42:32 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.
Comment 1 KDF 2004-08-04 12:07:43 UTC
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
Comment 2 Stuart Hickinbottom 2004-08-05 00:38:02 UTC
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
Comment 3 Blackketter Dean 2004-08-12 09:58:43 UTC
Looks like a different approach, using plugins, will be better.
Comment 4 Chris Owens 2008-12-18 11:51:24 UTC
Routine bug db maintenance; removing old versions which cause confusion.  I apologize for the inconvenience.