Hello,
I've noticed an issue with Roku's HLS implementation that causes audio track mapping issues during video playback. I have an HLS manifest that behaves differently when streamed on the Roku platform than via another platform. (HLS.js)
The issue can be observed when an `EXT-X-MEDIA:TYPE=AUDIO` tag has an empty or missing `URI` attribute, and is not the first defined `AUDIO` tag. When these conditions are met the audio tracks defined above the tag with a missing URI will have mis-mapped audio tracks. Audio track defined above the track with the missing URI attribute will be assigned the audio of the track
The expected behavior is that when a URI attribute is omitted on an HLS audio tag, the embedded audio in the stream should be used (The audio embedded in the video playlist). I have observed the manifest I am working with only produces this error on the Roku platform and not other HLS streaming services.
HLS Protocol Documentation for URI attribute on EXT-X-MEDIA tag - Source - HLS Documentation
---
Examples
########### EXAMPLE ERRORING MANIFEST
#EXTM3U
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",URI="deu_main.m3u8"LANGUAGE="deu",NAME="GERMAN",DEFAULT=NO,AUTOSELECT=YES,CHANNELS="2"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",URI="spa_main.m3u8"LANGUAGE="spa",NAME="SPANISH",DEFAULT=NO,AUTOSELECT=YES,CHANNELS="2"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",LANGUAGE="eng",NAME="ENGLISH",DEFAULT=YES,AUTOSELECT=YES,CHANNELS="2" ######## --- MISSING URI ATTRIBUTE
#EXT-X-STREAM-INF:BANDWIDTH=4076228,AVERAGE-BANDWIDTH=495071,CODECS="avc1.640029,mp4a.40.2",RESOLUTION=1920x1080,FRAME-RATE=25.000,AUDIO="audio",CLOSED-CAPTIONS=NONE
test_playlist.m3u8
In this example when the english audio track is selected in the Roku player UI, the audio playback will output in Spanish. If Spanish is selected the playback will output in German. If German is selected the the playback will output the audio embedded in the video playlist.
---
########### EXAMPLE WOKRING MANIFEST
#EXTM3U
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",URI="deu_main.m3u8"LANGUAGE="deu",NAME="GERMAN",DEFAULT=NO,AUTOSELECT=YES,CHANNELS="2"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",URI="spa_main.m3u8",LANGUAGE="spa",NAME="SPANISH",DEFAULT=NO,AUTOSELECT=YES,CHANNELS="2"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",URI="eng_main.m3u8",LANGUAGE="eng",NAME="ENGLISH",DEFAULT=YES,AUTOSELECT=YES,CHANNELS="2" ######## --- ATTRIBUTE PROVIDED
#EXT-X-STREAM-INF:BANDWIDTH=4076228,AVERAGE-BANDWIDTH=495071,CODECS="avc1.640029,mp4a.40.2",RESOLUTION=1920x1080,FRAME-RATE=25.000,AUDIO="audio",CLOSED-CAPTIONS=NONE
test_playlist.m3u8
Providing the optional URI tag will resolve this issue, but according to the HLS specs, this should not be necessary.
---
A manifest without the issue:
track w/o URI - (no issue since tag is in the first position)
track w/URI - (no issue)
track w/URI - (no issue)
track w/URI - (no issue)
A manifest which will have the issue:
track w/URI (has issue since above tag with missing URI)
track w/URI (has issue since above tag with missing URI)
track w/o URI (has issue since tag is NOT in the first position
track w/URI (no issue)