Hi all. I want to share my experience with the community.
If you are like me, you probably need to automatic stop playback (or pause) when your tv is off.
Usually i need because i watch kodi before i sleep, my tv turn automatically off, but playback will continue. If i was watching a tv series or a movie it’s not a big problem, but if’m watching TV (with pvr addon), it will never stop and continue playing overnight (and day after too), until i turn on my tv. Not the best i think.
So i found an old option in KODI (missing in osmc), that work with CEC. You can tell Kodi when your TV is off and it stop (or pause) playback.
To activate this option i needed to modify peripherals.xml file. The only problem is that we will lose this MOD on OSMC update, so i ask @sam_nazarko if we can make this modification permanent, inside an update or simply preventing update to overwrite.
I’m going to write exact procedure for those who need.
Assuming we’re in SSH session we do following:
sudo nano /usr/share/kodi/system/peripherals.xml
find line setting key=“standby_pc_on_tv_standby” type=“enum” value=“13011” label=“36029” order=“8” lvalues=“36028|13005|13011”
and add at the end 36043 and 36044 , resulting this: setting key=“standby_pc_on_tv_standby” type=“enum” value=“13011” label=“36029” order=“8” lvalues=“36028|13005|13011|36043|36044”
Save, exit from nano, restart kodi with: sudo systemctl stop mediacenter then sudo systemctl start mediacenter
When Kodi starts we have to go in settings, system, input devices, peripherals, CEC adapter. Here we find option named “When the TV is switched off”, and we can finally choose to stop or pause playback.
I hope this will help community, and i hope @sam_nazarko will make this permanent.
There’s a PR open to reinstate this behaviour; but I haven’t looked at it yet as I wanted to make sure it merged cleanly for all devices. I will try and get this included by default in the next update.
To ensure your changes are applied correctly and consistently it is best to stop kodi before editing the file and start it after the file is saved, rather than restarting after the edit as Kodi has a habit of writing to files during it’s stop process.
To be safe the order should be:
sudo systemctl stop mediacenter sudo nano /usr/share/kodi/system/peripherals.xml
change the appropriate line Ctrl+O, Ctrl+X sudo systemctl start mediacenter
If you’ll follow my how-to an option will appear in the GUI. Anyway at the end of my first post i ask @sam_nazarko if it could make this permanent, obviously without the need of entering ssh and doing this procedure. Sam told he was already working on it and probably he will include as default in next update.