Virtual Mixer app questions
Virtual Mixer app questions
- Subject: Virtual Mixer app questions
- From: "Alex Sheh" <email@hidden>
- Date: Fri, 7 Jul 2006 18:56:22 -0700
- Thread-topic: Virtual Mixer app questions
Hi All,
I’m maintaining a Virtual Mixer
application that is implemented via a shared memory segment containing matrix
mixer parameters, a GUI and a CoreAudio plugin. The Virtual Mixer can be set to
any target device, and when an application sends output to the Virtual Mixer
plugin, the audio is mixed and passed along to the target device.
The plugin instance registers an IOProc with the
actual target device, and this IOProc receives matrix mixer parameters,
calculates the crosspoint values, and multiplies this with the input buffer of
the target device to determine the output buffer of the target device. The
input buffer for the target device is the same buffer as the resulting output
buffer of the Virtual Mixer “device”; this is the output of the IOProc that the
app previously registered with the Virtual Mixer plugin “device” itself.
The problem with this design is that because each
application has its own plugin instance, the crosspoint value calculation and
multiplication is performed redundantly in all apps instead of once
globally. Also multiple IOProcs are registered with the single target hw
device (one for each application hosting the plugin), and as I understand this
is discouraged.
My questions are:
1) How “bad” is it to have
multiple IOProcs registered with a single target hw device. Is it just
less efficient or can it result in errors? I have noticed that
occasionally I will get a static noise coming out of the target device and I
need to reload my plugin in order to get rid of this static noise, not sure
whether it has to do with multiple IOProcs or some other bug in my code.
2) I
would like to emulate dedicated channel behavior where only one application can
play audio through each input bus channel of the Virtual Mixer at a time. To
determine whether an application is using channel N, I was thinking of examining
whether the input buffer element N is nonzero – however I’m not sure whether
checking for a nonzero value is sufficient (perhaps this value could drop to
zero even while the application was still using the channel in question).
Is there a better way to detect whether an application is sending audio to a
particular output bus?
3) I’ve just begun looking at Audio Units, and
I was wondering if these could address the redundant matrix calculation problem
– i.e. rather than registering an IOProc with the single target device for each
application that hosts the plugin, instead create an Audio Unit Source for each
app/plugin (as well as an Audio Unit Source for the target device’s external
input) and create a global Audio Unit Destination that takes these Audio Unit
Sources as input, does the matrix calculation and outputs the result directly to
target device. Does this sound appropriate?
4) Considering the
above goals of this Virtual Mixer, what would be a good architecture/design for
implementing this (when it comes time to refactor)? Would a kernel driver
be more appropriate or would it be difficult to act as an alias for another
target driver if the Virtual Mixer was a kernel driver?
Thanks for your
time,
Alex
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden