Issue sound via HDMI

Hi everyone,

I have some strange issue with my computer when I want to set up the sound on my tv. My setup is the following:

Motherboard: MSI Z170A GAMING PRO
Graphic card: MSI GeForce GTX 970 Gaming 4G - 4 Go
No sound card
Speakers connected to the rear
A screen connected in HDMI
A TV connected in DVI/HDMI (DVI is on the pc side, HDMI on the tv side).

When I want to watch videos from the PC on my TV, I change in the sound preference the output and I select HDMI. Sometimes, it happens the sound is not connecting to the tv, can’t determinate when and why. When it happens, I usually just put the pc in hibernation, restart it and the problem is solved. If it does not work, I use the following command and it can sometimes work:

pulseaudio -k
sudo alsa force-reload

But lately, none of this work, even after several reboot the sound is not coming out of the TV. If I boot on Windows, there is no problem at all, so I suppose the problem is on Ubuntu and it drives me nuts because I don’t understand what’s happening.

Any help would be welcome.