[haiku-development] Re: Considering the audio Mixer formats

  • From: Dario Casalinuovo <b.vitruvio@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sun, 7 Feb 2016 14:39:14 +0100


Yes, doing this from Cortex is not working currently. You could,
however, instanciate a separate mixer node from a C++ app. The Game Kit
used to do that, in order to mix its own sources and provide a single
output per app to the media kit. I removed this some years ago because
of problems with hybrid builds (instanciating a gcc2 mixer from a gcc4
compiled app didn't quite work).


Here the problem is common pratically among all nodes, and due to a design
problem. Basically what happens is that there are two places to handle the
connection / disconnection events. To be more clear, usually the connection
is handled for some aspects outside the node from the controller class,
this work perfectly when the node owner want to connect to some node, but
it's not working when someone is asking it from the extern. The media_kit
doesn't try to enforce any way to do it implicitly unfortunately.

This is something I'm taking into account for future API of course. In the
meantime I hope to get the time to finalize the BMediaFilter class, so that
it can replace all custom code in our tree.


A plain float has only 24-bit for the mantissa, which is less than an
int32. It makes some math simpler as you don't have to worry about
overflows/clipping: just do a bunch of operations, and when you're done,
normalize to fit the required -1:1 range.


I think bit precision is not the only thing to take into account,
especially for audio, floats are more complete numerically. There are less
holes between numbers. Over 16 bit, the difference in listening is hardly
noticeable (well, maybe if your name is Paganini), over 24 bit it's
pratically impossible for human ears. Once this limit is reached, we can't
do much for quality itself, but I can imagine when doing lot of calculus
the properties of float are more appreciated. Additionally from what I can
see it looks like modern machines are handling double at least fast as
float, that leave any doubt on where's going the audio processing.

Other related posts: