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: 
destruk
Streaming Star

Another roScreen bug

Roku 2 - latest firmware. If your app crashes with drawn text on the roscreen buffers, when you hit home, the text still appears on the roku channel home screen, lol...
I'd take a screenshot, but screenshots don't work when an app isn't running.
0 Kudos
9 REPLIES 9
destruk
Streaming Star

Re: Another roScreen bug

ok, um...even when the app doesn't crash, it could be a big problem... 😞
To reproduce - create a double-buffered roScreen component and draw some text to it, swap buffers, and draw text to it again.
Then close the roscreen (since no close method exists, just return from the routine that created it)
Create an roImageCanvas and roVideoPlayer component like the custom video player example.
Play a video
With the video playing, press HOME to exit your channel, and the text from the roScreen is visible on the home channel selection screen.
Any channel squares that are visible overlay the leftovers drawn from the roScreen component buffer - so to see it clearly I would recommend drawing your text to the right side of the screen (in dev mode nothing is there but the background on the home screen)

For now I suppose the 'fix' is - before returning from the roscreen, manually clear the back buffer, swap buffers, and then clear the back buffer again in the app - or do that before playing with roimagecanvas and/or an rovideoplayer.
0 Kudos
destruk
Streaming Star

Re: Another roScreen bug

ok, that doesn't always work either... that returns a near entirely black roku home screen. -
screen.clear(&h000000FF) on home displays the banner ad at the bottom, and the clock in the top right, and everything else is black with no channel icons...hmm...

-edit-
screen.clear(&h00000000) works.
0 Kudos
TheEndless
Channel Surfer

Re: Another roScreen bug

I'm not seeing this behavior at all. What firmware version are you running?
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
destruk
Streaming Star

Re: Another roScreen bug

4.8/build 1178
0 Kudos
TheEndless
Channel Surfer

Re: Another roScreen bug

Same here and no persistence issues... One thing I do that it sounds like you're not is explicitly set the roScreen reference to invalid to close the screen, not just exit the function. I wonder if that could be the difference.
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
destruk
Streaming Star

Re: Another roScreen bug

Here is a sample channel to look at -
http://vpforums.org/destruk/roscreenbug.zip

When the channel starts, it populates some text on an roscreen, press any remote button and it displays the roku home channel selection screen but plays sound from the video if you give it a few seconds.
The channel code continues to run, because if you press down, then it displays the video itself.
It's not the same problem I was seeing in my other channel, but it demonstrates that there are some sandbox/memory management problems going on in relation to keeping the video memory separate from the roku home screen UI.
setting the roscreen to invalid before closing/exiting the routine doesn't make a difference.

When it does this, the roku screensaver doesn't turn on as it thinks it's 'playing a video'
0 Kudos
TheEndless
Channel Surfer

Re: Another roScreen bug

"destruk" wrote:
Here is a sample channel to look at -
http://vpforums.org/destruk/roscreenbug.zip

When the channel starts, it populates some text on an roscreen, press any remote button and it displays the roku home channel selection screen but plays sound from the video if you give it a few seconds.
The channel code continues to run, because if you press down, then it displays the video itself.
It's not the same problem I was seeing in my other channel, but it demonstrates that there are some sandbox/memory management problems going on in relation to keeping the video memory separate from the roku home screen UI.
setting the roscreen to invalid before closing/exiting the routine doesn't make a difference.

When it does this, the roku screensaver doesn't turn on as it thinks it's 'playing a video'

For what it's worth, that example has nothing to do with an roScreen bug, as the same happens if you comment out the ShowHomeScreen() call. The reason you're seeing the home screen is because you're using a blank roImageCanvas as your facade. If you used an roPosterScreen, you'd see the poster screen instead. If you press [Down] when the home screen is displayed, your roImageCanvas paints as expected. I can't quite track down why it's not painting initially (maybe something to do with the order in which the setup/paint is called...?), but it's definitely not roScreen related.

If you're using an roImageCanvas facade in the code from your original post, is it possible that's what's retaining the text over the home screen when you think you've exited the channel?
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
destruk
Streaming Star

Re: Another roScreen bug

Shouldn't roku be blanking out the image of the home screen when the channel loads?
From the behavior I'm seeing, it appears that the channel app is simply another layer on top of the channel menu, which means it's not really running in its own thread with its own graphics subsection of ram, like it's 'supposed to', or what I was led to believe it did.

As for your other question -
If you're using an roImageCanvas facade in the code from your original post, is it possible that's what's retaining the text over the home screen when you think you've exited the channel?

No, because when I look at it in the debugger, I press home on the remote, which causes the debugger to exit and the text doesn't go away. I can scroll through different available channels and the text still remains in the same place. The text is written to the screen with the roscreen/drawtext routine in the roscreen function and it's not being closed when the channel exits. Nothing is drawn to the facade screen.
0 Kudos
destruk
Streaming Star

Re: Another roScreen bug

anyway, I didn't think I should have to manually clear the roscreen before playing a video with roimagecanvas, when the roscreen should already be terminated.
It is fixed with
screen.Clear(&h00000000)
screen.swapbuffers()
screen.Clear(&h00000000)

before creating the new canvas and playing the video, I just thought someone at roku would be interested knowing this can happen - that the home screen can be in operation, icons can be selected and cycled on the home screen, and the home screen graphics can be corrupted with something written on a free buffer with roscreen from a previously terminated channel. I wish I could post the actual problem code, but with the code file so long (thousands of lines) I'm not sure of the exact reason the problem exists.
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.