I've managed to fix partially the problem or at least I can narrow it down. So , if I override all my other audio lines via hdajackretask module and only enable the headphone one, the sound is perfect. What happens though when I turn back on the line for the Internal speakers , it goes back to crackling and popping in the internal speakers and headphones. So basically this allows the user to use EITHER internal speakers OR headphones , NOT both.
I've managed to fix partially the problem or at least I can narrow it down. So , if I override all my other audio lines via hdajackretask module and only enable the headphone one, the sound is perfect. What happens though when I turn back on the line for the Internal speakers , it goes back to crackling and popping in the internal speakers and headphones. So basically this allows the user to use EITHER internal speakers OR headphones , NOT both.