Play music without monitor/TV


I have a Raspberry PI3 with latest OSMC and have been using it to watch movies/TV by connecting it to my television that supports CEC via HDMI. Therefore the television switches on and off automatically whenever I select a movie via my mobile phone on which I have installed Kore.

Now I want to connect a soundbar (Canton DM 55) directly via optical link to the raspberry PI3. The reason I dont want it to be connected to the television, is that when I select to listen to music via Kore, I dont want the television to turn on automatically, so Kodi should not send a signal via CEC whenever it starts to play music.
Therefore instead Kodi should output the audio directly to the soundbar, and this is the case for all medias, while Kodi should only signal to turn on the television via CEC when a movie/video is played.

Is there a way to achieve this?

Hi, ah your on the wrong forum. Head over to
Your question is more or less a KODI thingy,
Didn’t know that the Pi3had an optical digital output. off the quick
Look in Settings - System - Audio output. You’ll see what I mean.

Hello again,

After reading some more I found the following two interesting threads regarding this topic:

Does anyone know how I can rewrite those pythong scripts to only switch on the tv when video is played? And where do I have to store such a python script? I was thinking the following script would suffice:

import xbmc,xbmcgui

if xmbc.getCondVisibility('Player.HasVideo'):
    print '===TRUE==='

Thanks in advance

Sorry for bumping this thread. But nobody knows how to solve this?