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: 
ralfjacob
Visitor

HLS playback returns Uninitialized port

Am In the process of setting up a channel that will be using HLS/m3u8 files, the xml config looks as follows:


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<feed>
<!-- resultLength indicates the total number of results for this feed -->
<resultLength>1</resultLength>
<!-- endIndix indicates the number of results for this *paged* section of the feed -->
<endIndex>1</endIndex>
<item sdImg="http://[THE SERVER].com/roku/upLynk/images/bigbuckbunny.jpg" hdImg="http://[THE SERVER].com/roku/upLynk/images/bigbuckbunny.jpg">
<title>Big Buck Bunny</title>
<contentId>10001</contentId>
<contentType>movie</contentType>
<contentQuality>HD</contentQuality>
<media>
<streamFormat>hls</streamFormat>
<streamQuality>HD</streamQuality>
<streamBitrate>0</streamBitrate>
<streamUrl>http://[THE SERVER]/content/37d6fd87f71141dbb1638e1cdf4ea93f.m3u8</streamUrl>
</media>
<synopsis>'Big' Buck wakes up in his rabbit hole, only to be pestered by three critters, Gimera, Frank and Rinky. When Gimera kills a butterfly, Buck decides on a payback Predator-style</synopsis>
<genres>Short</genres>
<runtime>595</runtime>
</item>
</feed>


telnet returns the following msg immediately after hitting 'play' / select button:


Local Variables:
screen &h16 bsc:roSpringboardScreen, refcnt=2
showlist &h16 bsc:roArray, refcnt=2
showindex &h02 Integer val:0
global &h07 rotINTERFACE:ifGlobal
m &h06 bsc:roAssociativeArray, refcnt=7
remotekeyleft &h12 Integer val:4
remotekeyright &h12 Integer val:5
msg &h16 bsc:roSpringboardScreenEvent, refcnt=1
playstart &h14 String val:0
port &h30 Untyped val:Uninitialized
BrightScript Debugger> last
038: msg = wait(0, screen.GetMessagePort())


I am using the sample 'videoplayer' app as provided in the SDK without any modifications other than references to URLs. I verified that the .m3u8 plays fine in QT and various other players...not sure where else to look. Pls advise.
0 Kudos
11 REPLIES 11
TheEndless
Channel Surfer

Re: HLS playback returns Uninitialized port

We'd need to see the actual error message in order to diagnose. You've already received an roSpringboardScreenEvent (msg), so it's not the port that's causing the issue. Can you post the error details from immediately before the local variables dump?
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: HLS playback returns Uninitialized port

It's actually above the Backtrace that's above the Local Variables dump (unless you're interested in the Backtrace).

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

Re: HLS playback returns Uninitialized port

I guess this is the culprit


created feed connection for http://[THE SERVER].com/roku/upLynk/xml/animated-short.xml
url: http://[THE SERVER]/roku/upLynk/xml/animated-short.xml
Request Time: 51
Show Feed Parse Took : 13
ButtonPressed
ButtonPressed
showHomeScreen | msg = An unexpected problem (but not server timeout or HTTP error) has been detected. | index = -3
Video request failure: -3 0
showHomeScreen | msg = | index = 0
Screen closed
Button pressed: 1 0




And here is the actual source from the video player sample:



'******************************************************
'** Display the home screen and wait for events from
'** the screen. The screen will show retreiving while
'** we fetch and parse the feeds for the game posters
'******************************************************
Function showHomeScreen(screen) As Integer

if validateParam(screen, "roPosterScreen", "showHomeScreen") = false return -1

initCategoryList()
screen.SetContentList(m.Categories.Kids)
screen.SetFocusedListItem(3)
screen.Show()

while true
msg = wait(0, screen.GetMessagePort())
if type(msg) = "roPosterScreenEvent" then
print "showHomeScreen | msg = "; msg.GetMessage() " | index = "; msg.GetIndex()
if msg.isListFocused() then
print "list focused | index = "; msg.GetIndex(); " | category = "; m.curCategory
else if msg.isListItemSelected() then
print "list item selected | index = "; msg.GetIndex()
kid = m.Categories.Kids[msg.GetIndex()]
if kid.type = "special_category" then
displaySpecialCategoryScreen()
else
displayCategoryPosterScreen(kid)
end if
else if msg.isScreenClosed() then
return -1
end if
end If
end while

return 0

End Function
0 Kudos
renojim
Community Streaming Expert

Re: HLS playback returns Uninitialized port

This may be a dumb question, but your URL doesn't really contain "[THE SERVER]", does it?

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

Re: HLS playback returns Uninitialized port

LOL, i figured i would get that answer, but no...it's a valid domain, sub ralfjacob.com for it and you can test the stream in QT. I guess the issue is more with:

Video request failure: -3  0


being the offending entity.
0 Kudos
RokuChris
Roku Employee
Roku Employee

Re: HLS playback returns Uninitialized port

The problem is in your XML. streamFormat should be defined at the item level (line 142 of showFeed.brs), you're defining it at the stream level. And the video player example is written so that when it can't determine a streamFormat, it assumes "mp4".
0 Kudos
renojim
Community Streaming Expert

Re: HLS playback returns Uninitialized port

Well here's the good news. I was able to d/l the .m3u8 file and play the Big Buck Bunny video (I never get tired of that video Smiley LOL ) using MyMedia.

You're giving us some conflicting information. If I'm not mistaken, your first error dump came from the showDetailScreen in appDetailScreen.brs, but your second code post is from showVideoScreen. By the way, your dump points out a typo in that routine:
print "showHomeScreen | msg = "; msg.getMessage() " | index = "; msg.GetIndex()
should be:
print "showVideoScreen | msg = "; msg.getMessage() " | index = "; msg.GetIndex()

Anyway, that "unexpected problem" message is the toughest, and most useless, message to figure out. You should try to uncomment the "PrintAA" line and make sure epsisode is set up properly.

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

Re: HLS playback returns Uninitialized port

"RokuChris" wrote:
The problem is in your XML. streamFormat should be defined at the item level (line 142 of showFeed.brs), you're defining it at the stream level. And the video player example is written so that when it can't determine a streamFormat, it assumes "mp4".


Well, trying to set "item.StreamFormat" to 'hls" within showFeed.brs is causing the application to fail upon install,pretty much at a loss now.
Going from :


item.StreamFormat = validstr(curShow.streamFormat.GetText())
if item.StreamFormat = "" then 'set default streamFormat to hls if doesn't exist in xml
item.StreamFormat = "mp4"
endif



to



item.StreamFormat ="hls"
if item.StreamFormat = "" then 'set default streamFormat to hls if doesn't exist in xml
item.StreamFormat = "mp4"
endif


I even tried to fail into default hls:



item.StreamFormat = validstr(curShow.streamFormat.GetText())
if item.StreamFormat = "" then 'set default streamFormat to hls if doesn't exist in xml
item.StreamFormat = "hls"
endif


either attempt causes the channel to fail on install, changing back to "mp4" and it installs again, weird.

@ renojim , thanks for showVideoScreen/ShowHomeScreen suggestion, I think the non-informative error is caused by an array overflow i believe. Am working off of the vanilla video player example so one would hope what is in there works flawless.
0 Kudos
renojim
Community Streaming Expert

Re: HLS playback returns Uninitialized port

If it fails to install, the debugger will tell you what the problem is.

-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