Very late to the crackly iPhone party, but I thought I’d share my experience for people having similar issues (and seeing as this thread seems high up in Google’s search.)
I’m running an old iPhone 5c. The screen broke, so I replaced the screen, swapping the earpiece and camera out from my old one, and replacing the ropey old battery while I was in there. Put the phone back together and everything was working fine except for making calls where there’d be the most annoying static, crackling, modem noise. Sounded like it was badly grounded. Also I found that the phone would heat up excessively during calls (-only calls, not during any other processor-heavy task).
Tried a hard reset/restore but still had the same issue. I could receive calls fine on speaker phone but not through the earpiece speaker.
In a final act of desperation I removed the screen from the motherboard and unscrewed the metal earpiece assembly on the back of the new screen. While I was doing this I noticed that one of the thin insulating foam pads on the back of the proximity sensor ribbon cable had slipped/perished slightly and so it had been touching the back of the metal cage holding the earpiece in place. I cut a new square of electrical insulating tape to cover the exposed metal patch on the cable. I also noticed two exposed patches of metal behind the connectors on the two ends of the cable that connect this cable to the motherboard, so I cut tape to cover these too. I reassembled the phone and tested a call. Beautifully clear speech with no crackles and the phone stayed cool to the touch. Sweet!
This photo shows the cable as I initially found it, without the new insulating tape on. Above photo is the exposed metal that I believe was causing the main problem. Bottom photo shows the exposed metal on the back of the two motherboard connectors that I covered for good measure.