From: Roger Larsson <roger.larsson@skelleftea.mail.telia.com>
To: Linus Torvalds <torvalds@transmeta.com>,
William Lee Irwin III <wli@holomorphy.com>
Cc: Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-audio-dev@music.columbia.edu,
Jeff Garzik <jgarzik@mandrakesoft.com>
Subject: Re: Scheduler ( was: Just a second ) ...
Date: Tue, 18 Dec 2001 17:16:50 +0100 [thread overview]
Message-ID: <200112181619.fBIGJBv13914@maila.telia.com> (raw)
In-Reply-To: <Pine.LNX.4.33.0112172153410.2416-100000@penguin.transmeta.com>
In-Reply-To: <Pine.LNX.4.33.0112172153410.2416-100000@penguin.transmeta.com>
This might be of interest on linux-audio-dev too...
On Tuesday den 18 December 2001 07.09, Linus Torvalds wrote:
> On Mon, 17 Dec 2001, William Lee Irwin III wrote:
> > 5: 46490271 XT-PIC soundblaster
> >
> > Approximately 4 times more often than the timer interrupt.
> > That's not nice...
>
> Yeah.
>
> Well, looking at the issue, the problem is probably not just in the sb
> driver: the soundblaster driver shares the output buffer code with a
> number of other drivers (there's some horrible "dmabuf.c" code in common).
>
> And yes, the dmabuf code will wake up the writer on every single DMA
> complete interrupt. Considering that you seem to have them at least 400
> times a second (and probably more, unless you've literally had sound going
> since the machine was booted), I think we know why your setup spends time
> in the scheduler.
>
> > On Mon, Dec 17, 2001 at 08:27:18PM -0800, Linus Torvalds wrote:
> > > Which sound driver are you using, just in case this _is_ the reason?
> >
> > SoundBlaster 16
> > A change of hardware should help verify this.
>
> A number of sound drivers will use the same logic.
>
> You may be able to change this more easily some other way, by using a
> larger fragment size for example. That's up to the sw that actually feeds
> the sound stream, so it might be your decoder that selects a small
> fragment size.
>
> Quite frankly I don't know the sound infrastructure well enough to make
> any more intelligent suggestions about other decoders or similar to try,
> at this point I just start blathering.
>
> But yes, I bet you'll also see much less impact of this if you were to
> switch to more modern hardware.
>
> grep grep grep.. Oh, before you do that, how about changing "min_fragment"
> in sb_audio.c from 5 to something bigger like 9 or 10?
>
> That
>
> audio_devs[devc->dev]->min_fragment = 5;
>
> literally means that your minimum fragment size seems to be a rather
> pathetic 32 bytes (which doesn't mean that your sound will be set to that,
> but it _might_ be). That sounds totally ridiculous, but maybe I've
> misunderstood the code.
I think it really is 32 samples, yes that is little - but too small?
It depends on the used sample frequency...
Paul Davis wrote this on linux-audio-dev 2001-12-05
"in doing lots of testing on JACK, i've noticed that although the
trident driver now works (there were some patches from jaroslav and
myself), in general i still get xruns with the lowest possible latency
setting for that card (1.3msec per interrupt, 2.6msec buffer). with
the same settings on my hammerfall, i don't get xruns, even with
substantial system load."
>
> Jeff, you've worked on the sb code at some point - does it really do
> 32-byte sound fragments? Why? That sounds truly insane if I really parsed
> that code correctly. That's thousands of separate DMA transfers
> and interrupts per second..
>
Lets see: we have >1 GHz CPU and interrupts at >1000 Hz
=> 1 Mcycle / interrupt - is that insane?
If the hardware can support it? Why not let it? It is really up to the
applications/user to decide...
> Raising that min_fragment thing from 5 to 10 would make the minimum DMA
> buffer go from 32 bytes to 1kB, which is a _lot_ more reasonable (what,
> at 2*2 bytes per sample and 44kHz would mean that a 1kB DMA buffer empties
> in less than 1/100th of a second, but at least it should be < 200 irqs/sec
> rather than >400).
>
Yes, it is probably more reasonable - but if the soundcard can support it?
(I have a vision of lots of linux-audio-dev folks pulling out their new
soundcard and replacing it with their since long forgotten SB16...)
/RogerL
--
Roger Larsson
Skellefteå
Sweden
next prev parent reply other threads:[~2001-12-18 16:19 UTC|newest]
Thread overview: 83+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20011217200946.D753@holomorphy.com>
2001-12-18 4:27 ` Linus Torvalds
2001-12-18 4:55 ` William Lee Irwin III
2001-12-18 6:09 ` Linus Torvalds
2001-12-18 6:34 ` Jeff Garzik
2001-12-18 12:23 ` Rik van Riel
2001-12-18 14:29 ` Alan Cox
2001-12-18 17:07 ` Linus Torvalds
2001-12-18 15:51 ` Martin Josefsson
2001-12-18 17:08 ` Linus Torvalds
2001-12-18 16:16 ` Roger Larsson [this message]
2001-12-18 17:16 ` Herman Oosthuysen
2001-12-18 17:16 ` Linus Torvalds
2001-12-18 17:21 ` David Mansfield
2001-12-18 17:27 ` Linus Torvalds
2001-12-18 17:54 ` Andreas Dilger
2001-12-18 18:27 ` Doug Ledford
2001-12-18 18:52 ` Andreas Dilger
2001-12-18 19:03 ` Doug Ledford
2001-12-19 9:19 ` Peter Wächtler
2001-12-19 11:05 ` Helge Hafting
2001-12-21 20:23 ` Rob Landley
2001-12-18 18:35 ` Linus Torvalds
2001-12-18 18:58 ` Alan Cox
2001-12-18 19:31 ` Gerd Knorr
2001-12-18 18:25 ` William Lee Irwin III
2001-12-18 14:21 ` Adam Schrotenboer
2001-12-18 18:13 ` Davide Libenzi
[not found] <Pine.LNX.4.33.0112181508001.3410-100000@penguin.transmeta.com>
2001-12-20 3:50 ` Rik van Riel
2001-12-20 4:04 ` Ryan Cumming
2001-12-20 5:52 ` Linus Torvalds
2001-12-20 5:39 ` David S. Miller
2001-12-20 5:58 ` Linus Torvalds
2001-12-20 6:01 ` David S. Miller
2001-12-20 22:40 ` Troels Walsted Hansen
2001-12-20 23:55 ` Chris Ricker
2001-12-20 23:59 ` CaT
2001-12-21 0:06 ` Davide Libenzi
2001-12-20 11:29 ` Rik van Riel
2001-12-20 11:34 ` David S. Miller
[not found] <20011218020456.A11541@redhat.com>
2001-12-18 16:50 ` Linus Torvalds
2001-12-18 16:56 ` Rik van Riel
2001-12-18 17:18 ` Linus Torvalds
2001-12-18 19:04 ` Alan Cox
2001-12-18 21:02 ` Larry McVoy
2001-12-18 21:18 ` Rik van Riel
2001-12-18 21:14 ` David S. Miller
2001-12-18 21:17 ` Larry McVoy
2001-12-18 21:19 ` Rik van Riel
2001-12-18 21:30 ` David S. Miller
2001-12-19 16:50 ` Daniel Phillips
2001-12-18 19:11 ` Mike Galbraith
2001-12-18 19:15 ` Rik van Riel
2001-12-18 17:55 ` Davide Libenzi
2001-12-18 19:43 ` Alexander Viro
2001-12-18 5:59 V Ganesh
-- strict thread matches above, loose matches on Subject: below --
2001-12-18 5:11 Thierry Forveille
2001-12-17 21:41 ` John Heil
2001-12-18 14:31 ` Alan Cox
2001-12-16 0:13 Just a second Linus Torvalds
2001-12-17 22:48 ` Scheduler ( was: Just a second ) Davide Libenzi
2001-12-17 22:53 ` Linus Torvalds
2001-12-17 23:15 ` Davide Libenzi
2001-12-17 23:18 ` Linus Torvalds
2001-12-17 23:39 ` Davide Libenzi
2001-12-17 23:52 ` Benjamin LaHaise
2001-12-18 1:11 ` Linus Torvalds
2001-12-18 1:46 ` H. Peter Anvin
2001-12-18 5:54 ` Benjamin LaHaise
2001-12-18 6:10 ` Linus Torvalds
2001-12-18 1:54 ` Rik van Riel
2001-12-18 2:35 ` Linus Torvalds
2001-12-18 2:51 ` David Lang
2001-12-18 3:08 ` Davide Libenzi
2001-12-18 3:19 ` Davide Libenzi
2001-12-18 14:09 ` Alan Cox
2001-12-18 9:12 ` John Heil
2001-12-18 15:34 ` degger
2001-12-18 18:35 ` Mike Kravetz
2001-12-18 18:48 ` Davide Libenzi
2001-12-18 16:50 ` Mike Kravetz
2001-12-18 17:22 ` Linus Torvalds
2001-12-18 17:50 ` Davide Libenzi
2001-12-18 17:00 ` Linus Torvalds
2001-12-18 19:17 ` Alan Cox
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=200112181619.fBIGJBv13914@maila.telia.com \
--to=roger.larsson@skelleftea.mail.telia.com \
--cc=jgarzik@mandrakesoft.com \
--cc=linux-audio-dev@music.columbia.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
--cc=wli@holomorphy.com \
/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
Powered by JetHome