- Open raspberry pi config file.
sudo nano /boot/config.txt
2. Use the arrows and go to the end of the file and add this text.
#Always force HDMI output and enable HDMI sound
hdmi_force_hotplug=1
hdmi_drive=2
3. save with CTRL + O
4. Quit with CTRL + X
5. Reboot. Problem solved