NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public NextPVR Support Linux v
« Previous 1 2 3 4 5 … 34 Next »
Wake on suspend for recording

 
  • 1 Vote(s) - 5 Average
Wake on suspend for recording
flyingsubs
Offline

Member

Posts: 85
Threads: 14
Joined: Jun 2018
#1
2020-05-22, 08:34 PM
I ran a test where I scheduled a recording and then suspended my computer.  Is there any support or anyone know how to pull this off? Was thinking of have the server be on demand rather than on 24/7

Thanks!
Ben
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#2
2020-05-22, 08:40 PM
It'll wake Windows to record, but won't currently wake linux.

Windows made it pretty straight forward. Linux was a bit weak on this front.
flyingsubs
Offline

Member

Posts: 85
Threads: 14
Joined: Jun 2018
#3
2020-05-22, 08:48 PM
Yeah, I'm coming from a windows box. I've been interested in using linux more and figured this would be a good time to learn that.

That's disappointing from linux, but i'm assuming there aren't many usecases that need this.

Thanks for the response
flyingsubs
Offline

Member

Posts: 85
Threads: 14
Joined: Jun 2018
#4
2020-05-22, 08:54 PM
Best tool I found so far is rtcwake, but that would mean when you schedule you'd also need to fire a script with this. Also not sure if this needs sudo and it's reliability
flyingsubs
Offline

Member

Posts: 85
Threads: 14
Joined: Jun 2018
#5
2020-06-12, 03:33 PM
Code:
#!/bin/bash
#npvr Location
cd /var/opt/nextpvr

#Select the start time of scheduled recordings where only times greater than now
cmd="SELECT start_time FROM SCHEDULED_RECORDING WHERE start_time >= datetime('now')"
IFS=$'\n'
scheduled_recording_times=(`sqlite3 npvr.db3 "$cmd"`)

#sorts recording times by datetime
sorted_recorded_times=($(sort -n < <(printf '%s\n' "${scheduled_recording_times[@]}")))

# echo "${sorted_recorded_times[0]}"
# Converts recording time to local time
local_time=(`date --date 'TZ="UTC"'"${sorted_recorded_times[0]}""UTC -1 min"`)
# echo $local_time

#Converts format for rtcwake
rtc_format=`date -d "${local_time}" '+%Y-%m-%d %H:%M:%S'`
# echo $rtc_format

sudo rtcwake -m no --date $rtc_format
I really missed this feature and tried making a script to pull this off.  Not sure if this is something that makes sense to add to NPVR Sub, but I figured I'd post the code. My thought is to have a cron job run every 30 minutes, as well as find a way to run this script on start up.  Ideally it would make sense to run this after a new recording is scheduled.  Also if you are willing to incorporate it into NPVR the only other piece that is missing is to suspend the computer if it was woken from RTCwake as well as the server is idle.  For me I plan to just have the computer suspend after 30 minutes of inactivity which will be better but not perfect.

For the script, this uses rtcwake which is built in to most linux distros.  It navigates to the npvr database, finds the schedule recordings, sorts it and then grabs the next schedule recording,  the next few steps are formatting time and having rtc wake 1 minute before to make sure the computer doesn't miss any of the recordings.

Also open to ideas and improvements!  This is the first "code" I've ever submitted, but I think it should work!

Thanks!
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#6
2020-06-12, 08:34 PM
(2020-06-12, 03:33 PM)flyingsubs Wrote: the only other piece that is missing is to suspend the computer if it was woken from RTCwake as well as the server is idle.  For me I plan to just have the computer suspend after 30 minutes of inactivity which will be better but not perfect.
NextPVR has never suspended a computer. On Windows, it lets Windows and the user power management settings take care of this side of things, since NextPVR isn't going to have good visibility of what other things are happening on the machine. I'd expect this to be no different on Linux (ie, NextPVR is not going to know what the processes or jobs are running that shouldn't be interrupted)
Themalletmaker
Offline

Junior Member

United Kingdom
Posts: 8
Threads: 1
Joined: Jun 2020
#7
2021-01-26, 01:37 PM
Hi- Is there any chance this may be addressed in the future?  I was hoping to migrate from a windows environment to ubuntu but would consider a wake from suspend capability essential.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#8
2021-01-29, 07:30 PM
(2021-01-26, 01:37 PM)Themalletmaker Wrote: Hi- Is there any chance this may be addressed in the future?  I was hoping to migrate from a windows environment to ubuntu but would consider a wake from suspend capability essential.
It is on my list to revisit this.
ShadowMask
Offline

Member

Posts: 58
Threads: 3
Joined: Apr 2019
#9
2023-04-03, 01:51 PM
Hi,
I tried nextvr in libreelec again recently but nextpvr still does't seem to wake to record.

Is this still waiting to be revisited or do I need to set something else up other than just install and configure the service in libreelec?

Thanks
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,767
Threads: 954
Joined: May 2006
#10
2023-04-03, 02:24 PM
The function is not enabled by default under PVR->Power savings, but if you run the server in LibreElec or CoreElec then Kodi can set rtcwake but that is controlled by the sleep & wake capabilities of your PC, tuner etc. If it isn't working you would need to see if your PC can be controlled by /usr/bin/setupwakeup.sh

NextPVR itself doesn't have any Linux power management.

Martin
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): 1 2 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  Recording Plyback Timeline Issue JeffH 11 565 2025-01-17, 03:20 PM
Last Post: mvallevand
  Not Waking From Suspend dumfy 6 1,338 2024-12-04, 06:56 AM
Last Post: Evo_Evz
  NextPVR i.mjh.nz [Failed: Recording interrupted] Nzbaxterman 6 655 2024-10-29, 11:44 PM
Last Post: sub
Wink recording rules - nextpvr kfmf 4 682 2024-07-20, 08:50 AM
Last Post: kfmf
  Live stream not working while recording pciber 6 841 2024-06-10, 07:48 AM
Last Post: pciber
  Wake after Suspend issue with dvbt devices (LE12 Kodi 21) ShadowMask 41 4,377 2024-02-09, 07:11 AM
Last Post: ShadowMask
  Time scheduled radio recording? WagMan 8 995 2024-01-13, 05:34 PM
Last Post: mvallevand
  Recording length error VCR58 20 2,060 2023-11-12, 11:46 PM
Last Post: mvallevand
  Nextpvr Has Stopped Recording Mark_S 4 842 2023-05-28, 04:27 PM
Last Post: Mark_S
  Failed recording for a particular show spagio 9 1,385 2023-01-12, 12:46 AM
Last Post: mvallevand

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode