AVAudioSession category affects buffer size when charging iPad 5th Gen

We are building an app for iOS which must output audio in repsonse to the user's touch input. We noticed that if you connect the iPad 5th Gen with iOS 12 to a power source (computer or wall charger), then the touch to audio latency becomes enormous. After some digging, we see that the buffer for the render callback becomes 4096.


This remains true while the category is AVAudioSessionCategoryPlayback, but if we change it to AVAudioSessionCategoryPlayAndRecord, then our preferred IO duration of 256 is repsected whether or not is plugged into power.


We have not observed this with any other iPads. Anyone else experiencing this? Is this a bug?