When this crackling happens on my computer, I have to restart the audio service. I copy-pasted a batch file together from several sources to do this automatically with elevated privileges. You just make a .txt file with the code in it, save it, and rename the .txt extension to .bat. Here is the code. Please, try to understand the code before using it so that you don't run something that is unsafe. I don't fully understand the code myself.
Here is the code:
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
) else ( goto gotAdmin )
Crackling is likely being caused by a loose connection that vibrates with audio.
Ensure that all audio connections are fully and firmly in place. Check any related power sources.
@ytupt...'s solution may work for his computer but the batch file would not be applicable to a Smart TV. The solution may be working because a computer component is getting warm or hot. The restart simply allows some time for cooling down just enough to work again, without crackling, until the component gets warm again.