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: 

How can a channel cause Roku to crash?

Hi,

I have created a Roku private channel that plays my videos from Vimeo. There is a video that plays fine sometimes and for sometimes my custom roVideoPlayer tries for almost 2 minutes to load it and then Roku crashes and reboots.

So my questions are?

1- Why same video is played fine sometimes and same video causes crash to not only the channel but also the Roku itself?
2- I have found on some internet resources that poor channel coding (given examples are of amazon and some other channels) can also cause the Roku to crash and reboot. So I want to know that what type of scenarios in the channel code can cause the Roku to crash and reboot?
0 Kudos
11 REPLIES 11
EnTerr
Roku Guru

Re: How can a channel cause Roku to crash?

There is no single "scenario" of Roku crashing, rather it is a catch-all handling to exceptions (as in unexpected events, ones developers did not think about). There is a "watchdog" that hard reboots the box if things get fishy. For any reason really, if Roku runtime process exits or becomes irresponsive (it can take half a minute for watchdog to notice). The same behavior exists in Brightsign products, as well as ReplayTV fifteen years ago. On balance of probabilities it is a good thing, since it does not leave the box "hanging" or vulnerable - and in many cases users will mentally excuse the behavior as "it had to restart" (and if they are not around, "what you cannot see, can't harm you"). Variety of things can give Roku a case of the SADS, i have seen it due to running out of memory or passing wrong arguments.

In your case it might be something with the video file format, if you can pinpoint the URL and pass that to RokuCo, they might be able to research (and theoretically fix) the issue.
0 Kudos
greubel
Visitor

Re: How can a channel cause Roku to crash?

I have the same problem. I work all day on my channel, coding, testing and rebooting, no problem !
Then later I get ready to relax and watch a movie. It gets about 1/3 the way and the Roku reboots. I restart the movie and it plays fine.

I've seen this problem on multiple roku boxes. I wanted to get to the bottom of it, is it me or is it Roku. So the next day, I put four Roku boxes in a loop playing the failed video. They are different models n1 to 3, running 3.x and 5.x firmware. The stupid movie played for 8 hours on all the boxes, no failure !

I think maybe it gets tired !
0 Kudos
TheEndless
Channel Surfer

Re: How can a channel cause Roku to crash?

"greubel" wrote:
I have the same problem. I work all day on my channel, coding, testing and rebooting, no problem !

I think this may be a contributor. While developing with the 2D interfaces, it's not hard to get the box into a state where it will start behaving unpredictably, by exceeding the video/graphics memory limits once or twice. I've also seen similar behavior by storing too much data in tmp:. That doesn't explain random reboots for non-developers, but it could certainly explain why you'd have a reboot after a day of developing on the box.
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
greubel
Visitor

Re: How can a channel cause Roku to crash?

I am only using the roImageCanvas not the 2D. But I do use multiple layers.
Is there a way to determine the state of memory before it crashes, besides getting invalid on a create object request ?
It's been rumored that tmp is limited to 50 meg, how much does the video player need out of tmp ?
It would be nice if garbage collection returned the available size.
0 Kudos
TheEndless
Channel Surfer

Re: How can a channel cause Roku to crash?

"greubel" wrote:
I am only using the roImageCanvas not the 2D. But I do use multiple layers.
Is there a way to determine the state of memory before it crashes, besides getting invalid on a create object request ?
It's been rumored that tmp is limited to 50 meg, how much does the video player need out of tmp ?
It would be nice if garbage collection returned the available size.

Does the "r2d2_bitmaps" command return any information about the images you have on the roImageCanvas? I don't know about tmp, but I know that the video player will fail if it doesn't have at least 23MB of memory available as returned by the "r2d2_bitmaps" command (on the previous gen Roku 2 and new streaming stick, at least). If you have video playing, and you exceed that limit, things can start to get hairy.
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
NewManLiving
Visitor

Re: How can a channel cause Roku to crash?

You can get some idea how much memory is
Available by opening a telnet session at
Your box ip. Port 8080
The command r2d2_bitmaps will dump memory
Contents. The first time usually gets command
Not recognized so execute it twice the
First time
I've had crashes in the past due to
Exceeding the limit of the roVideoPlayer's
Maximum resolution of 720 x 480. And I found
That if I have a large number of print statements
In my message loops for testing as we usually do when developing
And nothing open to receive them then the
Channel just hangs from time to time. Took me a
awhile to figure that one out
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
0 Kudos

Re: How can a channel cause Roku to crash?

@ EnTerr:

I have had exceptions in my apps before but these unhandled exceptions always were shown on telnet session and just the application crashed not the whole Roku restarted. So can you please elaborate about what exceptions you are exactly talking about? And when we are not handling an event, it just does nothing and is wasted but how does it cause Roku to crash?

Also I have found out that the problem is not in the video as it is happening with multiple and random videos.
0 Kudos

Re: How can a channel cause Roku to crash?

@NewManLiving & @TheEndless:

I am using 2D API in my app and am playing 720p videos along with it. It plays 720p videos fine (does not play 1080p videos with use of 2D API) so I think if it can play 720p videos then these videos should not cause a problem? Video bitrates are from 1.6Mbps to 3.0Mbps.

And with r2d2_bitmaps here is what I have got:
"Available memory 24688576 used 14311424 max 39000000"
Isn't it enough memory to play videos?
0 Kudos
RokuJoel
Binge Watcher

Re: How can a channel cause Roku to crash?

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.