I'm sorry but I have no idea how to exit the nano editor. The green cursor is now at the end of:
File Name to Write: /storage/.coinfig/sleep.d/99-toggle_rate.power <cursor here
I'm sorry but I have no idea how to exit the nano editor. The green cursor is now at the end of:
File Name to Write: /storage/.coinfig/sleep.d/99-toggle_rate.power <cursor here
Confirm the file name (you don't want to change the filename) by pressing ENTER. That's it.
That worked. I opened the file again to check and the changes were there. ☺
I turned off (suspend) my Intel NUC and turned it back on but NO AUDIO
Oh well - back to the drawing board
Thanks for the help
Perhaps you should try to reboot and then check again.
Yes, I did that. Still no audio until I manually toggle the refresh rate. Maybe something else in the script is outdated or need a tweak.
Note: If I'm watching TV and switch to Libreelec, then audio is always working.
Perhaps you could try this from SSH console:
1) make sure your current script is executable:
2) test after resume from suspend if your script works:
3) if it works as expected, create the service which should run your script after resume from suspend:
cat >/storage/.config/system.d/kodiresume.service <<'EOF'
[Unit]
Description=Kodi actions for resuming from suspend
After=suspend.target
Requires=kodi.target
[Service]
Type=oneshot
ExecStart=/bin/sh -c "exec sh /storage/.config/sleep.d/99-toggle_rate.power post"
[Install]
WantedBy=suspend.target
EOF
Display More
4) enable the service and test if it works:
I am not sure if it's error free but can't test it in my (different) environment completely. So it's up to you.
Can I cut and paste #3 & 4 or does each line get entered separately ?
I ran #1 and 2 and got this:
warning: output HDMI-1 not found, ignoring
warning: output HDMI-1 not found, ignoring
Should I change it back to HDMI1 ?
OK, so edit the /storage/.config/sleep.d/99-toggle_rate.power script to it's original form ( to have HDMI1 there) and continue with steps 3 - 4, each block separately (select all lines in each block 3 - 4) copy & paste to SSH console.
OK - I ran #3 and then #4
Here's the response from #4:
Created symlink /storage/.config/system.d/suspend.target.wants/kodiresume.servic
e - /storage/.config/system.d/kodiresume.service.
Is that the correct response ?
I think so.
Then test with suspend / resume.
In every case, this must work when run manually (to restore audio after resume):
/storage/.config/sleep.d/99-toggle_rate.power post
I have audio after resume now but I'll know tomorrow for sure. Thanks so much for all your help ghtester !
You are welcome!
Update: I turned on my Intel NUC tonight and NO AUDIO. I ran the script mentioned in post #29 and the screen blinked and the audio returned. I wonder why the script didn't work when I fired up the NUC from resume ? Is it possible to add a delay to the script - maybe 5 seconds or more ?
If not, is it possible to run this script with a button on my remote ? (Harmony 665)
Yes, try to edit the script to this form:
#!/bin/sh
case "$1" in
post)
sleep 5
xrandr -display :0 --output HDMI1 --mode 1920x1080 --rate 59.94
sleep 5
xrandr -display :0 --output HDMI1 --mode 1920x1080 --rate 60
;;
esac
It's also possible to run the script by Remote Control but it needs some more configuration.
At first, try to run the irw command in SSH console, then push your favorite button(s) on Remote Control and put a response(s) here (if any).
Exit from irw by pushing CTRL+C.
In case there were no responses, the preferred key needs to be mapped first so it would need even more tasks to do... Then try to run this command and put a response here: cat /storage/.config/rc_maps.cfg
Let me know results and then I could tell you more.
I added the 5 + 5 second delay using nano and saved it. I tested it this morning. It came on with no sound and then the screen blinked and sound was there ☺
If this continues to work, I may experiment with smaller delays.
Thanks again for the help. I'll update this thread if necessary.
Update: I changed the delay to 2 + 2 seconds and it still works flawlessly every time.
blueribb Are you only using /storage/.config/sleep.d/99-toggle_rate.power or is the service still installed?
If yes, it is possible the script is twice. You can verify this by adding a echo Power_script and checking with journalctl|grep Power_script afterwaers.