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: 
TheEndless
Channel Surfer

Re: invalid event messages

"mainmanc" wrote:
"TheEndless" wrote:
"mainmanc" wrote:
I am not having an issue with state, but it certainly is misleading when an error is thrown up on the console. As a programmer, that justs drives me nuts every time I see it 🙂 . If it is indeed a situation based on the "unexpected" return to the Home screen (which is appears to be) there should be at least some mechanism to either suppress or handle a clean return internally, instead just throwing an error, in my opinion.

My guess would be that it's not actually returning and invalid msg, but instead killing the "wait" itself so msg is never set, in which case, it would be your code's responsibility to handle that situation, not the Roku.


Yeah, that would make sense. What do you recommend as the best approach to handle those situations through code?

EDIT: Actually this looks more like the issue I'm talking about. http://forums.roku.com/viewtopic.php?f=34&t=28472&start=0

I actually have "If msg = invalid" checks in all of my wait loops. To be fair, though I have a timeout in most of my waits because I use them as timers as well. In general, it's probably a good practice to check all of your objects for validity, especially since the SDK doesn't provide any kind of error handling. Adding an "If msg <> invalid Then" to your wait loop should prevent the crash, and won't hurt to have regardless.
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
YungBlood
Streaming Star

Re: invalid event messages

Something strange I've come across that I haven't understood...
To learn more about what events come to a port, I've had 'print type(msg)' lines. And a few times when I pressed home, the box would get stuck in an endless loop printing 'invalid'. And part of the time when that would happen, I would get back the the channel list, but I wouldn't be able to get into any channel unless I rebooted roku. Just curious if anyone else has seen that error, and knows the reason.
-Kevin
YungBlood

Bringing more fun to Roku!
0 Kudos
TheEndless
Channel Surfer

Re: invalid event messages

"YungBlood" wrote:
Something strange I've come across that I haven't understood...
To learn more about what events come to a port, I've had 'print type(msg)' lines. And a few times when I pressed home, the box would get stuck in an endless loop printing 'invalid'. And part of the time when that would happen, I would get back the the channel list, but I wouldn't be able to get into any channel unless I rebooted roku. Just curious if anyone else has seen that error, and knows the reason.
-Kevin

I've seen the latter issue after trying to open an audio file in the roAudioPlayer with an incorrect StreamFormat. I can't say I've seen the infinite loop on Home issue, though.
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
renojim
Community Streaming Expert

Re: invalid event messages

I haven't seen the endless loop of invalids, but I've seen two dozen or more. I have seen the issue where you can navigate the main channel menu, but not select anything. I haven't come up with a reproducible case that causes it, though. I thought pressing Home killed the channel outright, but it makes me think it's not 100% reliable.

-JT
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
YungBlood
Streaming Star

Re: invalid event messages

Well my scroll buffer on my telnet client is 200 lines, and it's maxed out the scroll buffer... I agree if it can lock on the main channel selection, it's not a true kill. Also, I've hit the home key, then gone back into my app, and my tmp:/ files were still there part of the time.
-Kevin
YungBlood

Bringing more fun to Roku!
0 Kudos
RokuKevin
Visitor

Re: invalid event messages

It seems there are a number of bugs reported in this thread....

I've got:
1) Playing audio with an incorrect streamformat in the audio player causes the firmware to crash
2) wait() with a zero timeout sometimes returns an invalid message (this should not happen, are you sure it's invalid and not a different unknown message type?)
3) Hitting the Home button does not clean up tmp:/ files for the channel.
4) Hitting the Home button sometimes causes invalid messages to be sent to the app in a loop.

I don't see how 2) or 4) could happen. Would be great if someone has a reproducible case for these.

--Kevin
0 Kudos
YungBlood
Streaming Star

Re: invalid event messages

I'll look through my test code and see if I can find the best reproducible code that demonstrates this "invalid" problem. What I can say is when I was still learning about brightscript, I had these lines in my loops:


msg = wait(0, port)
print type(msg)

And it printed invalid...
YungBlood

Bringing more fun to Roku!
0 Kudos
renojim
Community Streaming Expert

Re: invalid event messages

Re: 2) & 4),
It's definitely invalid. It's definitely caused by pressing Home. And, I don't even have to send you anything. Try the custom video player example from the v2.6 SDK. You'll notice what I thought was an unnecessary "if msg <> invalid" right after a "msg = wait(0, m.port)" in the EventLoop() function. Add an "else, print msg", start it up, wait for it to print a couple of "startup progress" messages and then press home. It doesn't do it every time, but it does it most of the time.

-JT
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
RokuKevin
Visitor

Re: invalid event messages

renojim,

Thanks for pointing me to the customvideoplayer showing the bug.

Yes, we can easily recreate the pressing Home button causes invalid from a wait with a timeout of zero.

--Kevin
0 Kudos