AVAudioSession category is set to playback when communication role is set.
When audio is set active in audiounit_ios.m the category is changed to AVAudioSessionCategoryPlayback
and the mode is set to AVAudioSessionModeMoviePlayback
See: https://code.videolan.org/videolan/vlc/-/blob/master/modules/audio_output/audiounit_ios.m#L400
When the MediaPlayer role is set to communication it is more likely the user would like to use AVAudioSessionCategoryPlayAndRecord
.
Suggest adding a couple structs and getters, mode2category and mode2avMode, similar to:
https://code.videolan.org/videolan/vlc/-/blob/master/modules/audio_output/audiounit_ios.m#L365
that sets the category to AVAudioSessionCategoryPlayAndRecord
and the mode to AVAudioSessionModeVoiceChat
if the media player has the communication role.