On Saturday 13 June 2009 06:30:56 Mike Kazantsev wrote:
> On Fri, 12 Jun 2009 16:02:00 -0700
>
> Grant <emailgr...@gmail.com> wrote:
> > When I use the medium quality libsamplerate resampler with mpd, my CPU
> > is around 15% and all is well.  When I try to use the best quality
> > resampler, the CPU stays around 99% and the sound frequently falls
> > apart.  Can I give mpd CPU priority?
>
> Yes, it's usually done via nice/renice commands:
>
>   renice -n -10 -p `pgrep mpd`
>
> You can tune it's priority up to -20 (most real-time priority).

Don't be surprised if it doesn't do much though.

Nice values have always been little more than a hint in Unix systems, the 
kernel is free to do with it whatever it wants, including completely ignoring 
your hint.

To a large degree, Linux does exactly that - ignore the hint. It does have an 
effect, a small one, and usually much smaller than the user expects. Nice is 
an old, antiquated, obsolete and just plain mostly useless way to enforce 
scheduling, entirely unsuited to modern desktops. The better way is to select 
a scheduling algorithm that better suits your needs and let the kernel figure 
out how to give you what you want (it knows MUCH more about how to do it than 
you do).

Or perhaps the OP is using a buggy peice of code. CPU utilization is also a 
notoriously inaccurate metric that does not mean what people tend to think it 
means.

This information is not in the man pages. 
It's on lkml and in the code ;-)

-- 
alan dot mckinnon at gmail dot com

Reply via email to