Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
JSM_IT_DEV
Level 7

Firmware 7.7.0.4094 - roSGScreen - setField function fails with "unknown failure"

A bug has appeared on Firmware 7.7.0.4094 (this did not occur on 7.6.0.4120):

The following line crashed the app (caused: BRIGHTSCRIPT: ERROR: roSGNode.Unknown: unknown failure):


scene.setField("extra", m.top.extra)



This is the correct way to set the "extra" property of the scene, according to the Roku documentation:

https://sdkdocs.roku.com/display/sdkdoc/ifSGNodeField#ifSGNodeField-setField(fieldNameasString,valueasObject)asBoolean

According to that page, there are two ways of accomplishing the exact same thing:

"You can also use the node.field syntax to get the same result as setField(). That is, rect.setField("opacity", 0.5) is equivalent to rect.opacity = 0.5."

As an unlikely shot in the dark, I tried switching to the other syntax:


scene.extra = m.top.extra



... and viola! The issue was resolved. This seems to be a bug in Roku's new Firmware (7.7.0.4094)

More info:

Using a Roku 4 (4400)

The scene object was built as follows:


screen = CreateObject("roSGScreen")
scene = screen.CreateScene(m.top.scene)



m.top.scene is a valid string (equal to the name of my scene), and
m.top.extra is a valid string:

<interface>
  <field id="scene" type="string" />
  <field id="extra" type="string" />
</interface>

0 Kudos
3 Replies
Roku Employee
Roku Employee

Re: Firmware 7.7.0.4094 - roSGScreen - setField function fails with "unknown failure"

I tried reproducing as described and could not. setField() worked fine for a scene field - both inside init() and event handler. Can you try providing a minimal code example that demonstrates this? I believe the bug popped out but does not seem as straightforward as described. Is it reliable reproducible or only occasionally?
0 Kudos
JSM_IT_DEV
Level 7

Re: Firmware 7.7.0.4094 - roSGScreen - setField function fails with "unknown failure"

It happens reliably in that one spot. That is the only spot I've used setField() on an roSGScreen. It doesn't fail on an roSGNode. I am creating a minimal code example and will provide it as soon as I can (our development Roku is currently running a lengthy streaming test).

For that particular spot in my app, I'm calling a Task component from a Scene component:


<component name="languagesScene" extends="Scene" >

...

function startFeed()
  languageItem = m.languages[m.assetList.itemFocused]
  print "PLAY: " + languageItem[1]

  m.sceneTask = CreateObject("roSGNode", "launchSceneTask")
  print "SCENE TASK CREATED"
  m.sceneTask.setField("scene", "playVideoScene")
  m.sceneTask.setField("extra", languageItem[1])
  m.sceneTask.control = "RUN"
end function

...

</component>



Then, my launchSceneTask component (extends "Task") does this:


<component name="launchSceneTask" extends="Task" >

...

sub init()
  m.top.functionName = "showSGScene"
end sub

sub showSGScene()
  print "in showSGScene"

  screen = CreateObject("roSGScreen")
  m.port = CreateObject("roMessagePort")
  screen.setMessagePort(m.port)
  scene = screen.CreateScene(m.top.scene)

  if (m.top.extra <> "") then
    print "Packing '" + m.top.extra + "' into 'extra'"
   
   'FAILS:
   scene.setField("extra", m.top.extra)

   'SUCCEEDS:
    'scene.extra = m.top.extra
  end if

  screen.show()

  while(true)
    msg = wait(0, m.port)
    msgType = type(msg)

    if msgType = "roSGScreenEvent" then
      if msg.isScreenClosed() then
        m.top.open = false
        exit while
      endif
    endif
  end while

  screen.Close()

end sub

...

</component>


Any guesses?
0 Kudos
Roku Employee
Roku Employee

Re: Firmware 7.7.0.4094 - roSGScreen - setField function fails with "unknown failure"

Wait, wat?
Why do you expect to work creation of roSgScreen from a task thread that belongs to another  roSgScreen? That is a gut-wrenching idea to me and i'd expect it to blow in your face any time - but please correct me if there is information stating otherwise.
0 Kudos