This comment is misleading as the 2015, 2016 and 2017 MacBook Pros can be upgraded in terms of SSD storage, but not RAM. Update (08/21/2020): I give up!!!
I had the intermittent crackling/scratching noise on one of my earpieces. After taking apart, I’ve found a small potentiometer that when tapped, made the sound go away. I’ve given it a tiny turn and the cracking has now gone away. I believe this pot is wearing out and causes the scratching type issue. It makes sense as the noise is similar to a worn out pot on a hifi.