Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Mar 2004 13:35:19 +0300
From:      Sergey 'DoubleF' Zaharchenko <doublef@tele-kom.ru>
To:        Zhang Weiwu <zhangweiwu@realss.com>
Cc:        Wang Penghui <wangpenghui@realss.com>
Subject:   Re: priority-- curious about cpu resouce share
Message-ID:  <20040304133519.5c36433b@Hal.localdomain>
In-Reply-To: <4045F241.80902@realss.com>
References:  <Law11-F539uwETDgZbo0001f813@hotmail.com> <20040303165022.49f2fac9@Hal.localdomain> <4045F241.80902@realss.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--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 <zhangweiwu@realss.com> 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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040304133519.5c36433b>