Announcement

Collapse
No announcement yet.

KLANG: A New Linux Audio System For The Kernel

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #76
    i agree with datenwolf that mixing audio with floating point is completely unnecessary. after all the DAC's on audio cards can handle only a fixed number of bits.

    besides, aren't there SSE instructions for integers also? if so, would they be allowed in the kernel?

    Comment


    • #77
      Originally posted by ninez View Post
      why do you keep referring to floating point as 'fake analog'?! I'm not arguing your post, since i am not great at mathematics - yet, i have never heard anyone or ever read any definition of floating point that included 'fake analog'.

      I've always been under the impression that Floating point is more accurately described as 'scientific notation' in computing, and the benefit FP being floating point values have advantages over both integer and fixed-point calculations because they are much more 'granular', and thus can hold a much wider range of values.

      anyway, i just thought it was silly that you keep refering to FP as 'fake analog' in your post, which doesn't even really come across as a layman term, but rather just seems like it isn't a term that should've been used to begin with.
      Because with float, we are operating with analog-like values, but using digital base to process and store them. True analog does not have thresholds (ie 1 / 0) and hence is much more detailed, "warm", but also more chaotic and susceptible to noise. Remember those audiophiles preferring vinyl over everything? Vinyl discs and whole processing is true analog, no digitization (and hence, no "bumpness"). Digital technology can compensate this by throwing heaps of bandwidth and processing power though.

      The point that I had, is that the float value inside digital machines is not as chaotic, noisy or unpredictable as datenwolf has seen it. Its pretty discrete.
      So, in my opinion, the only pro-argument for KLANG was/is: integer processing takes less resources - which I think is also incorrect, because we have floating point processing modules and specific instructions.

      I really don't think all this has any value for Linux or its users.. It looks like a fight between misunderstandings and good vs better.

      However, making something integrated, like CoreAudio, from ALSA+JACK+Pulse, while staying flexible -- would be a good thing for KLANG to do. Yet I don't think its possible without cooperation of whole scene. Which in turn means, if datenwolf values truth over personal opinion, lets hope he will cooperate instead of sack punching in the basement. Because if even if he succeeds, the result will just tear the system more apart, instead of evolution. Paul has typed pretty a lot of interesting info here, so he (Paul) does not seem to me he'll refuse to cooperate...

      Comment


      • #78
        Originally posted by crazycheese View Post
        The point that I had, is that the float value inside digital machines is not as chaotic, noisy or unpredictable as datenwolf has seen it. Its pretty discrete.
        So, in my opinion, the only pro-argument for KLANG was/is: integer processing takes less resources - which I think is also incorrect, because we have floating point processing modules and specific instructions
        DIVPS sse opcode 18-30 cpu cycles
        (divide four packed single-precision floating-point values(4x32bit floats packed in one 128bit register)

        DIV opcode says 39
        (1x32bit integer)

        if int needs to be converted to float first, that takes 4 to 14 cycles(and back)
        int can be easily divided by 2,4,8 etc using shifts(fast)

        problem with computer audio processing is that it must never stall, that means a buffer, that means memory access, that means latencies

        PS compilers are better at making code for normal int's then sse
        Last edited by gens; 08-04-2012, 10:19 PM.

        Comment


        • #79
          oh, and AVX2 will have support for integers(floats too ofc), meaning the sse edge that floats have will disappear
          8 channels computed at once...

          most modern sound cards also have dedicated IC's for most of that audio stuff

          Comment


          • #80
            Originally posted by crazycheese View Post
            Because with float, we are operating with analog-like values, but using digital base to process and store them. True analog does not have thresholds (ie 1 / 0) and hence is much more detailed, "warm", but also more chaotic and susceptible to noise. Remember those audiophiles preferring vinyl over everything? Vinyl discs and whole processing is true analog, no digitization (and hence, no "bumpness"). Digital technology can compensate this by throwing heaps of bandwidth and processing power though.
            I understand the difference between analog and digital, thanks. I attended a Music and Technology program and have also worked in several studios in my 20s... and Again, i wasn't arguing any of your post, but only citing that floating point does not equal 'fake analog' which in terms of terminology that could be used, is a completely unneeded junk term that doesn't even translate into something useful for a layman. - which was the point of my post.

            Originally posted by crazycheese View Post
            The point that I had, is that the float value inside digital machines is not as chaotic, noisy or unpredictable as datenwolf has seen it. Its pretty discrete.
            So, in my opinion, the only pro-argument for KLANG was/is: integer processing takes less resources - which I think is also incorrect, because we have floating point processing modules and specific instructions.

            I really don't think all this has any value for Linux or its users.. It looks like a fight between misunderstandings and good vs better.

            However, making something integrated, like CoreAudio, from ALSA+JACK+Pulse, while staying flexible -- would be a good thing for KLANG to do. Yet I don't think its possible without cooperation of whole scene. Which in turn means, if datenwolf values truth over personal opinion, lets hope he will cooperate instead of sack punching in the basement. Because if even if he succeeds, the result will just tear the system more apart, instead of evolution. Paul has typed pretty a lot of interesting info here, so he (Paul) does not seem to me he'll refuse to cooperate...
            How is KLANG going to make these technologies (Jack, PA, ALSA) integrated, when the project is setting out to replace ALL of them inside the kernel??? (hint: it can't). Actually, what i personally got from reading Paul's posts (but i don't speak for him) was that he pretty much shot down the entire idea of KLANG, and also pointed out some areas where Datenwolf seems to have not thought about real world usage, nor bothered to even interact with any other Linux proaudio developers, either :\

            To me KLANG is just a really bad idea - if you want to improve the Linux audio stack, work on ALSA, PA and/or Jack ... OSS sucks and we don't need to revive it under some new name (klang) with some added features, while then trying to convince every developer to port his/her applications to it. ALSA has better hardware support than OSS (or KLANG) so unless DW plans to port and maintain every driver from ALSA - this just seems like a dumb idea, regardless of any argument of Float vs. fixed-point ...

            Comment


            • #81
              Originally posted by ninez View Post
              I understand the difference between analog and digital, thanks. I attended a Music and Technology program and have also worked in several studios in my 20s... and Again, i wasn't arguing any of your post, but only citing that floating point does not equal 'fake analog' which in terms of terminology that could be used, is a completely unneeded junk term that doesn't even translate into something useful for a layman. - which was the point of my post.
              Hm, ok, let me approach it from the other side. I'm not trying to teach you, just sharing thoughts.

              The discrete approach, contrary to analog, has finite states. 1 or 0. You can't really chop 1 down to 0.9, same with zero. This is distinct feature, not bug, of discrete - to withstand chaos, science requires precision.

              You can, however chop analog in half, so much you need. 0,5; 0,25; 0,125 ... ∞
              However, the disadvantage is that analog is completely unstable to noise and "going down the road" you will encounter higher noise levels, which do sum up in operations, and will limit the amount of real granularity. Pretty sure everyone knows it. Musicians value analog for "chopping" and use good cables to protect from noise.

              Well, you may call it "analog model nested on discrete approach", or "analog emulation on discrete".. it is the floating point variables.

              I use the term "fake analog" for digits that exist and are processed using discrete approach (granular one),
              but have the analog nature (of inifinite "going down the road") inside.

              Because they are based on discrete, they are protected from noise and chaos which you would encounter in analog wire. They are precise here for.
              Because they follow analog model, they can be chopped and chopped, every time correctly in half.

              But the disadvantage of comes from their discrete basement - they can only be chopped down up to certain volume, limited by their mantissa.
              This does not happen with true analog approach - at all (read above).

              After they (float) run out of space, they will "approximate" by cutting down, rounding. All this imprecision is cased by lack of volume, by lack of processing power. And of course by some specific operations, that are only applicable to analog values that is - such as "rounding up" (mod), for example. Pretty same happens to discrete integer, if it runs out of "volume" - it will overrun or clip the "less insignificant part".

              I think the engine, proposed by datenwolf will have problems processing audio volume (audio fidelity) and will require much higher bit capacity to overcome than he proposed, granted it will have zero imprecision. 64bit, 128bit?

              Comment


              • #82
                Originally posted by crazycheese View Post
                Hm, ok, let me approach it from the other side. I'm not trying to teach you, just sharing thoughts.
                What part of i don't need you to teach me the difference between analog and digital did you not understand, exactly?!?!

                oh, i am not trying to teach you, just "sharing my thoughts" - yet then here you go, with another lesson - 'approaching it from the other side' :\

                again, I already know the difference - i don't need a lesson (yet again). my comment was only geared at your terrible terminology, that being 'fake analog', which i think is a somewhat useless term, that wouldn't be used in any definition of 'floating point'.

                you don't need to continue, pointing out fairly obvious things to someone whom already understands these concepts, especially when i have already explained to you that I don't need you to educate me on a subject. :\

                Comment


                • #83
                  Originally posted by ninez View Post
                  What part of i don't need you to teach me the difference between analog and digital did you not understand, exactly?!?!

                  oh, i am not trying to teach you, just "sharing my thoughts" - yet then here you go, with another lesson - 'approaching it from the other side' :\

                  again, I already know the difference - i don't need a lesson (yet again). my comment was only geared at your terrible terminology, that being 'fake analog', which i think is a somewhat useless term, that wouldn't be used in any definition of 'floating point'.

                  you don't need to continue, pointing out fairly obvious things to someone whom already understands these concepts, especially when i have already explained to you that I don't need you to educate me on a subject. :\
                  I feel your pain simply reading through his condescending comments. Reminds me of a time long ago, when my dad felt compelled to outline in detail the 'correct' method of taping up an broken envelope. It forced me to tape the envelope in a completely unconventional way in order to defy his unwanted explanation...

                  In short, you don't have to ague with him. Everyone (else) realises you understand the difference between analogue and digital... However, you will never truly be able to live in peace with yourself until you prove without doubt that analogue and digital are in fact the same thing.

                  Comment


                  • #84
                    Originally posted by Nevertime View Post
                    I feel your pain simply reading through his condescending comments. Reminds me of a time long ago, when my dad felt compelled to outline in detail the 'correct' method of taping up an broken envelope. It forced me to tape the envelope in a completely unconventional way in order to defy his unwanted explanation...

                    In short, you don't have to ague with him. Everyone (else) realises you understand the difference between analogue and digital... However, you will never truly be able to live in peace with yourself until you prove without doubt that analogue and digital are in fact the same thing.
                    This is somewhat apt, but I think theres a way out of it. After having similar feelings I read his name, pondered for a second and read it again. Its sort of bliss wheen you realise.

                    Comment


                    • #85
                      Talk about coincidence !

                      KLANG = German for SOUND
                      I am not kiddin you
                      Unbeknown to him, this guy picks one awsome name for an audio utility.

                      With a name like that it better live up to those German quality standards !

                      Comment


                      • #86
                        Originally posted by fliteshare View Post
                        KLANG = German for SOUND
                        I am not kiddin you
                        Unbeknown to him, this guy picks one awsome name for an audio utility.

                        With a name like that it better live up to those German quality standards !


                        It's also very similar to the name of an existing userspace library, irrKlang.

                        Frankly, Pulseaudio already works.

                        I'd much, much, MUCH rather see a FOSS reimplementation of FMOD. And no, OpenAL is not even remotely fucking close to being a replacement. Especially when you keep in mind the FMOD Designer tool.

                        Comment


                        • #87
                          Originally posted by fliteshare View Post
                          Unbeknown to him, this guy picks one awsome name for an audio utility.
                          The creator of this ("Wolfgang 'datenwolf' Draxinger") speaks German. I'm pretty sure this was not a coincidence.

                          Comment


                          • #88
                            Originally posted by ninez View Post
                            What part of i don't need you to teach me the difference between analog and digital did you not understand, exactly?!?!

                            oh, i am not trying to teach you, just "sharing my thoughts" - yet then here you go, with another lesson - 'approaching it from the other side' :\

                            again, I already know the difference - i don't need a lesson (yet again). my comment was only geared at your terrible terminology, that being 'fake analog', which i think is a somewhat useless term, that wouldn't be used in any definition of 'floating point'.

                            you don't need to continue, pointing out fairly obvious things to someone whom already understands these concepts, especially when i have already explained to you that I don't need you to educate me on a subject. :\
                            So, you understand what I'm talking about, but you don't like how I call it ? Call it as you like then, problem solved. Regarding my terminology, I like it and hereby it stays approved for and by me.

                            Comment


                            • #89
                              I'm still withholding judgment until I see how it performs. In the meantime I'm happy with PA.

                              Originally posted by fliteshare View Post
                              KLANG = German for SOUND
                              I am not kiddin you
                              It also means 'tone' or 'sound with an appealing character' in Swedish, so I imagine both derive from an old Germanic word.

                              Originally posted by elanthis View Post
                              It's also very similar to the name of an existing userspace library, irrKlang.
                              Not to mention CLANG!

                              I like the name KLANG in this conext; it's clever and tongue-in-cheek, like upstart, telepathy, pidgin, mutter, konversation, et al. It even fits as an acronym (Kernel-level Audio Next Generation).

                              That said, it really really conflicts with existing projects', to the point where I'd recommend a name change before it gets irrevocably set in stone. Obviously most names are already taken, so to avoid the "Simpsons did it" phenomenon you'd have to take into account how widespread and popular they are.

                              Comment


                              • #90
                                Originally posted by crazycheese
                                Analogue, sans disadvantages of low lifespan due to instability to "dust", has two serious advantages over digital:
                                1* ability to store much more information per state
                                2* "softness", which comes from (1)
                                This viewpoint is common and intuitive, but unfortunately is a complete fallacy, for the following reason.

                                While analogue appears at first glance to be of infinite resolution, it is susceptible to noise which, by definition, is unpredictable. The amount of real information present in an analogue signal is fundamentally limited by the amount of noise that is present. Analogue may be considered infinite-resolution in the sense that the noise will average out over a long period of time. So, say, if you record a continuous analogue sine wave over a huge number of cycles, and then average all those cycles into a single cycle, the sine component will remain while the noise will average out. Doing this over an infinite length of time will remove the noise entirely, and I think this is what you are alluding to.

                                But, this is true of digital signals too -- if they have been properly dithered. This is, indeed, the very purpose of dither, because it means that quantisation noise will become, for all practical purposes, random noise. Just like in an analogue system. Because of this, dithered digital processing is infinite-resolution in the same sense as analogue processing. At the same time, it retains all of its other advantages over analogue, such as error-free storage and transmission, the ability to be processed any number of times without adding any distortion, etc etc. Analogue has literally no advantages over digital if the digital is done correctly.

                                Which leads me to my point regarding fixed vs floating point. In my view, both Paul and Datenwolf make correct assertions. Floating-point's advantage over fixed is that it means the programmer never needs to worry about clipping during mixing. No disputing that. The exponent will just grow as it needs to. And, since x86 processors have already paid the cost of the extra silicon required, floating-point isn't even slower than fixed-point on x86. Also true. But what I think has been missed is that floating-point cannot be linearised with dither, and 32-bit floating-point doesn't have enough resolution to that we can simply ignore the nonlinearity. If you sum, say, 256 24-bit signals into a 32-bit float you are going to lose approximately the bottom 8 bits of the precision present in the originals. And not in a benign way - it will be of truncating form and manifest as distortion. It is probably acceptable insofar as it is probably inaudible -- but a single instance of 32-bit floating-point quantisation distortion is eminently measurable at the 24-bit level (I have measured it), so 256 lots of this is a quite scary proposition in my view for anything purporting to be "high-end audio".

                                FWIW, this is also the reason that the majority of professional DSP engineers (or, at least, all the ones I've spoken to) think that converting fixed-point to floating-point with anything other than an exact power-of-two multiplication is a dreadful hack.


                                In the end, 32-bit floating-point is a risky proposition for precision audio purposes. It is very definitely unsuitable for certain types of laboratory environment, is probably fine for things which will only be listened to, but in my opinion is somewhere in between for recording/mixing/mastering purposes which need a little bit extra performance. 64-bit floating-point would be fine, because the distortion will be at a vanishing level, and possibly on x86 not even that slow. 32-bit fixed-point is generally great for audio, but Paul has raised a real case where it won't have sufficient headroom.

                                Comment

                                Working...
                                X