I've noticed that my audio only cuts out and sounds crackly with some TVs. For some reason, changing the resolution seems to fix the issue (at least for as long as I have my Steam Deck plugged in). This is with both the official dock and a cheap Anker dock.
Yup! It seems that switching the resolution is the key. For me, at least, the sound works fine on every other resolution switch. I usually switch it to something lower, then something else, then back to the resolution I want. It's pretty annoying, but it doesn't take too long and is way less annoying than crackling audio.