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.

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?

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

-JT

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

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

-JT

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.

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 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 :laughing: ) 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

“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.

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

-JT

well, i think got some issues cleared up, apparently the package size was too large, removing/flattening the pngs worked and i finally got the m3u8 to play!!!

… trouble now is, it’s lousy quality coming from the box and apparently only uses the lower profile sets, am on FIOS with 35mbps so this should be flying. I know for fact this stream goes all the way up to 2.5mbps but the box does not adapt at all, any insights greatly appreciated.

Would it make sense to remove HD/SD reference ?

“ralfjacob” wrote:
well, i think got some issues cleared up, apparently the package size was too large, removing/flattening the pngs worked and i finally got the m3u8 to play!!!

… trouble now is, it’s lousy quality coming from the box and apparently only uses the lower profile sets, am on FIOS with 35mbps so this should be flying. I know for fact this stream goes all the way up to 2.5mbps but the box does not adapt at all, any insights greatly appreciated.

Would it make sense to remove HD/SD reference ?
How long are you watching for? The Roku will start with a lower quality stream, so playback can start faster, then switch to higher quality a minute or so later.