Jump to content

DVBViewer prevents Vista shutdown "AllowShutdown"(Plugin)


clovek1

Recommended Posts

the DVBViewer v4.0 prevents my Vista x64 from shutting down (if the DVBViewer wasn't closed manually before).

this is quite annoying, as i use a dedicated HTPC and want to control it only with a remote control, instead of keyboard and mouse.

when the DVBViewer is closed manually, the Vista shuts down without complaining.

 

any suggestions how to force DVBViewer to close automatically on shutdown, or how to force Vista to close DVBViewer automatically on shutdown ?

Link to comment
  • 2 weeks later...
  • 3 weeks later...

This is by design, it won't be changed, and there are reasons for it.

 

One of them is: If the user triggers shutdown, but DVBViewer refuses (due to an ongoing recording or whatever), Windows may offer to close DVBViewer forcefully. If the user agrees, it would prevent DVBViewer from finishing everything properly. Some DVB devices resp. drivers don't like it at all if the DVB application suddenly disappears without saying goodbye, and take bloody revenge ;)

Link to comment
  • 1 year later...

"...due to an ongoing recording or whatever..."

 

Well, DVBViewer is preventing my XP to shutdown even with no recording ongoing... I find it a bit annoying as I usually have DVDViewer minimized/tray and sometimes in hurry I just select windows shutdown option and turn monitor off without even waiting to see if it is shutting down... then I need to get back, turn on monitor, close DVBViewer and shutdown again... ;)

 

Does DVBViewer prevent Windows shutdown always and not only during recording?? If yes... and if that is not a bug... no way such feature can be optional?

Link to comment
  • 3 months later...

Sorry to bump this topic but I'm really getting annoyed with this "feature" on DVBViewer... I do have DVBViewer running at startup automatically (minimized/systray) as I explained on my topic above and I do need to always close it manually to be able shutdown XP... this is no sense...

 

I did already made sure no recordings are ongoing or even scheduled at all... I did also looked at all the DVBViewer options trying to find one that could eventually turn on this shutdown prevention, but I can't really find anything... and I can still reproduce the problem with the very latest beta version.

 

Please at least tell me if this unconditional Windows shutdown prevention is really "by design" or just a bug?

Link to comment

"...due to an ongoing recording or whatever..."

 

Well, DVBViewer is preventing my XP to shutdown even with no recording ongoing... I find it a bit annoying as I usually have DVDViewer minimized/tray and sometimes in hurry I just select windows shutdown option and turn monitor off without even waiting to see if it is shutting down... then I need to get back, turn on monitor, close DVBViewer and shutdown again... ;)

 

Does DVBViewer prevent Windows shutdown always and not only during recording?? If yes... and if that is not a bug... no way such feature can be optional?

If it annoys you that much why dont you fix it by making a script which delays the shutdown, so there is time to shutdown minimized DVBViewer and then continue the system shutdown...everything is done fully automated. On WinXP such a solution would work great.

Link to comment

majstang: I'm not sure what type of script you refer to but you did give me an idea... I may do a small app to run in background and when it receives the windows shutdown message just close DVBViewer... the only disadvantage would be needing to have +1 process running just for that task, however I think I will really do it anyway if no other solution as I'm really getting annoyed with this every day I shutdown Windows...

 

Tjod: Thank you for your reply, if this is "by design" then this topic is on wrong forum and I think you can move it to suggestions, my suggestion is: please add an option (or at least a tweak setting in setup.xml...) to enable or disable this unconditional shutdown prevention, and when disabled still prevent shutdown but only when recording is ongoing.

Link to comment

majstang: I'm not sure what type of script you refer to but you did give me an idea... I may do a small app to run in background and when it receives the windows shutdown message just close DVBViewer... the only disadvantage would be needing to have +1 process running just for that task, however I think I will really do it anyway if no other solution as I'm really getting annoyed with this every day I shutdown Windows...

Im refering to this OnMessage script:

 

#NoTrayIcon
#Persistent
SetTimer, RunBeforeShutdown, Off
DllCall("kernel32.dll\SetProcessShutdownParameters", UInt, 0x4FF, UInt, 0)
OnMessage(0x11, "WM_QUERYENDSESSION")
Return

WM_QUERYENDSESSION(wParam, lParam)
 {
   static sdtry = 0
   ENDSESSION_Logoff = 0x80000000
   If (lParam & ENDSESSION_Logoff) ; User is logging off.
     EventType = Logoff
   Else     ; System is either shutting down or restarting. and
     EventType = Shutdown
   If (EventType = "Shutdown" and sdtry = 0){
     sdtry = 1
     SetTimer, RunBeforeShutdown, On
     Return false ; Tell the OS to Abort the Shutdown/Logoff.
   }
   Else If (EventType = "Shutdown" and sdtry = 1)
     Return true
 }


runBeforeShutdown:
 SetTimer, RunBeforeShutdown, Off
 ;-------your code below gets executed before allowing shutdown to continue
 Process, Close, DVBViewer.exe
 ;-------
 Shutdown, 1 ; your choice what to do
 ExitApp
Return

 

It intercepts your restart/shutdown and closes DVBViewer before continue the shutdown. It is a Autohotkey script and you need to install Autohotkey for it to work. Copy the code and create a file named for example Intercept Shutdown.ahk. Compile it to an .exe (rightclick on .ahk file and choose Compile). Place the .exe in autostart and execute the file. It now runs persistent in background ready and waiting for the shutdown command to come and then intercept it.

Drawback is the script will intercept restart as well and when script continues after killing off DVBViewer shutdown is the choosen option (HTPC will always shutdown). If you for some reason wanna restart HTPC while system is still running, kill the Intercept Shutdown.exe with taskmanager before restart HTPC. There is of course a way to deal with this drawback as well, but since restart while system is running is a quite rare occurrence, manually closing the script will do.

 

Regards

majstang

Link to comment
  • 1 month later...

Not wanting to despise your work in any way majstang, I did found an easier way to "fix" this, not needing an extra process running for the script and allowing normal windows shutdown/restart... I did made a very small plugin that overrides DVBViewer windowproc to handle WM_QueryEndSession message and always replies as allowing it...

 

Now to be perfect I'm searching for a way to identify if there is an ongoing recording on DVBViewer and only on that case refuse shutdown/restart/etc... if anyone have an idea on how to do that please let me know...

 

Anyway if the plugin can be useful to anyone else I'm attaching it (including source code) to this post.

AllowShutdown.zip

Link to comment

No, worries! Nice work there yourself :biggrin: Well, when you know what you want...it is best to do it yourself. Devs are certainly not going to help out as long as it is XP issues on the table. Seems they have left us out to dry. http://www.DVBViewer.tv/forum/topic/41769-cant-hibernate-while-DVBViewer-client-running/page__view__findpost__p__312511

 

There are several ways to identify if there is an ongoing recording or not. It depends though if you are using only DVBViewer or Recording Service. If DVBV COM interface query is the best way to go. If RS you can query the WEB API. You will find everything you need in the Scripting Lounge/COM

http://www.DVBViewer.tv/forum/forum/40-scripting-lounge-com-deen/

Link to comment

Thank you, I will look at DVBV COM interface :)

 

Also this doesn't appear to be just a XP "problem", if you look at 1st post in this thread clovek1 reported same problem with Vista... I bet it "affects" any OS... and according Tjod's post it's not a problem but a feature... just not good for the way I use DVBViewer... anyway that doesn't matter anymore as long as I can workaround it...

 

Btw, it's strange to see that feeling about XP as I guess many HTPC's still use XP, but... also I do still use XP as main OS and honestly don't plan to upgrade because I don't appreciate these new versions with huge/shiny graphics, detestable ribbons and most options hidden from user to avoid breaking the OS... but that is my personal taste...

Edited by nars
Link to comment

Small update, just added a question message asking if user wants to exit (i.e. allow terminate session) or not when ongoing recording and used better way to detect ongoing recordings (the way I did on last file will not work if internal script engine is disabled on DVBViewer).

AllowShutdown11.zip

Link to comment

Also this doesn't appear to be just a XP "problem", if you look at 1st post in this thread clovek1 reported same problem with Vista... I bet it "affects" any OS... and according Tjod's post it's not a problem but a feature... just not good for the way I use DVBViewer... anyway that doesn't matter anymore as long as I can workaround it...

To be fair, Yes! It is not just a XP problem. Developers has deliberately programmed DVBViewer to work like this and it is an awful decision. DVBViewer always replies FALSE when OS sends out the VM_QUERYENDSESSION message and DVBViewer therefor blocks the entire shutdown. As you said, the only situation this block would be useful would be if a recording is going on. I dont know what the the shutdown rule "block shutdown if a recording is due within x minutes" does really, cuz it sure does not work here either. DVBViewer blocks shutdown like crazy even if no recording is going on. Grigas explanation on why devs did make DVBViewer this way is probably accurate, but whatever they say there must be a way to block shutdown only if a recording is going on and gracefully close DVBViewer if no recording is going on when the operating system calls the VM_QUERYENDSESSION. Pretty basic stuff for a scripter and a programmer really. From what i've understand there have been a major discussion about this choice a long time ago in one of the german topics. Nowadays this discussion seem to be closed from devs side and not open for review, which seem to be hesitant standpoint. Yes maybe the DVB-device driver could take bloody revenge if being forcefully interrupted during system shutdown anno 2005 or even earlier, but how would these drivers behave today is the question im intrested in. Driver programmers has probably learnt one or two lessons since these days. My point is...one cant defend an old decision in absurdum if all base criterias for the old decision has changed over time. Reviewing and reassess things can be a good thing.

 

DVBViewer also suffers from other powermanagement issues...more precise how it handles standby/hibernation on WinXP and I suspect these issues wont ever get solved...when one of the main programmers expresses his foundness for XP in such a way ;)

 

Btw, it's strange to see that feeling about XP as I guess many HTPC's still use XP, but... also I do still use XP as main OS and honestly don't plan to upgrade because I don't appreciate these new versions with huge/shiny graphics, detestable ribbons and most options hidden from user to avoid breaking the OS... but that is my personal taste...

Yes, i know :P XP equals Freedom. I like to make scripts and any other OS than XP when doing that is unthinkable, but my main reason for not upgrading is a buzzing sound over HDMI on Windows 7 which i dont have on WinXP.

Link to comment
  • 2 months later...

Small update, just added a question message asking if user wants to exit (i.e. allow terminate session) or not when ongoing recording and used better way to detect ongoing recordings (the way I did on last file will not work if internal script engine is disabled on DVBViewer).

Hello nars,

please tell me what i have to do with the 2 files in the zip.

Most times my htpc (with vista 32) do not go in standby with clothing DVBViewer. I tried also the plugin closedvbv_1.03, but htpc hangs at standby as befeore.

 

I think, that is no "feature", it is bullshit. :mad:

Hope, your files will solve it.

 

LG,

grobiralf

Link to comment

Hi, You only need to copy the .dll file to your DVBViewer plugins folder (default: C:\Program Files\DVBViewer\Plugins) and start/restart DVBViewer. You don't need the .dpr file, it is the source code.

Link to comment

hi back,

 

thanks for answering.

 

What settings you chose in DVBViewer-options for ending DVBViewer?

Nothing, Standby, Shutdown...

 

Please tell me -all- your settings for the the options ENDING-DVBViewer (maybe it is an other name in english.)

 

I am using DVBViewer 4.2.1

 

LG,

grobiralf

Link to comment

I have on exit set to "Close DVBViewer", anyway that is not related... these settings control what happens when you close DVBViewer, not what DVBViewer should do when you shutdown Windows... the only function of my plugin is to allow we do Windows shutdown (not using any DVBViewer functions, i.e. doing Start -> Shut Down) having DVBViewer running so that we don't need to close it manually before attempting to do shutdown.

Link to comment

Hi,

have copied the dll in /plugins.

Problem stays as before: Sometimes htpc goes normal in Standby. Sometimes PC seems to go down, but fans still roll and htpc hangs.

 

Couse many people tell about this problem, i think it is a DVBViewer-problem and not an os-problem or a pc-problem.

And if it is a dvb-problem, i can not understand, why the developers ignore it.

 

Bye,

grobiralf

Edited by grobiralf
Link to comment

I think your problem is not really the same I had, if I can understand you are not even trying to shutdown windows but standby (S3), in that case my plugin will do nothing at all really... and the problem may be related to a lot of things (usually drivers)... standby is many times problematic... why don't you use hibernation instead? It's also safer in case there is some power shortage during "standby".

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...