Okay, so I'm going to pop into this thread to just add two comments to this 3 years old thread.
1. This problem still exists.
2. I shared the same symptoms with most posters here, my work flow is record on PC, Edit on FCPX (Macbook)
In detail: Record with ffmpeg codec, advanced option, mkv auro remux to mp4, 4 audio tracks (Mic, PC Virtual Cable Output, HDMI, Composite Cable).
Converting the audio to a m4a (aac) file did work to remove the pop sounds, but I had a different issue where the audio have gone through a minor desync, enough to notice overtime. The solution to this was to not remux recording, going straight to mp4. What's interesting is that once I recorded directly to mp4, the audio popping issue also resolved.
I'm pretty sure all of this sound corruption is coming from the audio sampling method fcpx uses, which mostly like is making the remuxed audio to 23.97 fps and the video in 24 fps (original). I believe this is causing both audio popping and desync issue present in the program and the exported video. I've done a few tests and I can confirm, all audio track get's glitched with mkv -> mp4 recording, where the problem is nonexistent during straight to mp4 recording, both using ffmpeg.
I just find it baffling that no one else mentioned this easy fix. It doesn't make sense that ffmpeg would interfere with fcpx because ffmpeg is compatible with Mac. What's not compatible is mkv and it explains everything. I've also consulted an Mac expert on this issue and TLDR, while the problem can't be isolated, going through so many conversions is asking for trouble. The remuxing may be the source, but it could a compound issue.
Anyway, that's my report on the issue, I hope this helps anyone. I hope all y'all wont be discouraged from using ffmpeg, it's a godsend for editing.
Take Care.