From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1MFP1j-0002w8-S3 for garchives@archives.gentoo.org; Sat, 13 Jun 2009 08:55:52 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D2AF5E03D0; Sat, 13 Jun 2009 08:55:50 +0000 (UTC) Received: from mail-ew0-f224.google.com (mail-ew0-f224.google.com [209.85.219.224]) by pigeon.gentoo.org (Postfix) with ESMTP id 91376E03D0 for ; Sat, 13 Jun 2009 08:55:50 +0000 (UTC) Received: by ewy24 with SMTP id 24so833580ewy.34 for ; Sat, 13 Jun 2009 01:55:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:references:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:message-id; bh=cNwjrFrRdd9cxnbbg+SGX+vSkI0HgIHmc0jIa8e3ZD8=; b=OWqZPBSE/xBfU8YjhLQOB08jiUf9nCdzpNCuQot35TCQhx90Apel+hvinB3LC+2Xer EICPwfFbW1bYASLtuEkR+PeWqxpY0318FGAyP2H6UEGvkPpzLg3O4PTR5b7kgMnAbwqb 1gUel6DarG9/PNVxLn2JgvW5GAfTI/9n8NDiY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:references:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :message-id; b=uGxzYePC/8znQ930c9E1hSSDEEDtdM7+m2SYd2vySH3+hqXm1sBSWPcMFkz/g6UfRp 4lJV+XD/wkNi1lzNGg03Ejc4VtSPgd62790J8nexU10S4qId36crsm71Rx8czBOAnBGw VNki1gyIxM0ptV05oB5tjks1FO8FjDeA42kHs= Received: by 10.210.91.7 with SMTP id o7mr1839210ebb.32.1244883350024; Sat, 13 Jun 2009 01:55:50 -0700 (PDT) Received: from nazgul.localnet (196-210-153-123-rrdg-esr-2.dynamic.isadsl.co.za [196.210.153.123]) by mx.google.com with ESMTPS id 24sm1234252eyx.3.2009.06.13.01.55.48 (version=SSLv3 cipher=RC4-MD5); Sat, 13 Jun 2009 01:55:49 -0700 (PDT) From: Alan McKinnon To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Prioritizing mpd Date: Sat, 13 Jun 2009 10:54:19 +0200 User-Agent: KMail/1.11.4 (Linux/2.6.30-gentoo-r1; KDE/4.2.4; x86_64; ; ) References: <49bf44f10906121602x6b0cf20rfe2731edfdf7d205@mail.gmail.com> <20090613103056.552dc565@coercion> In-Reply-To: <20090613103056.552dc565@coercion> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906131054.19583.alan.mckinnon@gmail.com> X-Archives-Salt: 4cfc15d9-e88b-45b6-8111-a9349e67db05 X-Archives-Hash: 1d30ae46e3db7ac37095c13926c3def3 On Saturday 13 June 2009 06:30:56 Mike Kazantsev wrote: > On Fri, 12 Jun 2009 16:02:00 -0700 > > Grant 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