My patch changes the buffer size of the "primary output", The primary output is used to play notification sounds phone ringing etc. Audio crackling appears exactly in this situations e.g. when the phone wakes up and plays a notification sound.Is that for sure?
AUDIO_OUTPUT_FLAG_DEEP_BUFFER is used in my android_device_sony_kitakami-common/audio/audio_policy_configuration.xml in this sector:
<mixPort name="deep_buffer" role="source" flags="AUDIO_OUTPUT_FLAG_DEEP_BUFFER"> <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" samplingRates="44100,48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> </mixPort>
The mixport "deep buffer" (that's the snippet you've pasted) is used in completely different situations i.e. when playing music through a music app.
Be aware, that my change increases the audio latency of the primary output.