Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
2.6.12-rc2-JadeX1 [[EBUILD ADDED]]
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
cokey
Advocate
Advocate


Joined: 23 Apr 2004
Posts: 3355

PostPosted: Sat Apr 09, 2005 4:52 pm    Post subject: Reply with quote

hyp0r makes a very good point, Tiger683, you have to be able to explain why you added things into your patchset.

Having lots of different patchsets can be a good idea IF they are made competently by people that know exactly what they are doing otherwise it just does Gentoo harm.

Tiger683, dont stop with the enthusiasm, take what Hyp0r and others have said on board and use it to your advantage. To be an established patchset you need trust and commitment, that takes time. :D
_________________
https://otw20.com/ OTW20 The new place for off the wall chat
Back to top
View user's profile Send private message
rhill
Retired Dev
Retired Dev


Joined: 22 Oct 2004
Posts: 1629
Location: sk.ca

PostPosted: Sat Apr 09, 2005 5:23 pm    Post subject: Reply with quote

there's no need to flame the guy. he's just creating something and having fun. i wouldn't touch it with a ten foot pole, but it's still interesting to look at... from a minimum safe distance. it's like a car accident (without the dead people).
_________________
by design, by neglect
for a fact or just for effect
Back to top
View user's profile Send private message
cokey
Advocate
Advocate


Joined: 23 Apr 2004
Posts: 3355

PostPosted: Sat Apr 09, 2005 5:50 pm    Post subject: Reply with quote

i didn't flame him, i gave good advice
_________________
https://otw20.com/ OTW20 The new place for off the wall chat
Back to top
View user's profile Send private message
Tiger683
Veteran
Veteran


Joined: 08 Jan 2005
Posts: 1347
Location: Heffner's House

PostPosted: Sat Apr 09, 2005 6:14 pm    Post subject: Reply with quote

Hi,
i basically like the way this is evolving, but rather would like to
admit i already read some questions from hyp0r i cannot __yet__
answer in a way satisfying for him and others apparently knowing
more about the subject than i do....

And no, i don't really feel flamed at all...

Two things to point out:

1) im currently doing some hardcore reading on the subject to get enough
insights about the material to have a base knowledge for discussions with
ppl like hyp0r being lead on a fairly equal level of competence

2) implied by the fact i am doing lots of advanced literature, i plan to
take a step back in the defaults in this patchset, voluntary preempt is
obviously better for __all__ users ever interested in using a custom patchset.

For now, i really want the dust to settle down a little, unless someone really
DEMANDS some answers from me not being a support requests.

And hyp0r, i think you __might__ have overestimated my skills, although mybe im wrong,
no idea what you currently think of them, but lets just say, im having it as fun AND a learning process by now.
But thx for interest, as i said, next one will be more "sane" and less "coloured" ;)

cheers

T

PS: No, im not ashamed and not afraid to say i found s.o. knowing more than i do,
and yes i do admit it..... Do with it whateber you want, but do it wisely....

PS2: remember, even some hardcore kernel hackers started off only knowing SOMETHING about what they were doing....
but its the only really motivating kickstart IMHO
_________________
Retired gentoo user
Back to top
View user's profile Send private message
hyp0r
Tux's lil' helper
Tux's lil' helper


Joined: 11 Oct 2003
Posts: 139

PostPosted: Sat Apr 09, 2005 7:29 pm    Post subject: Reply with quote

Wow. I'm really impressed by your point of view and the way you admit it. Many other people use to start insulting and become abusive, when they recognize they are going to "lose" the discussion.
Maybe there's still hope for this world. :)
Back to top
View user's profile Send private message
rhill
Retired Dev
Retired Dev


Joined: 22 Oct 2004
Posts: 1629
Location: sk.ca

PostPosted: Sat Apr 09, 2005 8:13 pm    Post subject: Reply with quote

cokehabit wrote:
i didn't flame him, i gave good advice


not you, you silly bastard. :P
_________________
by design, by neglect
for a fact or just for effect
Back to top
View user's profile Send private message
cokey
Advocate
Advocate


Joined: 23 Apr 2004
Posts: 3355

PostPosted: Sat Apr 09, 2005 8:21 pm    Post subject: Reply with quote

dirtyepic wrote:
cokehabit wrote:
i didn't flame him, i gave good advice

not you, you silly bastard. :P

bastard son of a bastards bastard bastard :P
_________________
https://otw20.com/ OTW20 The new place for off the wall chat
Back to top
View user's profile Send private message
cokey
Advocate
Advocate


Joined: 23 Apr 2004
Posts: 3355

PostPosted: Sat Apr 09, 2005 8:27 pm    Post subject: Reply with quote

Tiger683, excellent choice. Dont dare stop thinking about the patchsets, i can tell you will be alot of help in the community. Just remember 1 thing, not everyone is as sensible as you. When love-sources was started out lovechild and the vanilla dev (i think it was Johnm) worked together to bring a patchset that was experimental but also stable and helping the gentoo community. Things went wrong when the people just wanted speed, speed, speed at the sake of stability. Love was not meant to be that, thats why lovechild left and love-sources got then got a bad rep with the devs (so did lovechild because it had his name). Stability MUST be paramount with any sources or there is no upstream use which is why you will be flamed.

Dont let this stop you young padawan, there is hope for you yet... :D
_________________
https://otw20.com/ OTW20 The new place for off the wall chat
Back to top
View user's profile Send private message
predatorfreak
l33t
l33t


Joined: 13 Jan 2005
Posts: 708
Location: USA, Michigan.

PostPosted: Sat Apr 09, 2005 8:32 pm    Post subject: Reply with quote

cokehabit wrote:
Tiger683, excellent choice. Dont dare stop thinking about the patchsets, i can tell you will be alot of help in the community. Just remember 1 thing, not everyone is as sensible as you. When love-sources was started out lovechild and the vanilla dev (i think it was Johnm) worked together to bring a patchset that was experimental but also stable and helping the gentoo community. Things went wrong when the people just wanted speed, speed, speed at the sake of stability. Love was not meant to be that, thats why lovechild left and love-sources got then got a bad rep with the devs (so did lovechild because it had his name). Stability MUST be paramount with any sources or there is no upstream use which is why you will be flamed.

Dont let this stop you young padawan, there is hope for you yet... :D


Stablity is my ultimate goal of dark-sources and I hope other patchsets will follow in my footsteps and learn if you have to rip out eye-candy for stablity, so be it. I hope that everyone who would possibly read this gets this message, I don't care how dang fast it is, if it comes at the price of stablity or security....... its worthless. Now then, </offtopic> I respect Tiger because he's willing to admit his flaws and he does good work. I'm happy that Tiger is doing his own patchset and I'll continu to support him even if I don't agree with his views on realtime-preempt.
_________________
System: predatorbox
Distro: Arch Linux x86_64
Current projects: blackhole, convmedia and anything else I cook up.
Back to top
View user's profile Send private message
hyp0r
Tux's lil' helper
Tux's lil' helper


Joined: 11 Oct 2003
Posts: 139

PostPosted: Sat Apr 09, 2005 10:45 pm    Post subject: Reply with quote

Apart from several unsuitable comments, I share the interest and enthusiasm which has been risen in this thread. Coupling an interesting topic like this with the needed competence for these elements, the outcome might become a promising step for the consuming linux-community. You won't ever achieve realtime with the current task-environment, but you can set up a kernel, that enables a highly flexible scheduling and a real dynamic behaviour of tasks to adapt user requirements, that change unexpectedly. This is currently a problem, that has not really been solved. Most solutions behave in a way, that my grandma could do better. I think "stability" is often used as an excuse and on the expense of what could actually be done. Just a hint: Andrew Morton already includes many scheduling-patches into his mm-sources. You should always make sure you don't do work that others already did.
Back to top
View user's profile Send private message
Tiger683
Veteran
Veteran


Joined: 08 Jan 2005
Posts: 1347
Location: Heffner's House

PostPosted: Sun Apr 10, 2005 10:21 am    Post subject: Reply with quote

True.

I take one step back with the hard realtime preemption, i found it more promissing coupling Desktop-suited preemption from ingo's solution
with the improvements of scheduling code from others as well as taking a look at other highly interesting patches i.e. i follow the development of high
resolution timers, although it looks like it is moving slowly towards the "mainline". Other than that i was experimenting with the solution
presented here under heavy load multitasking, and it shows its major weaknesses (also thx to feld for reports about problems
on changing the load of system drastically, audio might skip then, which means we need something more adaptable).
For now, before i come up with something new, people should choose Desktop under preemption mode.

T
_________________
Retired gentoo user
Back to top
View user's profile Send private message
schnake
n00b
n00b


Joined: 03 Dec 2003
Posts: 49
Location: Siegburg / Germany

PostPosted: Mon Apr 11, 2005 4:00 pm    Post subject: Reply with quote

Hi,
as there seem to be some common doubts "Why on earth realtime preemption could be needed for Linux" I will try to explain the need from the so called "professional audio" point of view. I know that this not the top priority usage for everyone, but even then it may be a useful example to explain the "What" and "Why". BTW, I am no expert neither on "professional audio" nor on "Realtime-Kernel programming" (hey, I'm not even a native english speaking person :wink:), but by lurking on the LAD, LAU, ardour and jack mailing lists I may have gained enough understanding to provide at least a "birds view" on the subject.

Let's assume an application that produces some sound (PLAYER), and a hardware device to convert and output the (digital) samples as (analog) sound (SOUNDCARD). Let us further assume the SOUNDCARD has two hardware buffers (A and B) for storing the samples to be output, each big enough to hold the samples for 1 second of sound (actually the buffers would be a lot smaller (more like 1 millisecond), but I have the impression that it is easier to follow when using units we are used to :wink:).

So playing sound would be like:
1. PLAYER starts by filling buffer A with samples
2. As soon as buffer A is full the PLAYER tells the SOUNDCARD to start playing from buffer A
3. PLAYER switches to buffer B and starts filling that

Now the PLAYER has exactly 1 second to finish filling buffer B, because as soon as the SOUNDCARD is done with processing the samples from buffer A it will switch over to buffer B. If the PLAYER did not manage to fill buffer B in time the sound will "skip".

Now, for any "normal" sound work (like OGG playback) every "recent" CPU will easily be able to calculate the samples for buffer B in time (and even use only a small percentage of the available cycles for that). But the PLAYER must get the chance to run its calculation in time.

If somewhere within the kernel there is a codepath being executed that
- takes a good part of (or even exceeds) 1 second runtime, and
- that can not be "interrupted" (preempted),
then the PLAYER will surely miss its deadline to fill buffer B within 1 second from step 2, regardless how powerful the CPU is.

That is what the patchset deals with. Kernel code that (potentially) blocks the CPU for a significant amount of time without being able to be preempted is changed (that may range from "simply" changing lock types to completely refactor that codepath) so that it can be preempted. The "worst case" (= the longest running codepath that still can not be preempted) basically is the system latency.

If that latency (= "the worst case") is known (let's say 0.5 seconds) a realtime task like the PLAYER can be sure that it will get its chance to run at least every 0.5 seconds if it needs so. If the PLAYER itself is "determinstic" and can guarantee (because it does not do anything "risky" like blocking I/O, GUI work etc.) that it needs max. 0.3 seconds for its own calculations it now in turn can be guaranteed that it will take a maximum of 0.5 + 0.3 = 0.8 seconds ("time", not "CPU usage"!) to fill the next buffer. Or put the other way round, if the SOUNDCARD buffers are at least "0.8 seconds big" the system can reliably output sound in realtime. And if you use buffers > 0.8 seconds there would even be some spare CPU cycles left for other things to do :wink:

Ok, but what if I simply use huge buffers (maybe 5 seconds each) and do not care about high (but surely below 5 seconds) system latency at all?

This is basically what "consumer audio" (I personally do not like that "consumer" versus "professional" wording, but anyway) sound deamons like ARTS do. The effect is that it takes some time until you actually hear the sound after you pressed "Play" (until the first buffer is filled), and that the sound continues playing for some time after you pressed "Stop" (until the last buffer provided is "empty"). In reality that time is mostly short enough to be hardly even recognized, so no big deal at all?

For simply playing some OGG's this maybe is not a big deal indeed. But what if, as one example, you want to use your computer as a realtime effects processor? You plug the microphone into your soundcard, have the computer calculate some nice effects on the input and output the result via the soundcard to your amplifier. Now you start singing along some playback. It takes 5 seconds to fill the soundcards input buffer, 0.3 seconds to calculate the effect and again 5 seconds to fill the output buffer. So everything you sing will take 10.3 seconds until it actually comes out of your speakers. On a karaoke event it might even be funny for the singer to be 10 seconds late, but any musician trying do something serious under such "live software monitoring" conditions will surely grow mentally ill in no time :wink:

Please keep in mind that everywhere within this post you should replace "seconds" with "milliseconds" to get some more realistic scale. And I heard somewhere that humans start to "unpleasingly" recognize audio latency at as low as 3 milliseconds (e.g. from the moment you "sing" until the moment you "hear").

So you need low audio roundtrip latency (< 3 ms) - and to that end kernel realtime preemption - as soon as you only do such "highly professional audio work" as simply trying to use your computer as an effects processor on your next karaoke party. Perhaps for some people this could already make the difference between "shit-hot" and "hot air" :D And note that realtime capabilities are absolutely not about providing better overall system perfomance, but "only" to enable code with realtime demands to be able to "keep promises".
Back to top
View user's profile Send private message
DrWoland
l33t
l33t


Joined: 13 Nov 2004
Posts: 603

PostPosted: Wed Apr 13, 2005 6:05 am    Post subject: Reply with quote

I don't know anything about this RTP stuff, but I compiled the kernel with it and it works fine. There are a few things missing, but I'm really just waiting on fallow to come out with whatever he makes of his new patchset so I can have vesa-tng back.
_________________
I'm not a Guru, I just ask a lot of questions.
Back to top
View user's profile Send private message
Tiger683
Veteran
Veteran


Joined: 08 Jan 2005
Posts: 1347
Location: Heffner's House

PostPosted: Wed Apr 13, 2005 6:09 am    Post subject: Reply with quote

Heh, currently i've cut the work on it a little to release a new nitro, until then, nothing new will happen.
Next release will be a little less "experimental", but hey, its not as broken as some previous attempts....

stuff that isn't in: it's because it was broken while being in...

T
_________________
Retired gentoo user
Back to top
View user's profile Send private message
DrWoland
l33t
l33t


Joined: 13 Nov 2004
Posts: 603

PostPosted: Wed Apr 13, 2005 6:27 am    Post subject: Reply with quote

Tiger683 wrote:
Heh, currently i've cut the work on it a little to release a new nitro, until then, nothing new will happen.
Next release will be a little less "experimental", but hey, its not as broken as some previous attempts....

stuff that isn't in: it's because it was broken while being in...

T


Oh no, don't take my post as criticism.

It's been a while since a nitro release. Still gonna try to do the embedded nvidia/ati drivers? That's what turned me away from Nitro in the first place.
_________________
I'm not a Guru, I just ask a lot of questions.
Back to top
View user's profile Send private message
Tiger683
Veteran
Veteran


Joined: 08 Jan 2005
Posts: 1347
Location: Heffner's House

PostPosted: Wed Apr 13, 2005 6:31 am    Post subject: Reply with quote

Don't even mention it again :P

It was one of the most sick misfeatures in a patchset since a long time....
We don't want to be the retards of the forums, and it had more breakage than use anyways...

T
_________________
Retired gentoo user
Back to top
View user's profile Send private message
DrWoland
l33t
l33t


Joined: 13 Nov 2004
Posts: 603

PostPosted: Wed Apr 13, 2005 7:07 am    Post subject: Reply with quote

Tiger683 wrote:
Don't even mention it again :P

It was one of the most sick misfeatures in a patchset since a long time....
We don't want to be the retards of the forums, and it had more breakage than use anyways...

T


Yeah, the sad thing was, Nvidia worked perfectly fine for me until that happened, ironic I think :P

Good luck, I'll be adding nitro to my daily forum searches to make sure I don't miss it :)
_________________
I'm not a Guru, I just ask a lot of questions.
Back to top
View user's profile Send private message
hyp0r
Tux's lil' helper
Tux's lil' helper


Joined: 11 Oct 2003
Posts: 139

PostPosted: Thu Apr 14, 2005 12:59 am    Post subject: Reply with quote

@schnake
What's the stuff you're smoking called? You are describing a scenario, that is not doable in an environment that underlies non-rt circumstances. Scheduling tasks with deadlines in an environment, where one have and other's don't is impossible. That's what buffers are for - storing data, so a process does not get blocked. Otherwise prefetching is a solution, which is done very often, when it comes to fullfilling timing issues - at least within a limited degree of timing constraints.
Applications must be designed for using deadlines (compare the typical rt-dispatcher, that use c-tasks for this issue, which can be found in any trivial rt-book). RTAI executes the conventional linux within a scheduled thread besides deadline-scheduled threads, which is the opposite to jadex' approach, so jadex won't reach rt this way.
Anyway, if the player is that deterministic as you say, you can prefetch data, just like pipelines and prediction "buffers"(here's it again) do, so why should the be a need for deadline-scheduled requests, which provide their real strength in a non-deterministic environment?
Easier said: There are many IO-actions, that need to be changed in the current kernel, before the rt-plan will work at all and before the kernel developers do that, the user who requires such functionality will go for RTAI, RTL or QNX.
Back to top
View user's profile Send private message
schnake
n00b
n00b


Joined: 03 Dec 2003
Posts: 49
Location: Siegburg / Germany

PostPosted: Thu Apr 14, 2005 10:01 am    Post subject: Reply with quote

I'm not smoking anything particular dangerous, i hope :lol:

I already admitted upfront that I'm by no means an "technical" expert about those things. But I got the feeling that there sometimes is a basic misunderstanding when discussing this topic. Maybe the misunderstanding is on my side, but anyway it will be a win for me understand. Perhaps simply the term "realtime" leads into the wrong heading, too.

As I understand, you (and others) are talking mainly about how to correctly schedule task that have to meet deadlines. But I think the "Realtime-preemption" patch does not target scheduling, but latency.

Scenario: The soundcard raises an interrupt that it just switched to the second buffer. Now the audio producer must "re-fill" the first buffer until the second one is "eaten" by the soundcard. If at time of the interrupt the kernel just executes some long un-preemtable codepath the audio producer is "delayed" until that codepath finished (regardless on how smart any scheduler may be, the currenly running kernel code simply can not be preempted). The patch just tries to cut down the runtime of those un-preemptable kernel codepaths to a minimum. The audio processing code simply must get to run ASAP on some event (like a soundcard interrupt).

And as to prefetch (I assume this means something like preparing the "future" data forehand outside of the RT thread and only do a simple and cheap copy in RT) this is not an option for realtime audio, as the current "output" may well be a function of the current "input", so you can calculate only the current data, but never the future. For that reason the audio producer also may not be determinstic (as the complexity of the input may vary). But if it gets run "immediately" on the trigger chances are much better it will be able to keep its deadline than if it gets run delayed because of some non-preemptable kernel code. And it is not only about producing data "in time", but more like running a "read-process-write" cycle ASAP.

As to buffers, of course you always deal with any high latency simply by making then "big enough". But exactly that is contrary to "realtime"-audio, where buffers must be as small (or "short") as possible. If a human brain can notice a sound latency of as low as 3 ms you simply can not achieve "perceived" realtime audio as long as there may be a (let's say) 20 ms system latency from some non-preemptible kernel codepath (and what I heard reiser4 seems to want to win the price for introducing the longest non-premptible codepaths ever :lol:)

So, as far as I understand this is not about "real hard realtime" at all (as for scheduling to deadlines, RT-Plan etc.), but simply about to get some code running ASAP on some triggering event by reducing the potential delay that comes from non-preemptible kernel code.

But maybe I am wrong 8O
Back to top
View user's profile Send private message
hyp0r
Tux's lil' helper
Tux's lil' helper


Joined: 11 Oct 2003
Posts: 139

PostPosted: Thu Apr 14, 2005 10:11 pm    Post subject: Reply with quote

schnake wrote:
I already admitted upfront that I'm by no means an "technical" expert about those things. But I got the feeling that there sometimes is a basic misunderstanding when discussing this topic. Maybe the misunderstanding is on my side, but anyway it will be a win for me understand. Perhaps simply the term "realtime" leads into the wrong heading, too.

As I understand, you (and others) are talking mainly about how to correctly schedule task that have to meet deadlines. But I think the "Realtime-preemption" patch does not target scheduling, but latency.

That's what realtime is not about or is, but as an inherent matter. Latency occurs due to lazyness oder inability to preempt a task or causing times a process has to wait - mostly introduced by blocking/non-preemtible processes.
Realtime defines logical answers within timing constraints, i.e. the oldsk00l boolean semantic just like "yes or no", but not "hang on a second, I'll fetch your data asap". That's the argument I'm defending.

When it comes to latency, you're right as codepaths or, I call it control flow, can certainly cause other processes to wait times, which might not be necessary. The definition is the key to this discussion. I talk about realtime, you talk about latency. Latency can be reduced by introducing deadlines, but may not lead to the answer or result you expect.
Say you send an OP to fetch Data X from Block Y and enforce to fetch this data within 10ms. In the meantime this block has been paged out due to caching issues and needs to be fetched from harddisk. This means the access time and read time is the minimum time to fetch your data. Adding to unknown threading or tasking issues the time will get higher.
Realtime ensures your MMU e.g. will tell you "Dude, here's your data" or "Sorry, data couldn't be retrieved in time". You will get your answer within 10ms deadline, but maybe not the correct result. So latency is low on the expense of not getting the data at all. That's what I called "inherent". So realtime and latency are siblings, but don't require the other one.

Quote:
(and what I heard reiser4 seems to want to win the price for introducing the longest non-premptible codepaths ever :lol:)
Well, sometimes my reiser4-fs does "strange" things, when paging around blocking several processes. That's what I call "sick". But sometimes length of OPs may not be as bas as they seem, e.g. Pentium4s pipeline. As long as it's scheduled correctly it does not matter. At least in mostly deterministic systems.

Quote:
So, as far as I understand this is not about "real hard realtime" at all (as for scheduling to deadlines, RT-Plan etc.), but simply about to get some code running ASAP on some triggering event by reducing the potential delay that comes from non-preemptible kernel code.

It's not about hard or soft deadlines... The term "realtime" just doesn't fit in here.

As of latency and what you said I agree.
Back to top
View user's profile Send private message
schnake
n00b
n00b


Joined: 03 Dec 2003
Posts: 49
Location: Siegburg / Germany

PostPosted: Fri Apr 15, 2005 8:58 am    Post subject: Reply with quote

schnake wrote:
Perhaps simply the term "realtime" leads into the wrong heading, too.

hyp0r wrote:
It's not about hard or soft deadlines... The term "realtime" just doesn't fit in here.

There's the beef :D

Now how about the intention for using this (probably misleadingly named) "Realtime preemption"-Patch.

It does not automagically upgrade your good ol' generic Linux to a Realtime-OS. It does not make your desktop work "somehow feel snappier". Your computer will not melt down because this kernel too fast for your hardware to keep up. No, you can not run PS2 games under wine with this one. And your color laser still wont be able to print real money :wink:

But it is also none of that "Hey, after applying that animated boot logo patch everything got a lot faster and is rock stable (had only 3 crashes last week)" kind of things.

It enables me to do really "rock stable" (no "XRUN"s) external audio I/O with < 1.5 ms latency (@ 1 GHz Thinkpad). Without that patch this is not possible. And this is not something subjective. It is measurable ( see http://kerneltrap.org/mailarchive/1/message/20514/flat or http://www.sysex.net/testing/2.6.11-rc4-RT-V0.7.39-01/test1-14client-4port+wmcube/jack_test4-2.6.11-rc4-RT-V0.7.39-01-200502131726.png or google for "jack_test"). And it is no "magic" or "voodoo" either, it is perfectly clear and understandable what it does and why this leads to much improved low audio latency.

@Tiger683: So, why not take the jump and post this patchset to a new thread named someting like "Gentoo audio kernel - JadeX sources". It could be made clear that this is intended for "hardcore audio work" (perhaps even as alternative kernel for beeing booted as needed only). If someone feels it improves overall system performance (although I personally don't think so), fine. But that's a purely unintentional side effect. People could concentrate on discussing audio related kernel patches there, instead of talking about sense or nonsense of RTP with regard to "main stream" desktop use.

I'm aware that this may be of interrest for only a small fraction of the gentooers. But they exist, and I've seen guite a few questions about "best audio kernel for gentoo" yet (e.g. http://lalists.stanford.edu/lau/2005/04/0206.html )

Or does such a beast already exist (alive and kicking) :?:
Back to top
View user's profile Send private message
Tiger683
Veteran
Veteran


Joined: 08 Jan 2005
Posts: 1347
Location: Heffner's House

PostPosted: Fri Apr 15, 2005 9:58 am    Post subject: Reply with quote

In the nitro-sources thread Tiger683 wrote:

Also there was a quite interesting discussion raised in the JadeX thread, which leads to the conclusion,
That Jadex will in the future be the alternative (second in the bootloader) kernel for those, who like nitro,
but need also something for professional audio, with low latencies for sound-servers like jack.


hyp0r and shnake:
Big thanx for showing the right direction in which this project should head,
starting with the next release that is.... :D

cheers

T
_________________
Retired gentoo user
Back to top
View user's profile Send private message
schnake
n00b
n00b


Joined: 03 Dec 2003
Posts: 49
Location: Siegburg / Germany

PostPosted: Fri Apr 15, 2005 10:20 am    Post subject: Reply with quote

@hyp0r:
hyp0r wrote:
Say you send an OP to fetch Data X from Block Y and enforce to fetch this data within 10ms. In the meantime this block has been paged out due to caching issues and needs to be fetched from harddisk. This means the access time and read time is the minimum time to fetch your data. Adding to unknown threading or tasking issues the time will get higher.
Realtime ensures your MMU e.g. will tell you "Dude, here's your data" or "Sorry, data couldn't be retrieved in time". You will get your answer within 10ms deadline, but maybe not the correct result. So latency is low on the expense of not getting the data at all. That's what I called "inherent".

That (not finished in time) corresponds to what is called an XRUN in JACK terminology. JACK gets to run with RT priority "as soon as possible" after some trigger event (soundcard interrupt), and in turn calls client registered callbacks on the RT priority thread (this is overly simplyfied, of course). The client callbacks are (or at least should be ;-)) carefully coded not to do any possibly blocking things like locking, dynamic memory allocation (or even disk I/O or GUI updates).

There is always the possibility of some "Sorry, data couldn't be retrieved in time" (= XRUN) kind of result if the callback tree has too many or too heavy clients, but the same tree (no clients added or removed) should basically have a constant runtime on any two runs.

If you are running at really low audio latency settings even a "small" critical section of un-preemptible kernel code may take away a significant part (or even all) of the available time from audio processing. And that leads to XRUNs and audible sound "clicks".

At least this is what I think how it works (take it with a grain of salt):wink:

BTW with regard of cutting down the maximum length of un-preemptible kernel "control flows", do you see any reason this could conceptionally be a bad thing at all? Shouldn't schedulers generally be able to profit from a kernel that can be interrupted at a finer "granularity". Or do you think that it may even do harm instead (provided the kernel code was stable).
Back to top
View user's profile Send private message
schnake
n00b
n00b


Joined: 03 Dec 2003
Posts: 49
Location: Siegburg / Germany

PostPosted: Fri Apr 15, 2005 11:01 am    Post subject: Reply with quote

Tiger683 wrote:
hyp0r and shnake:
Big thanx for showing the right direction in which this project should head,
starting with the next release that is.... :D

Hurray, Gentoo will get a dedicated low latency audio kernel. That's great news. Yeeessss sir... :D
Back to top
View user's profile Send private message
hyp0r
Tux's lil' helper
Tux's lil' helper


Joined: 11 Oct 2003
Posts: 139

PostPosted: Fri Apr 15, 2005 11:47 am    Post subject: Reply with quote

The "beef" is, that one should be aware, what's this about and where the patches strength is in.
As always, you know that you cannot tune a particular function for absolute, ultimate, ultraperformance, while others stay the same.
This is like OPs that are more often used will have lower execution times, i.e. lower latency, while less used OPs will have higher execution times.

That's why I asked Tiger683 for some "scientific" evalution on this, to see where the balance went to. Some people certainly like lower latency for audio applications, but are not willing to do this on the expense of their usually used applications.
That's what I was after the whole time. :p

Quote:
BTW with regard of cutting down the maximum length of un-preemptible kernel "control flows", do you see any reason this could conceptionally be a bad thing at all? Shouldn't schedulers generally be able to profit from a kernel that can be interrupted at a finer "granularity". Or do you think that it may even do harm instead (provided the kernel code was stable).

Well, the length of an instruction or OP is always a matter of design and importance, think of atomic instructions or instructions, that should be executed at once to prevent raceconditions or hazards (you know about RAW hazards in cpus).
Low latency is always desired, no doubt, but as soon as tasks are highly preemptible the designer should make sure this does not end in a non-determinstic behaviour or even thrashing. So tasks must be designed for preemption.
Going for low latency and highly interruptable tasks are proven as an advantage as we can see in solutions like qnx, rtai, ibm aix etc... But this gain must be achieved, not used.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum