AFAICS that is not what is happening here. The code is setting PulseAudio input map to be the ALSA map, while in reality it is format.m_channelLayout.

You should convert format.m_channelLayout to pa_channel_map, see https://gist.github.com/anssih/f4b6cd1ef73cb28e6cd5#file-gistfile1-cpp-L68 for example.