Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chromecast] smarthome:audio stream <chromecast> <m3u playlist> fails #3129

Closed
imaginator opened this issue Jan 17, 2018 · 3 comments
Closed
Labels
enhancement An enhancement or new feature for an existing add-on

Comments

@imaginator
Copy link

imaginator commented Jan 17, 2018

Expected behavior:

smarthome:audio stream chromecast:audio:lounge 'https://gist.githubusercontent.com/imaginator/de4deb96086283eaf84a1edb8838f4aa/raw/885329593b04e775215e04ad0cf80e119a9abd95/test-with-extension.m3u' (random web example)

works:

2018-01-17 13:15:07.472 [DEBUG] [omecast.internal.ChromecastScheduler] - Scheduling connection
2018-01-17 13:15:07.473 [DEBUG] [omecast.internal.ChromecastScheduler] - Canceling connection
2018-01-17 13:15:07.596 [DEBUG] [omecast.internal.ChromecastCommander] - Application launched: Application{id: CC1AD845, name: Default Media Receiver, sessionId: 3fb7db29-dde5-490a-a4c7-7769368de8b1, statusText: Ready To Cast, transportId: 3fb7db29-dde5-490a-a4c7-7769368de8b1
, isIdleScreen: false, namespaces: [Namespace{urn:x-cast:com.google.cast.debugoverlay}, Namespace{urn:x-cast:com.google.cast.broadcast}, Namespace{urn:x-cast:com.google.cast.media}]}
2018-01-17 13:15:07.779 [DEBUG] [ast.internal.ChromecastStatusUpdater] - MEDIA_STATUS MediaStatus{activeTrackIds: <null>, mediaSessionId: 1, playbackRate: 1, playerState: IDLE, currentItemId: 1, currentTime: 0.000000, customData: <null>, loadingItemId: null, items: <null>, preloadedItemId: null, supportedMediaCommands: 15, volume: Volume{level: 1.0, muted: false, increment: 0.05, stepInterval: 0.05000000074505806, controlType: null}, media: Media{url: http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio1_mf_p, contentType: audio/mpeg, duration: nul
l}, repeatMode: REPEAT_OFF, idleReason: null}
2018-01-17 13:15:07.833 [DEBUG] [omecast.internal.ChromecastScheduler] - Scheduling connection
2018-01-17 13:15:07.835 [DEBUG] [omecast.internal.ChromecastScheduler] - Canceling connection
2018-01-17 13:15:09.575 [DEBUG] [ernal.ChromecastDiscoveryParticipant] - Chromecast Type: Chromecast Audio
2018-01-17 13:15:09.575 [DEBUG] [ernal.ChromecastDiscoveryParticipant] - Chromecast Found: 10.7.11.19 8009
2018-01-17 13:15:09.576 [DEBUG] [ernal.ChromecastDiscoveryParticipant] - Chromecast Type: Chromecast Audio
2018-01-17 13:15:14.608 [DEBUG] [ast.internal.ChromecastStatusUpdater] - MEDIA_STATUS MediaStatus{activeTrackIds: <null>, mediaSessionId: 1, playbackRate: 1, playerState: PLAYING, currentItemId: 1, currentTime: 0.000000, customData: <null>, loadingItemId: null, items: <null>,
 preloadedItemId: null, supportedMediaCommands: 15, volume: Volume{level: 1.0, muted: false, increment: 0.05, stepInterval: 0.05000000074505806, controlType: null}, media: null, repeatMode: REPEAT_OFF, idleReason: null}
2018-01-17 13:15:14.853 [DEBUG] [ast.internal.ChromecastStatusUpdater] - MEDIA_STATUS MediaStatus{activeTrackIds: <null>, mediaSessionId: 1, playbackRate: 1, playerState: BUFFERING, currentItemId: 1, currentTime: 0.164690, customData: <null>, loadingItemId: null, items: [Item{id: 1, media: Media{url: http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio1_mf_p, contentType: audio/mpeg, duration: null}}], preloadedItemId: null, supportedMediaCommands: 15, volume: Volume{level: 1.0, muted: false, increment: 0.05, stepInterval: 0.05000000074505806, cont
rolType: null}, media: Media{url: http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio1_mf_p, contentType: audio/mpeg, duration: null}, repeatMode: REPEAT_OFF, idleReason: null}

smarthome:audio stream chromecast:audio:lounge 'https://gist.githubusercontent.com/imaginator/d2f5a1403bb5fee7e5b8d57ebd19e83c/raw/a378ad55f7f133e6cda1c8364d1f58dee3f48f59/test-without-extension'

without a .m3u suffix the stream fails to Application launched: Application{id: CC1AD845. See:

==> /var/log/openhab2/openhab.log <==
2018-01-17 13:13:59.503 [DEBUG] [ernal.ChromecastDiscoveryParticipant] - Chromecast Type: Chromecast Audio
2018-01-17 13:13:59.503 [DEBUG] [ernal.ChromecastDiscoveryParticipant] - Chromecast Found: 10.7.11.19 8009
2018-01-17 13:13:59.504 [DEBUG] [ernal.ChromecastDiscoveryParticipant] - Chromecast Type: Chromecast Audio
2018-01-17 13:14:02.464 [DEBUG] [omecast.internal.ChromecastScheduler] - Scheduling connection
2018-01-17 13:14:02.465 [DEBUG] [omecast.internal.ChromecastScheduler] - Canceling connection
2018-01-17 13:14:04.870 [DEBUG] [ast.internal.ChromecastStatusUpdater] - MEDIA_STATUS MediaStatus{activeTrackIds: <null>, mediaSessionId: 1, playbackRate: 1, playerState: IDLE, currentItemId: 1, currentTime: 0.000000, customData: <null>, loadingItemId: null, items: <null>, preloadedItemId: null, supportedMediaCommands: 15, volume: Volume{level: 1.0, muted: false, increment: 0.05, stepInterval: 0.05000000074505806, controlType: null}, media: Media{url: https://gist.githubusercontent.com/imaginator/d2f5a1403bb5fee7e5b8d57ebd19e83c/raw/a378ad55f7f13
3e6cda1c8364d1f58dee3f48f59/test-without-extension, contentType: audio/mpeg, duration: null}, repeatMode: null, idleReason: ERROR}
2018-01-17 13:14:05.000 [DEBUG] [omecast.internal.ChromecastCommander] - Media player app stopped
2018-01-17 13:14:05.002 [DEBUG] [ast.internal.ChromecastEventReceiver] - Unhandled event type: java.lang.Object@64f3473a
2018-01-17 13:14:06.013 [DEBUG] [ernal.ChromecastDiscoveryParticipant] - Chromecast Type: Chromecast Audio
2018-01-17 13:14:06.013 [DEBUG] [ernal.ChromecastDiscoveryParticipant] - Chromecast Found: 10.7.11.19 8009
2018-01-17 13:14:06.013 [DEBUG] [ernal.ChromecastDiscoveryParticipant] - Chromecast Type: Chromecast Audio

Additionally when passing in my own list (sourced from gmusicproxy) with the correct mime-type and CORS:

curl -v 'http://localhost:9999/get_by_search?type=album&artist=Queen&title=Greatest%20Hits'
*   Trying ::1...
* connect to ::1 port 9999 failed: Connection refused
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 9999 (#0)
> GET /get_by_search?type=album&artist=Queen&title=Greatest%20Hits HTTP/1.1
> Host: localhost:9999
> User-Agent: curl/7.47.0
> Accept: */*
>
* HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Server: BaseHTTP/0.3 Python/2.7.12
< Date: Wed, 17 Jan 2018 13:18:15 GMT
< Content-Type: audio/mpegurl
< Content-Disposition: inline; filename=playlist.m3u
< Access-Control-Allow-Origin: *
<
#EXTM3U
#EXTINF:355,Queen - Bohemian Rhapsody (Remastered 2011) - Greatest Hits (Remastered)
http://10.7.11.1:9999/get_song?id=Tbjaahrmhzktoqvcvvjfqrzg6fa
#EXTINF:215,Queen - Another One Bites The Dust (Remastered 2011) - Greatest Hits (Remastered)
http://10.7.11.1:9999/get_song?id=Ta4xlklmorqnzvt6xsefwe5mxhu
#EXTINF:179,Queen - Killer Queen (Remastered 2011) - Greatest Hits (Remastered)
http://10.7.11.1:9999/get_song?id=T44ltnwxrt75eiisj3bv3vm4xhe
...

trying to play
smarthome:audio stream chromecast:audio:lounge 'http://10.7.11.1:9999/get_by_search?type=album&artist=Queen&title=Greatest%20Hits'

leads to a:

2018-01-17 13:21:11.508 [DEBUG] [omecast.internal.ChromecastScheduler] - Scheduling connection
2018-01-17 13:21:11.509 [DEBUG] [omecast.internal.ChromecastScheduler] - Canceling connection
2018-01-17 13:21:12.968 [DEBUG] [omecast.internal.ChromecastCommander] - Application launched: Application{id: CC1AD845, name: Default Media Receiver, sessionId: 887a6ae6-ec02-4a8a-bff9-b7df6c39f4d8, statusText: Ready To Cast, transportId: 887a6ae6-ec02-4a8a-bff9-b7df6c39f4d8
, isIdleScreen: false, namespaces: [Namespace{urn:x-cast:com.google.cast.debugoverlay}, Namespace{urn:x-cast:com.google.cast.broadcast}, Namespace{urn:x-cast:com.google.cast.media}]}
2018-01-17 13:21:13.195 [DEBUG] [ast.internal.ChromecastStatusUpdater] - MEDIA_STATUS MediaStatus{activeTrackIds: <null>, mediaSessionId: 1, playbackRate: 1, playerState: IDLE, currentItemId: 1, currentTime: 0.000000, customData: <null>, loadingItemId: null, items: <null>, preloadedItemId: null, supportedMediaCommands: 15, volume: Volume{level: 1.0, muted: false, increment: 0.05, stepInterval: 0.05000000074505806, controlType: null}, media: Media{url: http://10.7.11.1:9999/get_by_search?type=album&artist=Queen&title=Greatest%20Hits, contentType:
audio/mpeg, duration: null}, repeatMode: REPEAT_OFF, idleReason: null}
2018-01-17 13:21:13.938 [DEBUG] [ernal.ChromecastDiscoveryParticipant] - Chromecast Type: Chromecast Audio
2018-01-17 13:21:13.939 [DEBUG] [ernal.ChromecastDiscoveryParticipant] - Chromecast Found: 10.7.11.19 8009
2018-01-17 13:21:13.939 [DEBUG] [ernal.ChromecastDiscoveryParticipant] - Chromecast Type: Chromecast Audio
2018-01-17 13:21:14.009 [DEBUG] [omecast.internal.ChromecastCommander] - Failed playing media: Unable to load media
2018-01-17 13:21:14.872 [DEBUG] [ast.internal.ChromecastStatusUpdater] - MEDIA_STATUS MediaStatus{activeTrackIds: <null>, mediaSessionId: 1, playbackRate: 1, playerState: IDLE, currentItemId: 1, currentTime: 0.000000, customData: <null>, loadingItemId: null, items: <null>, preloadedItemId: null, supportedMediaCommands: 15, volume: Volume{level: 1.0, muted: false, increment: 0.05, stepInterval: 0.05000000074505806, controlType: null}, media: Media{url: http://10.7.11.1:9999/get_by_search?type=album&artist=Queen&title=Greatest%20Hits, contentType:
audio/mpeg, duration: null}, repeatMode: null, idleReason: ERROR}
2018-01-17 13:21:15.009 [DEBUG] [omecast.internal.ChromecastCommander] - Media player app stopped
2018-01-17 13:21:15.013 [DEBUG] [ast.internal.ChromecastEventReceiver] - Unhandled event type: java.lang.Object@28243297
2018-01-17 13:21:16.050 [DEBUG] [ernal.ChromecastDiscoveryParticipant] - Chromecast Type: Chromecast Audio
2018-01-17 13:21:16.051 [DEBUG] [ernal.ChromecastDiscoveryParticipant] - Chromecast Found: 10.7.11.19 8009
2018-01-17 13:21:16.051 [DEBUG] [ernal.ChromecastDiscoveryParticipant] - Chromecast Type: Chromecast Audio
2018-01-17 13:21:17.988 [DEBUG] [omecast.internal.ChromecastScheduler] - Scheduling connection
2018-01-17 13:21:17.988 [DEBUG] [omecast.internal.ChromecastScheduler] - Canceling connection

So in this case we launch the application but we have a problem with the content. To double check this I stream the first track:

smarthome:audio stream chromecast:audio:lounge 'http://10.7.11.1:9999/get_song?id=Tbjaahrmhzktoqvcvvjfqrzg6fa'

which works:

2018-01-17 13:23:48.186 [DEBUG] [omecast.internal.ChromecastCommander] - Application launched: Application{id: CC1AD845, name: Default Media Receiver, sessionId: c5bc8bc8-acbc-49cf-af5d-1f79044b9f02, statusText: Ready To Cast, transportId: c5bc8bc8-acbc-49cf-af5d-1f79044b9f02, isIdleScreen: false, namespaces: [Namespace{urn:x-cast:com.google.cast.debugoverlay}, Namespace{urn:x-cast:com.google.cast.broadcast}, Namespace{urn:x-cast:com.google.cast.media}]}
2018-01-17 13:23:48.366 [DEBUG] [ast.internal.ChromecastStatusUpdater] - MEDIA_STATUS MediaStatus{activeTrackIds: <null>, mediaSessionId: 1, playbackRate: 1, playerState: IDLE, currentItemId: 1, currentTime: 0.000000, customData: <null>, loadingItemId: null, items: <null>, preloadedItemId: null, supportedMediaCommands: 15, volume: Volume{level: 1.0, muted: false, increment: 0.05, stepInterval: 0.05000000074505806, controlType: null}, media: Media{url: http://10.7.11.1:9999/get_song?id=Tbjaahrmhzktoqvcvvjfqrzg6fa, contentType: audio/mpeg, duration: null}, repeatMode: REPEAT_OFF, idleReason: null}
2018-01-17 13:23:49.860 [DEBUG] [ast.internal.ChromecastStatusUpdater] - MEDIA_STATUS MediaStatus{activeTrackIds: <null>, mediaSessionId: 1, playbackRate: 1, playerState: BUFFERING, currentItemId: 1, currentTime: 0.000000, customData: <null>, loadingItemId: null, items: <null>, preloadedItemId: null, supportedMediaCommands: 15, volume: Volume{level: 1.0, muted: false, increment: 0.05, stepInterval: 0.05000000074505806, controlType: null}, media: null, repeatMode: REPEAT_OFF, idleReason: null}
2018-01-17 13:23:50.175 [DEBUG] [ernal.ChromecastDiscoveryParticipant] - Chromecast Type: Chromecast Audio
2018-01-17 13:23:50.176 [DEBUG] [ernal.ChromecastDiscoveryParticipant] - Chromecast Found: 10.7.11.19 8009
2018-01-17 13:23:50.176 [DEBUG] [ernal.ChromecastDiscoveryParticipant] - Chromecast Type: Chromecast Audio
2018-01-17 13:23:51.882 [DEBUG] [ast.internal.ChromecastStatusUpdater] - MEDIA_STATUS MediaStatus{activeTrackIds: <null>, mediaSessionId: 1, playbackRate: 1, playerState: PLAYING, currentItemId: 1, currentTime: 0.642783, customData: <null>, loadingItemId: null, items: <null>, preloadedItemId: null, supportedMediaCommands: 15, volume: Volume{level: 1.0, muted: false, increment: 0.05, stepInterval: 0.05000000074505806, controlType: null}, media: null, repeatMode: REPEAT_OFF, idleReason: null}
2018-01-17 13:23:54.843 [DEBUG] [ast.internal.ChromecastStatusUpdater] - MEDIA_STATUS MediaStatus{activeTrackIds: <null>, mediaSessionId: 1, playbackRate: 1, playerState: PLAYING, currentItemId: 1, currentTime: 3.604311, customData: <null>, loadingItemId: null, items: [Item{id: 1, media: Media{url: http://10.7.11.1:9999/get_song?id=Tbjaahrmhzktoqvcvvjfqrzg6fa, contentType: audio/mpeg, duration: 355.500408}}], preloadedItemId: null, supportedMediaCommands: 15, volume: Volume{level: 1.0, muted: false, increment: 0.05, stepInterval: 0.05000000074505806, controlType: null}, media: Media{url: http://10.7.11.1:9999/get_song?id=Tbjaahrmhzktoqvcvvjfqrzg6fa, contentType: audio/mpeg, duration: 355.500408}, repeatMode: REPEAT_OFF, idleReason: null}
2018-01-17 13:23:58.059 [DEBUG] [omecast.internal.ChromecastScheduler] - Scheduling connection

Summary:

Between retrieving the playlist and parsing the m3u file... sadness happens:

  • Failed playing media: Unable to load media
  • [ast.internal.ChromecastEventReceiver] - Unhandled event type: java.lang.Object@4429f011

Environment:

@imaginator imaginator changed the title [chromecast] stream locally hosted m3u playlist fails [chromecast] smarthome:audio stream <chromecast fails Jan 17, 2018
@imaginator imaginator changed the title [chromecast] smarthome:audio stream <chromecast fails [chromecast] smarthome:audio stream <chromecast> <m3u playlist> fails Jan 17, 2018
@nawaidrana
Copy link

did you every get a chance to look more into it? I am having same issue and I want to be able to stream youtube music on my google chromecast things on openhab2

@cweitkamp
Copy link
Contributor

Thanks for wrapping it up nicely. According to this https://github.com/openhab/openhab2-addons/issues/1628#issuecomment-277557162 and this link Google Cast devices do not support m3u streams on its own. The ESH framework somehow was responsible for it. But I have to admit that playing a m3u file for other audio devices like Kodi does not work either. We maybe should move this issue to https://github.com/eclipse/smarthome/issues.

@davidgraeff davidgraeff added the enhancement An enhancement or new feature for an existing add-on label Mar 18, 2019
@hmerk
Copy link
Contributor

hmerk commented Jul 26, 2021

closed due to inactivity

@hmerk hmerk closed this as completed Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

No branches or pull requests

5 participants