Page 3 of 4

Re: [App] libSoftPowerOff K

Posted: Mon Feb 04, 2019 9:35 am
by setti
Thanks! I dont record via tv anyway. Im having a tvheadend server for that purpose.

We just need a method now on soft powering on, to check if dvbcam is running or crashed, while lcd was off.

Re: [App] libSoftPowerOff K

Posted: Mon Feb 04, 2019 10:36 am
by zoelechat
You gave me doubt, I had to hardly review and understand my code :D
With new condition, it's "monitoring" soft power on, the while loop is endless as long as you don't use script stop case or manually kill oscam. It used to restart dvbcam in case of crash, and now it additionally waits for screen to be on.
Well, just try and tell if you're still awaken during night ;)

Re: [App] libSoftPowerOff K

Posted: Mon Feb 04, 2019 10:50 am
by zoelechat
If you want to hurry try, you can do it like this:
- Put TV in soft off state
- Using old script, "killall dvbcam", screen should go on
- Do same with new script, screen should stay off :)

Re: [App] libSoftPowerOff K

Posted: Mon Feb 04, 2019 11:33 am
by setti
zoelechat wrote: Mon Feb 04, 2019 10:36 am You gave me doubt, I had to hardly review and understand my code :D
With new condition, it's "monitoring" soft power on, the while loop is endless as long as you don't use script stop case or manually kill oscam. It used to restart dvbcam in case of crash, and now it additionally waits for screen to be on.
Well, just try and tell if you're still awaken during night ;)
Ahhh, you're right. I forgot the endless while loop.
Although, sometimes dvbcam stops and it does not autorestart. My wife just complained, that she couldnt watch the Kardashians :lol:

I will have a closer look, if it happens again.

Re: [App] libSoftPowerOff K

Posted: Mon Feb 04, 2019 11:41 am
by zoelechat
Maybe you can increase sleep time from 1 to say 5, it will prevent too much "hammering" and give it more time to restart properly, just in case. Also don't forget while loop ends if oscam itself exits for some reason (crash too? Would be annoying since its pid is script started flag).

Re: [App] libSoftPowerOff K

Posted: Wed Sep 08, 2021 9:45 am
by setti
Is it possible to add the options CMD_ON and CMD_OFF like on D/E/F/H version of this lib?
I want to execute some scripts when TV powers on/off.
Something like

Code: Select all

OPTIONS="CMD_ON:/opt/storage/usb/sda1/SamyGO/usr/local/bin/onPowerOn.sh CMD_OFF:/opt/storage/usb/sda1/SamyGO/usr/local/bin/onPowerOff.sh"
samyGOso -n org.volt.lwframework -r -l $SODIR/libSoftPowerOff.so --args $OPTIONS
is not working :-(

Re: [App] libSoftPowerOff K

Posted: Wed Sep 08, 2021 10:10 am
by zoelechat
Simply not possible because several processes are injected, which ones depending on user, some are app some are root. Scripts would be executed random times with random rights. And no need to ask changes to 5 years old stuff, I forgot everything :D
Though I can look for some "screen off flag" you could monitor by yourself from script maybe...

Re: [App] libSoftPowerOff K

Posted: Wed Sep 08, 2021 10:35 am
by setti
Thanks for your answer. Maybe you can attach the sources for the lib and I will implement what I need by myself.

Re: [App] libSoftPowerOff K

Posted: Wed Sep 08, 2021 10:47 am
by zoelechat
Sure. I thought sources were there already :)

ps: vconf.h you can easily find on the web

Re: [App] libSoftPowerOff K

Posted: Wed Sep 08, 2021 2:02 pm
by setti
Thanks, successfully compiled and injected. Will have a look to modify it to my needs.