There are codec verbs that can be used to mute and unmute the amps as well as the entire codec widgets, so there is no need to implement the entire HID class and emulate mute tickle. I too have the "30sec delay" issue which always existed for me but I never knew the cause of jack sensing suddenly failing..
I can't wrap my head around it sadly as I have very little experience in coding IOKit stuff... all the codec verbs are defined long ago in linux hda-verb-0.3 .. it was used at some point to control HDA codecs in a matter we currently do.
So for EAPD update this had to be called from elevated terminal:
hda-verb /dev/snd/hwC0D0 0x14 SET_EAPD_BTLENABLE 2
Where:
- hwCOD0 = codec address
- 0x14 = output (speaker) node
- SET_EAPD_BTLENABLE = the command verb 0x70c
- 2 = PCM parameter 0x02
So it ends up sending 0x01470c02 to the codec.. looks familiar, doesn't it ?
Take a look at the sources of hda-verb, maybe you can come up with more elegant solution.
Also, please consider removing the IOLog outputs (make them debug only) from your kext, the amount of text it spits out is just ridiculous for a kext that simple. Your human-readable copyright is more than enough, we have ton of kexts that want to shine copyright IOLog messages at boot that it's just getting out of hands.. I don't want to know (and see) any of the stuff that is happening behind the curtains, make it just do the job and that's it .. same goes for BT uploader kext.