From: Lee Revell <rlrevell@joe-job.com>
To: Con Kolivas <kernel@kolivas.org>
Cc: szonyi calin <caszonyi@yahoo.com>,
linux kernel mailing list <linux-kernel@vger.kernel.org>,
ck list <ck@vds.kolivas.org>,
caszonyi@rdslink.ro
Subject: Re: [ANNOUNCE] Interbench v0.20 - Interactivity benchmark
Date: Sat, 16 Jul 2005 16:28:35 -0400 [thread overview]
Message-ID: <1121545716.10774.16.camel@mindpipe> (raw)
In-Reply-To: <200507140958.00510.kernel@kolivas.org>
On Thu, 2005-07-14 at 09:57 +1000, Con Kolivas wrote:
> On Thu, 14 Jul 2005 03:34, Lee Revell wrote:
> > On Wed, 2005-07-13 at 13:27 +0200, szonyi calin wrote:
> > > I have the following problem with audio:
> > > Xmms is running with threads for audio and spectrum
> > > analyzer(OpenGL).
> > > The audio eats 5% cpu, the spectrum analyzer about 80 %. The
> > > problem is that sometimes the spectrum analyzer is eating all of
> > > the cpu while the audio is skipping. Xmms is version 1.2.10
> > > kernel is vanilla, latest "stable" version 2.6.12, suid root.
> > >
> > > Does your benchmark simultes this kind of behaviour ?
> >
> > That's just a broken app, the kernel can't do anything about it. XMMS
> > should not be running the spectrum analyzer thread at such a high
> > priority as to interfere with the audio thread.
>
> I agree; optimising for this is just silly.
I took a closer look and it's indeed quite broken. If XMMS is run in
realtime mode, and multithreading is enabled, it runs everything
SCHED_RR - GUI, audio, spectrum analyzer. (And since it relies on new
threads inheriting RT scheduling when pthread_create()'d, the threads
will fail to get SCHED_RR on buggy NPTL versions like the one in Debian
Sarge).
This untested patch should enable RT scheduling for only the (ALSA)
audio thread. Make sure NOT to run in realtime mode.
Lee
--- ../xmms-1.2.10+cvs20050209.orig/Output/alsa/audio.c 2005-01-31 17:45:08.000000000 -0500
+++ Output/alsa/audio.c 2005-07-16 16:06:06.000000000 -0400
@@ -962,6 +962,7 @@
/* open callback */
int alsa_open(AFormat fmt, int rate, int nch)
{
+ struct sched_param sparam;
debug("Opening device");
inputf = snd_format_from_xmms(fmt, rate, nch);
effectf = snd_format_from_xmms(fmt, rate, nch);
@@ -1010,6 +1011,9 @@
flush_request = -1;
pthread_create(&audio_thread, NULL, alsa_loop, NULL);
+ sparam.sched_priority = sched_get_priority_max(SCHED_FIFO);
+ if (pthread_setschedparam (audio_thread, SCHED_FIFO, &sparam) )
+ fprintf(stderr, "Error %s getting SCHED_FIFO for audio thread\n", strerror (errno));
}
return 1;
prev parent reply other threads:[~2005-07-16 20:28 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-12 11:10 [ANNOUNCE] Interbench v0.20 - Interactivity benchmark Con Kolivas
2005-07-12 11:57 ` David Lang
2005-07-12 12:02 ` Con Kolivas
2005-07-12 12:17 ` David Lang
2005-07-12 12:23 ` Con Kolivas
2005-07-12 15:18 ` Lee Revell
2005-07-12 17:55 ` David Lang
2005-07-12 18:33 ` Lee Revell
2005-07-12 20:55 ` Al Boldi
2005-07-12 21:32 ` Con Kolivas
2005-07-13 17:54 ` Bill Davidsen
2005-07-14 0:21 ` Con Kolivas
2005-07-14 0:31 ` David Lang
2005-07-14 0:46 ` Con Kolivas
2005-07-14 1:00 ` Con Kolivas
2005-07-15 12:50 ` Bill Davidsen
2005-07-15 10:41 ` kernel
2005-07-18 14:51 ` Bill Davidsen
2005-07-13 11:27 ` szonyi calin
2005-07-13 17:34 ` Lee Revell
2005-07-13 23:57 ` Con Kolivas
2005-07-16 20:28 ` Lee Revell [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1121545716.10774.16.camel@mindpipe \
--to=rlrevell@joe-job.com \
--cc=caszonyi@rdslink.ro \
--cc=caszonyi@yahoo.com \
--cc=ck@vds.kolivas.org \
--cc=kernel@kolivas.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox