Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Komag
Roku Guru

Re: Prevent Black Screen or Timeout

By the way, "Backspace" is code 11 for press and 111 for release, and sending url = "http://"+ipaddr+":8060/keypress/Backspace" does both 11 and 111
0 Kudos
EnTerr
Roku Guru

Re: Prevent Black Screen or Timeout

"RokuMarkn" wrote:
"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.

I am confused here, what did i miss?
I thought that black screen is always shown instead of screensaver when current channel is in roScreen.
That includes "own screensaver" too, right? So how is own-SS relevant here, if it won't be invoked anyway?
0 Kudos
RokuMarkn
Visitor

Re: Prevent Black Screen or Timeout

Yes, currently the black screen is shown instead of a screensaver over roScreen. I don't think anyone is talking about private screensavers here. What Komag is proposing is to DISABLE the screensaver, by periodically sending ECP commands, and then have his main app behave like a screensaver when appropriate.

--Mark
0 Kudos
squirreltown
Roku Guru

Re: Prevent Black Screen or Timeout

"RokuMarkn" wrote:
Yes, currently the black screen is shown instead of a screensaver over roScreen. I don't think anyone is talking about private screensavers here. What Komag is proposing is to DISABLE the screensaver, by periodically sending ECP commands, and then have his main app behave like a screensaver when appropriate.

--Mark

Correct. You build a screen saver into your channel but you don't call it Runscreensaver(). I call mine FakeScreensaver(). Then you use appmanager to get the box SS interval and trigger yours ahead of it, while using the ECP trIck to ward off the evil black screen.
Kinetics Screensavers
0 Kudos
EnTerr
Roku Guru

Re: Prevent Black Screen or Timeout

"RokuMarkn" wrote:
Yes, currently the black screen is shown instead of a screensaver over roScreen. I don't think anyone is talking about private screensavers here. What Komag is proposing is to DISABLE the screensaver, by periodically sending ECP commands, and then have his main app behave like a screensaver when appropriate.

Oh i see. Seems i was mislead when further TheEndless, squirreltown and RokuJoel talked about "own screensaver" and then about testing pvt.SS w/timeout (new subject apparently).

So a private SS (implementing RunScreenSaver()) cannot interfere with a "black death" event. I.e. cannot say have runScreenSaver() that just does a `return` when invoked or ECP sends a key to wake up and return to the core app. Because it won't get invoked at all when roScreening.

Hmmm... radical question here!
Aren't periodic calls to ifScreen.swapBuffers() and .Finish() enough of a reason to ward-off the Black Screen?

I mean how the SS watchdog decides if it's time to start (imaginary)saving the screen - it checks for recent events like remote I/O and video component playing. It can do the same based on whether roScreen graphic activity is happening or not. Now that is a heuristic since one might be drawing and never SwapBuffers() - or swap them while keeping the same image. But same can be said for roVideoPlayer - it may loop a video of the same still frame for many hours and ostensibly burn-into a cathode tube or plasma display after left for days
0 Kudos
squirreltown
Roku Guru

Re: Prevent Black Screen or Timeout

"EnTerr" wrote:

Hmmm... radical question here!
Aren't periodic calls to ifScreen.swapBuffers() and .Finish() enough of a reason to ward-off the Black Screen?


My experience says the answer is no. My stuff is built to be swapping buffers every pass through the loop (makes the UI real snappy) even if nothing on the screen is changing so if swapbuffers() alone prevented the screensaver you could get a burn-in event.

"EnTerr" wrote:
But same can be said for roVideoPlayer - it may loop a video of the same still frame for many hours and ostensibly burn-into a cathode tube or plasma display after left for days


I'm guessing that the SS Day-Mon must know that the video is paused, but if you were watching say one of Andy Warhol's 8 hour movies of a cheeseburger wrapper sitting on the table, there could be an issue there.
Kinetics Screensavers
0 Kudos
TheEndless
Channel Surfer

Re: Prevent Black Screen or Timeout

"squirreltown" wrote:
"RokuMarkn" wrote:
Yes, currently the black screen is shown instead of a screensaver over roScreen. I don't think anyone is talking about private screensavers here. What Komag is proposing is to DISABLE the screensaver, by periodically sending ECP commands, and then have his main app behave like a screensaver when appropriate.

--Mark

Correct. You build a screen saver into your channel but you don't call it Runscreensaver(). I call mine FakeScreensaver(). Then you use appmanager to get the box SS interval and trigger yours ahead of it, while using the ECP trIck to ward off the evil black screen.

No need to call it something other than RunScreensaver(). You can call RunScreensaver() from your code and it would work the same as calling it FakeScreensaver(). Only reason to rename it would be if you didn't want the Roku to see that you have a screensaver entry point for some reason. I actually use this trick so I only need the "fake" screensaver on newer devices, while legacy devices (which don't go to a black screen) can use the standard screensaver functionality.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
squirreltown
Roku Guru

Re: Prevent Black Screen or Timeout

"TheEndless" wrote:
You can call RunScreensaver() from your code and it would work the same as calling it FakeScreensaver(). Only reason to rename it would be if you didn't want the Roku to see that you have a screensaver entry point for some reason. I actually use this trick so I only need the "fake" screensaver on newer devices, while legacy devices (which don't go to a black screen) can use the standard screensaver functionality.


Very good tip
Kinetics Screensavers
0 Kudos
Komag
Roku Guru

Re: Prevent Black Screen or Timeout

Just a note:

app = CreateObject("roAppManager")
? app.GetScreensaverTimeout() ' Returns the number of minutes this Roku waits before running the system screensaver
? Type(app.GetScreensaverTimeout()) ' Returns "Integer"

di = CreateObject("roDeviceInfo")
? di.TimeSinceLastKeypress() ' Returns the number of seconds since the last remote keypress was received.

Simply multiply the Timeout setting by 60, check when the LastKeypress is getting close (say, within 10 seconds), and run your in-app custom screensaver instead, and send fake ECP signals to avoid the system screensaver.
0 Kudos
belltown
Roku Guru

Re: Prevent Black Screen or Timeout

"Komag" wrote:
looks like using "keypress/Backspace" works fine too, so I can avoid "using up" any remote buttons just for this 🙂


It may be worth noting that you can use just about anything for a remote keypress, even keys that aren't on any remote or keyboard (at least any character in the 16-bit Unicode Basic Multilingual Plane). I use the Unicode Character 'ALARM CLOCK' (U+23F0), .

I have this in my fake screensaver code:

	this.CLOCK_KEY_PRESS = 9200
this.CLOCK_KEY_RELEASE = 9300
this.CLOCK_KEY_STRING = "Lit_%E2%8F%B0"

this.WAKEUP_KEY_PRESS = this.CLOCK_KEY_PRESS
this.WAKEUP_KEY_RELEASE = this.CLOCK_KEY_RELEASE
this.WAKEUP_KEY_STRING = this.CLOCK_KEY_STRING


Any Unicode character that can be represented in 16 bits should work, even on legacy Rokus, even if it requires 3 UTF-8 octets. Just don't try using something like the Pile of Poo character, which takes up 32 bits. This is not a problem since you shouldn't need a pile of poo when you have an alarm clock to wake you up.
0 Kudos