AVAudioSession input gain not working

In our app we do live streaming and have audio input from the user. We have also added a stepper that allows user to increase input gain for the microphone using AVAudioSession, like so:

let audioSession = AVAudioSession.sharedInstance()     if audioSession.isInputGainSettable {       do {         let success: () = try audioSession.setInputGain(gain)       } catch {         print("error setting input gain")       }     }

And this works fine on my iPad Pro 11 (2nd generation). However, upon further testing it seems we noticed that on our 4 iPads, works on 2 ( both 2nd generation ) but it does not work on other 2 ( both 3rd generation ).

The thing that is strange is that input gain is set correctly on all 4 devices, isInputGainSettable is true and the function setInputGain returns success, but on these 2 devices there are no changes in the audio input volume.

Does anyone know why something like this would happen?

AVAudioSession input gain not working
 
 
Q