Search the forum for “ECP” you’ll find several discussions of this.
Basically the box sends itself a simulated remote keypress over TCP. Probably should make it less then five minutes since that’s the minimum time the Roku can be set for before the screensaver kicks in ( that’s the black screen you are seeing).
The minimum screen save time has been changed to one minute with the 6.1 firmware. I wonder how many channels using the ECP trick to disable the screen saver that will affect.
-JT
I searched ECP but all the posts are cryptic and hard to understand for me. If I only want to use this trick, is it pretty straightforward?
“renojim” wrote:
The minimum screen save time has been changed to one minute with the 6.1 firmware. I wonder how many channels using the ECP trick to disable the screen saver that will affect.-JT
I would guess every single one that the user sets it below 5 minutes. Of course Roku doesn’t let us access what that setting might be ( ifIcanHazFeature().screensavertime), so now we have a much higher possibility of annoying the user or making them think something was written wrong by the developer, because that was my reaction the first time I saw that black screen. I really wonder what pressing need there was to change that.
Komag - yes it’s very simple, get the box ip from devinfo, and urltransfer post from (empty) string to the address with the ECP command. if you go back far enough you’ll find a function posted by renojim(?) that I’ve been using.
Thanks, I think this is it:
viewtopic.php?f=34&t=55236
“renojim” wrote:
The minimum screen save time has been changed to one minute with the 6.1 firmware. I wonder how many channels using the ECP trick to disable the screen saver that will affect.-JT
One Minute? Why not set it to immediate screensaver? It wouldn’t be so much of a problem if the screensaver didn’t screw up some roScreen displays. Maybe they fixed that, but prior using a doublebuffered roscreen for a custom menu system if the screensaver turned on it’d destroy the graphics display you had up for our channels.
Some things that were shared on other threads. Don’t know what support the GetScreensaveTimeout has but it works on what I have
The undocumented roAppManager.GetScreensaverTimeout to get timeout values
and a function to send a message at the interval returned by the above function with a global timer should do it
Function channel_wake_up_box() As Void
l_utr = createObject( "roUrlTransfer" )
l_utr.SetUrl( "http://localhost:8060/keypress/Lit_+" )
l_utr.PostFromString( "" )
End Function
Ah, that script works great, no more black screen, nice!
I have it set to run every 45s
IF clock.TotalSeconds() >= ScrSav + 45
ScrSav = clock.TotalSeconds()
? "Resetting anti-screen-saver timer"
noSS()
END IF
then…
FUNCTION noSS() ' trig by Main(1) near bottom, every 45s
ipaddrs = CreateObject("roDeviceInfo").GetIPAddrs()
IF ipaddrs.eth0 <> invalid THEN ipaddr = ipaddrs.eth0
IF ipaddrs.eth1 <> invalid THEN ipaddr = ipaddrs.eth1
xfer = CreateObject("roURLTransfer")
url = "http://"+ipaddr+":8060/keypress/InstantReplay"
xfer.SetUrl(url)
xfer.PostFromString("")
END FUNCTION
“Komag” wrote:
Ah, that script works great, no more black screen, nice!I have it set to run every 45s
Out of curiosity, why do you need to prevent the screensaver? In general, this is a bad practice, unless you have a very specific need for it.
Side note, you’re never calling Mark() on your timer, so it’s only waiting 45 seconds the first time. After that, it’s firing on every pass. You definitely don’t want to do that.
“squirreltown” wrote:
I really wonder what pressing need there was to change that.
A few months ago, there were a handful of users who insisted there needed to be a lower setting for plasma screens to prevent burn in. I don’t know if that had anything to do with it or not. That aside, it does make it a bit easier to test screensavers, since you don’t have to sit and wait 5 minutes for them to kick in.
I just don’t like that there is a black screen. That being said, hopefully Roku will fix the bug so that with roScreen games, the system screensaver will work properly and not just be black screen.
I’m not marking the clock, but “marking” the variable ScrSav I set to check against, then when the main clock progresses past that point 45s it cycles again, works as intended.
“Komag” wrote:
I just don’t like that there is a black screen.
That’s not really a good enough reason to disable the screensaver. Unless you’re implementing your own screensaver functionality, you’re risking damaging your users’ TVs.
–Mark
“Komag” wrote:
I just don’t like that there is a black screen.
I suppose the question is why a user would be idle long enough in your game to let the screensaver kick in. If you’re going to do this, then it might be a good idea to add your own screensaver logic, so you still “save” the user’s screen without going to a black screen.
One thing worth noting that you’re probably already aware of.. the method you’re using is actually sending a keypress to the box, which will show up in your roUniversalControlEvent queue.
“Komag” wrote:
That being said, hopefully Roku will fix the bug so that with roScreen games, the system screensaver will work properly and not just be black screen.
I don’t think it’s a bug. I believe it’s intended behavior to avoid crashing the box should both the channel and the screensaver be using the 2D API.
“Komag” wrote:
I’m not marking the clock, but “marking” the variable ScrSav I set to check against, then when the main clock progresses past that point 45s it cycles again, works as intended.
Oops.. you’re right. Missed that, sorry…
“TheEndless” wrote:
Out of curiosity, why do you need to prevent the screensaver?
If you’ve gone to the trouble of writing your own roScreen screensaver for your roScreen app, you have to use the ECP trick to keep the black screen screensaver from launching on top of it. Obviously plenty of folks don’t have trouble with the black screen, including those at Roku. Personally, i think it makes me look bad and I try to do everything I can to avoid it. RoScreen is 3+ years old, its time to finish it. Stop showing the empty buffer on creation, and please at least have the bouncing Roku logo over it as a screensaver.
“TheEndless” wrote:
That aside, it does make it a bit easier to test screensavers, since you don’t have to sit and wait 5 minutes for them to kick in.
OK i clearly must have missed something, what isn’t checked by running “preview” in the screeensaver settings?
If you want to test your screensaver while the channel is running, to make sure that the channel and screensaver are properly exchanging data when they are both running, preview won’t help you.
- Joel
“RokuJoel” wrote:
If you want to test your screensaver while the channel is running, to make sure that the channel and screensaver are properly exchanging data when they are both running, preview won’t help you.
- Joel
There you go. Told you I missed something.
Yeah, I’m planning an “in-game” screensaver as a replacement, both to literally avoid damaging any old boob toobs out there along with the plasma’s, and also as an in-game sort of joke thing about being idle.
I’ll just check for all inputs OTHER than my anti-screen-saver keypress, and if there are none for a certain time, do the in-game screen saver.
“NewManLiving” wrote:
Some things that were shared on other threads. Don’t know what support the GetScreensaveTimeout has but it works on what I have
The undocumented roAppManager.GetScreensaverTimeout to get timeout values
Totally missed this, thank you NML for mentioning it. Just tried it, It’s the solution to not annoying the user.
“squirreltown” wrote:
If you’ve gone to the trouble of writing your own roScreen screensaver for your roScreen app, you have to use the ECP trick to keep the black screen screensaver from launching on top of it.
Yep, as I’ve done, and suggested as something you should do if you opt to go this route, but that’s the only legitimate reason I can think of for doing it.
looks like using “keypress/Backspace” works fine too, so I can avoid “using up” any remote buttons just for this ![]()
