The sound output only works if I use the headphone output, if I use HDMI it doesn't work.
not problem the TV or the cable.
n.b. the same cable connected to a raspberry works for audio.
Did you read whole thread? It clearly states, there is an issue with the linux driver on newer distirbutions, that effects, Raspberry pi also.
I have personally found, it seems to happen on 4k tv's, something to do with when it switches resolution on booting.