No signal

When I use Kodi on my MacMini with a Samsung 530 TV it is normally fine. However, sometimes, after some time, when I attempt to start Kodi using my Harmony remote I get a No Signal message. Eventually I have to restart the MacMini and when I do Kodi works OK again.

Any suggestions about what might be causing this? On one occasion when I wiggled the HDMI cable the signal recovered but that hasn’t happened again.