1

I have an issue with casting some third party audio streams. I have relied heavily on https://developers.google.com/cast/docs/player and followed those instructions on how to create a custom receiver for playing the streams.

After just a second or so after starting the stream (I don't get any sound) the Cast devices freezes and they stop responding to debug via Chrome and they don't react to stopping the Cast session. Often they are so locked that even issuing a reboot via the Home app doesn't work; I have to physically disconnect the power.

It's the same behaviour on Chromecast v2 (1.22.79313), Chromecast Ultra (1.22.78017) and Google Home (1.22.78295).

What could the cause of this freeze be? Is this caused by some very broken streams? Is it a known issue? Are there any workarounds? Shouldn't one expect the Cast devices to handle this and give some error message and not crash like this?

This is the log I get from the Chrome Developer Tools before the connection is reset:

cast_receiver.js:67  [  0.268s] [cast.receiver.IpcChannel] Opening platform websocket
cast_receiver.js:67  [  0.292s] [cast.receiver.CastReceiverManager] Version: 2.0.0.0049
cast_receiver.js:67  [  0.305s] [cast.receiver.MediaManager] Using default Player
cast_receiver.js:67  [  0.314s] [cast.receiver.IpcChannel] Opening message bus websocket
cast_receiver.js:67  [  0.322s] [cast.receiver.IpcChannel] IpcChannel opened
cast_receiver.js:67  [  0.326s] [cast.receiver.CastMessageBus] Dispatching CastMessageBus message
cast_receiver.js:67  [  0.333s] [cast.receiver.CastReceiverManager] Underlying message bus is open
[...]
media_player.js:25  [  0.628s] [cast.player.api.Player] Version: 1.0.0.40
[...]
media_player.js:25  [  6.682s] [cast.player.api.Player] load
media_player.js:25  [  6.707s] [goog.net.XhrIo] Opening Xhr [GET http://thirdpartyserver.example.com/playlist.m3u8 -1]
media_player.js:25  [  6.721s] [goog.net.XhrIo] Will abort after 30000ms if incomplete, xhr2 false [GET http://thirdpartyserver.example.com/playlist.m3u8 -1]
media_player.js:25  [  6.725s] [goog.net.XhrIo] Sending request [GET http://thirdpartyserver.example.com/playlist.m3u8 -1]
media_player.js:51 Mixed Content: The page at 'https://example.com/custom_receiver.html?debug=true' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://thirdpartyserver.example.com/playlist.m3u8'. This content should also be served over HTTPS.
media_player.js:25  [  6.735s] [cast.player.core.MediaSourceManager] open
media_player.js:25  [  6.923s] [goog.net.XhrIo] Request complete [GET http://thirdpartyserver.example.com/playlist.m3u8 200]
media_player.js:25  [  6.975s] [cast.player.core.QualityManager] 0: initial 82625
media_player.js:25  [  6.986s] [cast.player.hls.Playlist] update: http://thirdpartyserver.example.com/chunklist_w941582493.m3u8
media_player.js:25  [  6.993s] [goog.net.XhrIo] Opening Xhr [GET http://thirdpartyserver.example.com/chunklist_w941582493.m3u8 -1]
media_player.js:25  [  6.999s] [goog.net.XhrIo] Will abort after 30000ms if incomplete, xhr2 false [GET http://thirdpartyserver.example.com/chunklist_w941582493.m3u8 -1]
media_player.js:25  [  7.004s] [goog.net.XhrIo] Sending request [GET http://thirdpartyserver.example.com/chunklist_w941582493.m3u8 -1]
media_player.js:51 Mixed Content: The page at 'https://example.com/custom_receiver.html?debug=true' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://thirdpartyserver.example.com/chunklist_w941582493.m3u8'. This content should also be served over HTTPS.
media_player.js:25  [  7.127s] [goog.net.XhrIo] Request complete [GET http://thirdpartyserver.example.com/chunklist_w941582493.m3u8 200]
media_player.js:25  [  7.140s] [cast.player.hls.Playlist] update in: 3000
media_player.js:25  [  7.161s] [cast.player.core.SegmentManager] 0: seek success 0
media_player.js:25  [  7.169s] [goog.net.XhrIo] Opening Xhr [GET http://thirdpartyserver.example.com/media_w941582493_4220443.aac -1]
media_player.js:25  [  7.174s] [goog.net.XhrIo] Will abort after 10000ms if incomplete, xhr2 false [GET http://thirdpartyserver.example.com/media_w941582493_4220443.aac -1]
media_player.js:25  [  7.180s] [goog.net.XhrIo] Sending request [GET http://thirdpartyserver.example.com/media_w941582493_4220443.aac -1]
media_player.js:51 Mixed Content: The page at 'https://example.com/custom_receiver.html?debug=true' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://thirdpartyserver.example.com/media_w941582493_4220443.aac'. This content should also be served over HTTPS.
media_player.js:25  [  7.311s] [goog.net.XhrIo] Request complete [GET http://thirdpartyserver.example.com/media_w941582493_4220443.aac 200]
media_player.js:25  [  7.322s] [cast.player.core.QualityManager] 0: current=1018961.04, average=1444314.43
media_player.js:25  [  7.330s] [cast.player.core.SegmentManager] 0: process segment
media_player.js:25  [  7.338s] [cast.player.hls.Adaptation] process segment
media_player.js:25  [  7.357s] [cast.player.core.SegmentManager] 0: segment processed
media_player.js:25  [  7.363s] [cast.player.core.SourceBufferManager] 0: queue append
media_player.js:25  [  7.382s] [goog.net.XhrIo] Opening Xhr [GET http://thirdpartyserver.example.com/media_w941582493_4220444.aac -1]
media_player.js:25  [  7.387s] [goog.net.XhrIo] Will abort after 10000ms if incomplete, xhr2 false [GET http://thirdpartyserver.example.com/media_w941582493_4220444.aac -1]
media_player.js:25  [  7.392s] [goog.net.XhrIo] Sending request [GET http://thirdpartyserver.example.com/media_w941582493_4220444.aac -1]
media_player.js:51 Mixed Content: The page at 'https://example.com/custom_receiver.html?debug=true' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://thirdpartyserver.example.com/media_w941582493_4220444.aac'. This content should also be served over HTTPS.
media_player.js:25  [  7.515s] [goog.net.XhrIo] Request complete [GET http://thirdpartyserver.example.com/media_w941582493_4220444.aac 200]
media_player.js:25  [  7.521s] [cast.player.core.QualityManager] 0: current=1113553.96, average=1179706.05
media_player.js:25  [  7.528s] [cast.player.core.SegmentManager] 0: process segment
media_player.js:25  [  7.533s] [cast.player.hls.Adaptation] process segment

Update - more info:

The response headers for that first request (playlist.m3u8) are as follows:

Accept-Ranges:bytes
Access-Control-Allow-Credentials:true
Access-Control-Allow-Headers:Content-Type, User-Agent, If-Modified-Since, Cache-Control, Range
Access-Control-Allow-Methods:OPTIONS, GET, POST, HEAD
Access-Control-Allow-Origin:*
Access-Control-Expose-Headers:Date, Server, Content-Type, Content-Length
Cache-Control:no-cache
Content-Length:105
Content-Type:application/vnd.apple.mpegurl
Date:Tue, 21 Mar 2017 13:44:37 GMT
Server:WowzaStreamingEngine/4.5.0

The response body for that first request (playlist.m3u8) is as follows:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=80053,CODECS="mp4a.40.2"
chunklist_w941582493.m3u8

The response headers for that second request (chunklist_w941582493.m3u8) are as follows:

Accept-Ranges:bytes
Access-Control-Allow-Credentials:true
Access-Control-Allow-Headers:Content-Type, User-Agent, If-Modified-Since, Cache-Control, Range
Access-Control-Allow-Methods:OPTIONS, GET, POST, HEAD
Access-Control-Allow-Origin:*
Access-Control-Expose-Headers:Date, Server, Content-Type, Content-Length
Cache-Control:no-cache
Content-Length:213
Content-Type:application/vnd.apple.mpegurl
Date:Tue, 21 Mar 2017 13:44:37 GMT
Server:WowzaStreamingEngine/4.5.0

The response body for that second request (chunklist_w941582493.m3u8) is typical something as follows:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:3
#EXT-X-MEDIA-SEQUENCE:4272014
#EXTINF:1.95,
media_w1552860397_4272014.aac
#EXTINF:2.09,
media_w1552860397_4272015.aac
#EXTINF:1.95,
media_w1552860397_4272016.aac

The response headers for that second request (media_w941582493_4220443.aac) are as follows:

Accept-Ranges:bytes
Access-Control-Allow-Credentials:true
Access-Control-Allow-Headers:Content-Type, User-Agent, If-Modified-Since, Cache-Control, Range
Access-Control-Allow-Methods:OPTIONS, GET, POST, HEAD
Access-Control-Allow-Origin:*
Access-Control-Expose-Headers:Date, Server, Content-Type, Content-Length
Cache-Control:no-cache
Content-Length:19757
Content-Type:audio/x-aac
Date:Tue, 21 Mar 2017 13:44:37 GMT
Server:WowzaStreamingEngine/4.5.0
6
  • Does that happen with a Styled or the Default receiver, too?
    – Ali Naddaf
    Commented Mar 20, 2017 at 15:42
  • Actually, with a styled media receiver I only get the log statement "[cast.receiver.MediaManager] Load metadata error: [object Object] cast_receiver.js:67". According to the network tab in Chrome dev tools there's only one network call towards the stream and it returns HTTP 200. The receiver does not play anything, but it does not freeze and it still lets me disconnect. Commented Mar 20, 2017 at 20:04
  • I suggests you open a ticket on our sdk issue tracker and include a sample stream that can produce the result.
    – Ali Naddaf
    Commented Mar 20, 2017 at 21:11
  • Thank you, @AliNaddaf. I'll do that. I'm just trying to get verified that the server software is up to date and should be able to work and that everything is set up as it should be. However, I have now added more header and body info. You don't happen see anything suspect, do you? Commented Mar 21, 2017 at 14:05
  • Nothing jumps at me
    – Ali Naddaf
    Commented Mar 21, 2017 at 15:49

1 Answer 1

3

Searching the bug tracker for the Google Cast SDK I found a relevant bug report.

All I had to do was to add cast.player.api.HlsSegmentFormat.MPEG_AUDIO_ES to cast.player.api.CreateHlsStreamingProtocol(). Now the stream works just fine and the Cast devices don't crash or freeze.

Not the answer you're looking for? Browse other questions tagged or ask your own question.