From owner-freebsd-questions@FreeBSD.ORG Thu Mar 4 02:36:58 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 474A116A4CE for ; Thu, 4 Mar 2004 02:36:58 -0800 (PST) Received: from mx.tele-kom.ru (mx.tele-kom.ru [213.80.148.6]) by mx1.FreeBSD.org (Postfix) with SMTP id C894043D49 for ; Thu, 4 Mar 2004 02:36:56 -0800 (PST) (envelope-from doublef@tele-kom.ru) Received: (qmail 17418 invoked by uid 555); 4 Mar 2004 13:36:54 +0300 Received: from hal.localdomain (213.80.149.156) by t-k.ru with TeleMail/2 id 1078396612-17385 for zhangweiwu@realss.com; Thu, Mar 4 13:36:52 2004 +0300 (MSK) Date: Thu, 4 Mar 2004 13:35:19 +0300 From: Sergey 'DoubleF' Zaharchenko To: Zhang Weiwu Message-Id: <20040304133519.5c36433b@Hal.localdomain> In-Reply-To: <4045F241.80902@realss.com> References: <20040303165022.49f2fac9@Hal.localdomain> <4045F241.80902@realss.com> X-Mailer: Sylpheed version 0.9.9claws (GTK+ 1.2.10; i386-portbld-freebsd4.8) Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="pgp-sha1"; boundary="Signature=_Thu__4_Mar_2004_13_35_19_+0300_hLtYTfnTfy7L_hWy" cc: __ ___ cc: __ _ cc: __ ___ cc: questions@freebsd.org cc: __ __ cc: weiwuzhang@hotmail.com cc: Wang Penghui Subject: Re: priority-- curious about cpu resouce share X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2004 10:36:58 -0000 --Signature=_Thu__4_Mar_2004_13_35_19_+0300_hLtYTfnTfy7L_hWy Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: 7bit On Wed, 03 Mar 2004 22:57:05 +0800 Zhang Weiwu probably wrote: > Things can hardly be perfect. Now I begin to use mpg123, I used your > method of "rtprio up and su back", very useful to me. > > But if mpg123 has higher priority than ppp, sometimes mpg123 decides to > move to another song, it reloads buffer, starveing ppp and timeouting > bluetooth device... If mpg123 has equal/lower priority with ppp, they > struggle for CPU, and that *sounds* bad. Now I adjusted buffer, it works > so so. > > I read the handbook it says "no way to limit CPU percentage". It's my > toy, a old P166M box, I let other people in the office ssh to the box > with cmp3 console DJ (backended mpg123) to play music, because it has > good speakers. I use ppp over bluetooth to connect to the box when I'm > enjoying sun shine outdoor. You still didn't post the whole of top(1) output. FWIW splay has a -2 switch that permits it to generate half that quality output using half that processor cycles (not sure about mpg123). Unless the people out there are melomaniacs, that may be sufficient. P.S. It *seems* possible to use a little hack to renice the mp3 player after it has loaded the new song. That is, every time a new song is being played, launch both the player and a separate shell process which sleep(1)s for a second, and then rtprio's the player. For one song, it will *probably* look like this: ---------begin playsong.sh-------- #!/bin/sh mpg123 $1& MPG123_PID=$! (sleep 1; sudo rtprio 3 -${MPG123_PID})& wait ---------end playsong.sh-------- assuming you have the appropriate line in your sudoers file (the '-' before the ${MPG123_PID} is not a typo). -- DoubleF "I refuse to have a battle of wits with an unarmed person." --Signature=_Thu__4_Mar_2004_13_35_19_+0300_hLtYTfnTfy7L_hWy Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFARwZywo7hT/9lVdwRAjiNAJ41O3ZLfPm62L+YOUzubCD0EuS3FQCfYsYw c4T0C6w694FQxWj1H30uScM= =WwoQ -----END PGP SIGNATURE----- --Signature=_Thu__4_Mar_2004_13_35_19_+0300_hLtYTfnTfy7L_hWy--