compile option: hard/soft headphone port policy
there's the use case of using the badge as a realtime voice modulator with an external mic and built in speakers. most small microphone capsules are dynamic and require phantom power, so at the moment they need* to be plugged into the headphone port to output signal: flow3r-hardware#6
however this clashes with the strict headphone port policy we have set in place where if anything is plugged into the headphone port the speakers are muted. we think this is in general a good policy and would like to stick to it and try to find a workaround.
the best solution we came up with is the following:
- add special api call for switching to speakers if a headset mic is detected. this is turned off by the os when leaving applications.
- users have to opt-in in the settings to allow this, else the api call is nop/returns false
- this option is only available if a build flag has been set that is normally off
point 3) is debatable, but we think the fact that applications can manipulate user settings at the moment would weaken the port policy to a degree that it couldn't be perfectly trusted anymore, and we'd like to be max trustworthiness the default here. speaking of which: that debugging api call that can write arbitrary data to the codec config should nop (always or only if it affects speaker/headphone output enable) if the flag in 3) is not set.
*there's a workaround by using partial badge link + special cable with built in R (or better, RCR) but that's inconvenient at best.