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: 

roVideoPlayer freezing Roku instead of msg.isRequestFailed()

I am streaming videos from Vimeo.com to my custom roVideoPlayer. Mostly it works fine but sometimes once or twice in a month my application starts crashing. I have put code to detect .isRequestFailed() event and move to next video, which executes fine sometimes, but sometimes .isRequestFailed() event is never triggered, instead video is streamed with startup progress to 999 but never starts playing. Remaining of the application features keep working as they should (I am using roScreen along with roVideoPlayer to show some other graphics, and these graphics are animated text so screen is refreshed 30 to 40 times approx in a second to update these graphics). When it is stuck at startup progress 999 either of the two things happened:

1- Eventually other graphics (animated text) stop working too, screen is stuck at where it is for unlimited time, and when I press some button it goes black and Roku restarts.
2- Graphics do not stop working but after sometime screen automatically goes black and Roku restarts.

It might be some in-compatibility between Vimeo and Roku, as these type of errors never happened when I was using Dropbox as playback source. So is there anyone else who have used Vimeo as a source???
Even if it is because of some in-compatibility, shouldn't it be handled by roVideoPlayer and isRequestFailed() event be triggered?

I do not want to move from Vimeo to some other hosting as Vimeo is cheap (as far as I know), moreover I have my thousands of videos on Vimeo.

Below is startup progress on console, after this no event from roVideoPlayer is triggered although other events (from roScreen) keeps triggering until application halts or Roku restarts:


startup progress 330
startup progress 431
startup progress 629
startup progress 727
startup progress 776
startup progress 825
startup progress 875
startup progress 924
startup progress 973
startup progress 999
startup progress 999
0 Kudos
8 REPLIES 8
NewManLiving
Visitor

Re: roVideoPlayer freezing Roku instead of msg.isRequestFail

Roku will hang at 999 if the video resolution is inappropriate for roVideoPlayer. Not sure if this is your problem but it's a thought
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: roVideoPlayer freezing Roku instead of msg.isRequestFail

"NewManLiving" wrote:
Roku will hang at 999 if the video resolution is inappropriate for roVideoPlayer. Not sure if this is your problem but it's a thought


Video resolution is 360p or 720p, that is the resolution Vimeo provides. Also same video plays some other times.
0 Kudos
RokuJoel
Binge Watcher

Re: roVideoPlayer freezing Roku instead of msg.isRequestFail

The custom video player example in our SDK uses roImageCanvas, so make sure you call SetMaxVideoDecodeResolution to the resolution of your largest video.

Rebooting like you described is typically caused by some sort of out-of-memory condition, so check that your code isn't doing something that allocates large amounts of memory and doesn't give it back. For example, using giant bitmaps as the background for your screen, functions that call themselves over and over, things like that.

- Joel
0 Kudos

Re: roVideoPlayer freezing Roku instead of msg.isRequestFail

"RokuJoel" wrote:
The custom video player example in our SDK uses roImageCanvas, so make sure you call SetMaxVideoDecodeResolution to the resolution of your largest video.

Rebooting like you described is typically caused by some sort of out-of-memory condition, so check that your code isn't doing something that allocates large amounts of memory and doesn't give it back. For example, using giant bitmaps as the background for your screen, functions that call themselves over and over, things like that.

- Joel

Thanks Joel,

I had almost 10 bitmaps of resolutions ranging from 100px to 1080px never unloaded, once loaded. I have changed my code to unload images once these images are no longer in use. But still I am facing the issue. If it would have been an issue with memory it should have been resolved by unloading unnecessary images (although I think memory had a little part in it too). Also I have no recursive functions and I am also calling SetMaxVideoDecodeResolution. So can you please tell me any more reasons that can cause Roku to freeze or crash?

I am using either 360p videos or 720p videos, but I am calling SetMaxVideoDecodeResolution with 1080p, as I tried to play 1080p videos with roScreen but could not, probably because of memory issues.
0 Kudos
NewManLiving
Visitor

Re: roVideoPlayer freezing Roku instead of msg.isRequestFail

You should probably use r2d2_bitmaps at telnet ip:8080
To see exactly what is going on with your bitmaps. Setting the bitmap handle to invalid does not immediately release memory. Also if you use sprites you must explicitly call remove. Even if you set the bitmap to invalid
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: roVideoPlayer freezing Roku instead of msg.isRequestFail

"NewManLiving" wrote:
You should probably use r2d2_bitmaps at telnet ip:8080
To see exactly what is going on with your bitmaps. Setting the bitmap handle to invalid does not immediately release memory. Also if you use sprites you must explicitly call remove. Even if you set the bitmap to invalid

Thanks for r2d2_bitmaps,

According to r2d2_bitmaps -> "Available memory 23820224 used 15179776 max 39000000"
And it is showing bitmaps loaded and I can see that bitmaps that I am unloading are not there now.

So my application has not crashed yet for now. But as you said setting bitmap handle does not immediately release memory so should I explicitly run garbage collector? Also is it a good practice to run garbage collector explicitly? I am setting bitmaps to invalid when I am leaving a screen and going to another screen.
0 Kudos
NewManLiving
Visitor

Re: roVideoPlayer freezing Roku instead of msg.isRequestFail

the next swapbuffers call will get rid of it. I recall even using finish at one point even on the double buffered screen to release memory since swapbuffers calls finish. I don't think the garbage collector is aware of it until cleared by the roscreen itself. Don't know for sure. Maybe someone else does
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: roVideoPlayer freezing Roku instead of msg.isRequestFail

"scorpiontahir02" wrote:
"RokuJoel" wrote:
The custom video player example in our SDK uses roImageCanvas, so make sure you call SetMaxVideoDecodeResolution to the resolution of your largest video.

Rebooting like you described is typically caused by some sort of out-of-memory condition, so check that your code isn't doing something that allocates large amounts of memory and doesn't give it back. For example, using giant bitmaps as the background for your screen, functions that call themselves over and over, things like that.

- Joel

Thanks Joel,

I had almost 10 bitmaps of resolutions ranging from 100px to 1080px never unloaded, once loaded. I have changed my code to unload images once these images are no longer in use. But still I am facing the issue. If it would have been an issue with memory it should have been resolved by unloading unnecessary images (although I think memory had a little part in it too). Also I have no recursive functions and I am also calling SetMaxVideoDecodeResolution. So can you please tell me any more reasons that can cause Roku to freeze or crash?

I am using either 360p videos or 720p videos, but I am calling SetMaxVideoDecodeResolution with 1080p, as I tried to play 1080p videos with roScreen but could not, probably because of memory issues.


Hey Joel,
One other thing that came into my mind might be causing it but I am not sure. I am using roCaptionRenderer and roVideoPlayer that cause A LOT OF events to be triggered. Also I have set event loop wait() to time out at 20 milliseconds to achieve textual animation in my screen. So each time roCaptionRenderer and roVideoPlayer events are called time is calculated as text position should be offset or not. As you asked if I am having a recursive method (which means it can also be over processing issue), so it came into my mind that may be calculations in my event loop might have caused the crash. Is it possible?
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.