hi,
does anyone have guidance on adding an IOAudioPort object correctly to the
engine?
right now, what i am doing is similar to how i create+add a control to the
device:
> port = IOAudioPort::withAttributes(subtype, nameinIOREG);
> object = IOAudio{Toggle,Level,Selector}Control::create(args);
> device->addDefaultAudioControls(object)
> port->addAudioControl(object);
> object->release();
but the problem begins with the following, and necessary call:
> device->attachAudioPort(port, <parent>, <child>);
while the documentation says the parent and child can be NULL, it seems that
these two parameters are more important than that.
i’ve tried setting the parent to the engine that i have created these controls
for, i.e:
> device->attachAudioPort(port, engine, NULL);
or even the device:
> device->attachAudioPort(port, device, NULL);
but i don’t think that’s correct.
i’ve checked out the AppleAC97Audio driver code
(https://github.com/apple-oss-distributions/AppleAC97Audio/search?q=attachaudioport)
and it does help; it suggests when the port is for “input”, we add the engine
as a child. but when it is for output, we add it as a parent.
-however this driver is old and they’re using one engine for either an
input or output. i think that’s a little too much.
but it adds a port without attaching controls!
-there is no call to addaudiocontrol in this driver!:
https://github.com/apple-oss-distributions/AppleAC97Audio/search?q=addaudiocontrol
ports seem extremely helpful for engines that have more than just a simple set
of controls.
i think APPUL was thinking ahead but expected, when someone got to this point,
they would be able to help.
unfortunately APPUL of 04 is not the APPUL of 2023 and there is probably little
they can do.
i will add: i am quite surprised the mailing list archives haven’t addressed
this topic. it would be helpful if we can get a solid discussion going.
questions:
1. what is the best way to attach an audio port?
-personal experience of getting panics from attaching a port prior to
the engine activating suggests we add it after activation.
2. is an audioport effective without adding any controls to the port?
-if so, how come?
-if not, then why did this AC97 driver seemingly add ports without
attaching controls? maybe as a helpful example for someone like myself?
thank you in advance.
Thanks,
Gagan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/coreaudio-api/archive%40mail-archive.com
This email sent to [email protected]