NextPVR Forums

Full Version: Notifications on failure
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So, I go away for a month.
Sometime during this, the PC goes into recalcitrant mode, and I start getting the following error on every recording:
Code:
Failed to start device: 0x8007000e
. It looks for a second device, which gives the same error.
Clearly the driver is being stupid, and this problem is fixed with a reboot.

My question: does anyone have a means to detect this, and say, send an email?
I could arrange for the PC to be rebooted, but I have to know about it.

Cheers
Would an automagic daily reboot help?

http://answers.microsoft.com/en-us/windo...5ce2647148
Microsoft's devcon can reports status of a device.
Blat is a commandline emailer that can send a text file (output of above?)
Devcon can also reset a device or reboot the PC.

I email a devcon status report to a pvr gmail address each wakeup and keep my eyes open for an error.

PS Grahams daily reboot is a good idea, I have to reboot one machine every 2 or 3 weeks to brings its internal USB tuner back to life. (seemingly down to VIA chipset on motherboard with hauppauge tuner)

PPS if you are good at batch/cmd files (unlike me) it should be possible to only email if "error" is detected in the output of devcon.
I found a daily reboot prevented a range of Windows and NextPVR problems some of which could take several weeks to appear. I do it after the EPG update as long as NextPVR is not recording.

Chris
jcjefferies Wrote:I do it after the EPG update as long as NextPVR is not recording.

Chris
Can you share the script that does the check-for-record-status? Smile Sounds like a good thing to have in the EPG update script!
This is my PostUpdateEPG.bat file which must go in the "Scripts" directory. If NextPVR "isinuse" it waits 60 seconds and tries again until it is "Not Recording". I don't think I actually do many recordings in the early hours but its sods law that without the script it would reboot in the middle of some important recording!

echo off
REM Reboot if not recording
set NSHelper=c:\"program files"\npvr\nscripthelper.exe

:check
FOR /F "tokens=*" %%i in ('%NSHelper% -isinuse') do SET condition=%%i
echo %condition%
IF %condition% =="NOT RECORDING" goto reboot

:delay
sleep 60
goto check

:reboot

echo "About to reboot"
shutdown /r


Another option is to install Power Triggers which can be set to stop/start/restart specific devices or services before the computer sleeps or after it wakes. My server had a Nvidia network card which sometimes could not see the NextPVR client after wakeup but restarting it after wakeup cured the problem.

Chris
Awesome! Thanks for that. I think I'll be adding that to my server. Smile

Edit: I had to change set NSHelper=c:\"program files"\npvr\nscripthelper.exe
to: set NSHelper=c:\"program files (x86)"\npvr\nscripthelper.exe

because I'm running 64-bit Win 7.

The system rebooted quite nicely. Smile

Is there an easy way to also detect if Comskip is running? It would be nice to not reboot until that's all done as well.
HarryH3 Wrote:Awesome! Thanks for that. I think I'll be adding that to my server. Smile

Edit: I had to change set NSHelper=c:\"program files"\npvr\nscripthelper.exe
to: set NSHelper=c:\"program files (x86)"\npvr\nscripthelper.exe

because I'm running 64-bit Win 7.

The system rebooted quite nicely. Smile

Is there an easy way to also detect if Comskip is running? It would be nice to not reboot until that's all done as well.
Or if PostProcessing is running?
OK, thanks for all the suggestions/scripts.
I will work on this basis, as it appears to be the collective wisdom.
How about adding something like this to see if a particular application is running to check if its safe to reboot?

tasklist /FI "IMAGENAME eq your_app.exe" | find /i "your_app.exe"

IF ERRORLEVEL 2 GOTO app_is_running
IF ERRORLEVEL 1 GOTO app_not_running


Chris