Actually, you just want to use the hardware controls that are given to you.
Only if you're dealing with a single signal. But say you got two 48kHz, 16bit/sample streams to a USB audio device. Those usually don't offer HW mixing, or even HW attenuation at all.
But you're right of course, and one of the ideas for KLANG, though not implemented yet, but on the urgent TODO list is to calculate a attenuation on the HW side that together with appropriate attenuation on the SW side leads to the desired output level with minimal precision loss on the routing side.
Then you need to make sure that the hardware scales the db linearly and not something insane like logarithmic.
dB are logarithmic by definition. Linear changes in dB map to logarithmic scaling on the HW side.
Additionally, it should handle the ever common mic +20db boost switch appropriately: when I turn up the recording volume of the mic, it should use the hardware volume to a point then enable the boost and adjust the hardware volume accordingly.
That sounds like a intersting idea, actually. Thanks for the input. However that +20dB amplifiers add noise. But I'll keep it in mind.
And how does that handle muting a user's total audio outputs when users are switched?
I really need to write down that design document...
Okay, in a quick writeup: Endpoints shall be grouped into containers, this is one of KLANG's extended features, to be seldomly used by regular processes. Some of these containers are implicit, other's explicit. In KLANG endpoints can only talk to endpoints within the same container. To cross the boundaries of a container bridges can be installed from the outside, that act like sort of a mirror to an outside endpoint, but with a twist: Additional routing controls can be inserted. Like for example a attenuation by -inf dB. When a session is created (and those should be put into containers, instead of messing with device ACLs, like ConsoleKit (now in systemd) do) a container can be created, that acts sort of like a "audio chroot". Upon session switch the signal lines to the outside world can be fully attenuated, hence stopping the audio from leaving the session container.
So you expect people to implement an RTP source/sink driver in the kernel?
You implement a RTS source/sink program in userspace. But this would be just another endpoint in the routing system. Not some sort of plugin hosted by a process. Well it could be, if the plugin opens its own FD and groups it with the existing endpoints FDs.
View all comments
Show parent comment
6
u/datenwolf Jul 31 '12
Only if you're dealing with a single signal. But say you got two 48kHz, 16bit/sample streams to a USB audio device. Those usually don't offer HW mixing, or even HW attenuation at all.
But you're right of course, and one of the ideas for KLANG, though not implemented yet, but on the urgent TODO list is to calculate a attenuation on the HW side that together with appropriate attenuation on the SW side leads to the desired output level with minimal precision loss on the routing side.
dB are logarithmic by definition. Linear changes in dB map to logarithmic scaling on the HW side.
That sounds like a intersting idea, actually. Thanks for the input. However that +20dB amplifiers add noise. But I'll keep it in mind.
I really need to write down that design document...
Okay, in a quick writeup: Endpoints shall be grouped into containers, this is one of KLANG's extended features, to be seldomly used by regular processes. Some of these containers are implicit, other's explicit. In KLANG endpoints can only talk to endpoints within the same container. To cross the boundaries of a container bridges can be installed from the outside, that act like sort of a mirror to an outside endpoint, but with a twist: Additional routing controls can be inserted. Like for example a attenuation by -inf dB. When a session is created (and those should be put into containers, instead of messing with device ACLs, like ConsoleKit (now in systemd) do) a container can be created, that acts sort of like a "audio chroot". Upon session switch the signal lines to the outside world can be fully attenuated, hence stopping the audio from leaving the session container.
You implement a RTS source/sink program in userspace. But this would be just another endpoint in the routing system. Not some sort of plugin hosted by a process. Well it could be, if the plugin opens its own FD and groups it with the existing endpoints FDs.