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

annoying bug

have a message port and make the mistake of typing

print port

in the console

now I have an eternal stream of the word invalid and I can't kill it. Have to actually pull plug, nothing else works to get the debugger back.



- Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
14 REPLIES 14
renojim
Community Streaming Expert

Re: annoying bug

There's an interesting bug! I don't get exactly the same result, but it definitely screws up the box. I only get invalids if I keep pressing Ctrl-C. Issuing an ECP launch/dev command oddly enough took me back to the main menu, but nothing works except "Settings". I can preview a screensaver, but it's obvious that something is eating up cycles and I can't get into the screensaver's custom settings. This is a case where the reboot remote sequence comes in handy.

-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
kbenson
Visitor

Re: annoying bug

We ran into that non-functioning home screen problem about once a week while developing KidPaint. I think it was a combination of crazy code and a less mature environment at the time. I haven't seen this particular behavior in months now.
-- GandK Labs
Check out Reversi! in the channel store!
0 Kudos
renojim
Community Streaming Expert

Re: annoying bug

kbenson, I've seen the behavior you described as well and as you said I haven't seen it in months either. It's as if the main application thread doesn't get properly killed. I was never able to come up with a repeatable example, until now. :mrgreen:

-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
jbrave
Channel Surfer

Re: annoying bug

The port is a global m.port, defined like this (totally untested code but similar):

sub main
v=init()
v.exec()
end sub

function init() as object
return {port:createojbect("romessageport")
scrn:createobject("roposterscreen")
exec:dostuff}
end function

function dostuff()
m.scrn.setmessageport(m.port)
stop
end funtion


then ?m.port
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
jbrave
Channel Surfer

Re: annoying bug

More annoying port stuff:

given a port m.port

and an object like a springboard

p.setmessageport(m.port)

x=p.getmessageport()

?x

roku now needs to be rebooted....
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
TheEndless
Channel Surfer

Re: annoying bug

While crashes and reboots certainly aren't ideal, why exactly are you trying to print message ports to the console anyway?
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
jbrave
Channel Surfer

Re: annoying bug

According to the component reference, x=object.GetMessagePort() should tell me what if any port the screen is set to. Instead if results in having to reboot when I print.

I"m trying to figure out why I'm not getting any messages on a port when I've set the screen to point to it. The port exists (global), the screen exists (local) both exist in the current context. Once I hit the message loop, nothing further happens unless I hit break, or the home button.

- Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
jbrave
Channel Surfer

Re: annoying bug

Oh, also, I just felt like bitching and moaning.

- Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
kbenson
Visitor

Re: annoying bug

"jbrave" wrote:
According to the component reference, x=object.GetMessagePort() should tell me what if any port the screen is set to. Instead if results in having to reboot when I print.


All I can find in the component reference is that it says it returns the message port. The distinction in implied use is subtle, but there. You aren't supposed to print a message port. Printing it would probably just give you a listing of it's object type.


I"m trying to figure out why I'm not getting any messages on a port when I've set the screen to point to it. The port exists (global), the screen exists (local) both exist in the current context. Once I hit the message loop, nothing further happens unless I hit break, or the home button.


Are you creating message ports as needed, or passing around existing ones? I'm pretty sure the purpose of the GetMessagePort() method is to make it easier to access existing ports for re-use.
-- GandK Labs
Check out Reversi! in the channel store!
0 Kudos