Also check the ground points and make sure they're not corroded or oxidized.
Sent from my Pixel using Tapatalk
As an aside, I had no battery or electrical issues, but my speakers would pop when I turned on the car. It turned out my batter was 11 years old when I replaced it. Solved the crackling issues. I think the E46 is particularly sensitive to battery voltage fluctuations from all the stories I've heard, and anything outside of the optimum range causes weird electrical issues.