To set sound output to the HDMI port:
Code:
pactl set-card-profile 0 output:hdmi-stereo
To switch it back:
Code:
pactl set-card-profile 0 output:analog-stereo
Once the above has been done at least once, you can use the GUI
pavucontrol->configuration: Digital Stereo (HDMI) Output & Analogue Stereo Output to switch between the two.