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 slow buffering #16319

Closed
vladosam opened this issue Aug 31, 2018 · 19 comments
Closed

Chromecast slow buffering #16319

vladosam opened this issue Aug 31, 2018 · 19 comments

Comments

@vladosam
Copy link

Home Assistant release with the issue: 0.76.2

Last working Home Assistant release (if known):

Operating environment (Hass.io/Docker/Windows/etc.): Linux/Venv

Component/platform: https://www.home-assistant.io/components/cast/

Description of problem: Slow buffering of web radio station. It waits 10 - 15 seconds sometimes more before playing. Google TTS plays almost instantly.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

    - service: tts.google_say
      data_template:
        entity_id: media_player.chromecastaudio0667
        message: >
           {% if is_state("input_select.radio_station", "Antena") %} "Next station: Antena"
           {% elif is_state("input_select.radio_station", "Radio Sarajevo") %} "Next station: Radio Sarajevo"
           {% elif is_state("input_select.radio_station", "Soma FM") %} "Next station: Soma FM
           {% elif is_state("input_select.radio_station", "Alt Rock") %} "Next station: Alternative rock
           {% elif is_state("input_select.radio_station", "Classic FM") %} "Next station: Classic FM
           {% elif is_state("input_select.radio_station", "Sleep Radio") %} "Next station: Sleep radio"
           {% elif is_state("input_select.radio_station", "Ambient Sleeping Pill") %} "Next station: Sleeping pill"
           {% elif is_state("input_select.radio_station", "Sleep Radio") %} "Next station: Sleep radio"
           {% elif is_state("input_select.radio_station", "Radio Art - Sleep") %} "Next station: Radio art"
           {% elif is_state("input_select.radio_station", "Ambi Nature Radio") %} "Next station: Nature radio"
           {% elif is_state("input_select.radio_station", "Calm Radio - Sleep") %} "Next station: Calm radio"
           {% endif %}
    - delay: '00:00:06'
    - service: media_player.play_media
      data_template:
        entity_id: media_player.chromecastaudio0667
        media_content_id: >
          {% if is_state("input_select.radio_station", "Antena") %} http://195.222.57.33:8070/stream.mp3
          {% elif is_state("input_select.radio_station", "Radio Sarajevo") %} http://malla.softnet.si:8000/live.mp3
          {% elif is_state("input_select.radio_station", "Soma FM") %} http://ice1.somafm.com/indiepop-128-aac
          {% elif is_state("input_select.radio_station", "Alt Rock") %} http://149.56.23.7:20254/stream
          {% elif is_state("input_select.radio_station", "Classic FM") %} http://19143.live.streamtheworld.com/CLASSICFM_SC
          {% elif is_state("input_select.radio_station", "Sleep Radio") %} http://37.59.28.208:8722/stream
          {% elif is_state("input_select.radio_station", "Ambient Sleeping Pill") %} http://perseus.shoutca.st:8447/h
          {% elif is_state("input_select.radio_station", "Sleep Radio") %} http://37.59.28.208:8722/stream
          {% elif is_state("input_select.radio_station", "Radio Art - Sleep") %} http://live.radioart.com/fSleep.mp3
          {% elif is_state("input_select.radio_station", "Ambi Nature Radio") %} http://94.23.252.14:8067/stream
          {% elif is_state("input_select.radio_station", "Calm Radio - Sleep") %} http://streams.calmradio.com/api/39/128/stream
          {% endif %}
        media_content_type: 'music'

Traceback (if applicable):


Additional information:

2018-08-31 09:13:56 INFO (SyncWorker_4) [pychromecast.controllers] Receiver:setting volume to 0.1
2018-08-31 09:13:56 DEBUG (SyncWorker_4) [pychromecast.socket_client] Sending: Message urn:x-cast:com.google.cast.receiver from sender-0 to receiver-0: {'type': 'SET_VOLUME', 'volume': {'level': 0.15}, 'requestId': 283}
2018-08-31 09:13:56 DEBUG (SyncWorker_3) [pychromecast.controllers] Receiver:Updating status
2018-08-31 09:13:56 DEBUG (SyncWorker_3) [pychromecast.socket_client] Sending: Message urn:x-cast:com.google.cast.receiver from sender-0 to receiver-0: {'type': 'GET_STATUS', 'requestId': 284}
2018-08-31 09:13:56 DEBUG (Thread-5) [pychromecast.socket_client] Received: Message urn:x-cast:com.google.cast.receiver from receiver-0 to sender-0: {'requestId': 284, 'status': {'userEq': {'high_shelf': {'frequency': 4500.0, 'gain_db': 0.0, 'quality': 0.707}, 'low_shelf': {'frequency': 150.0, 'gain_db': 0.0, 'quality': 0.707}, 'max_peaking_eqs': 0, 'peaking_eqs': []}, 'volume': {'controlType': 'master', 'level': 0.15000000596046448, 'muted': False, 'stepInterval': 0.019999999552965164}}, 'type': 'RECEIVER_STATUS'}
2018-08-31 09:13:56 DEBUG (Thread-5) [pychromecast.controllers] Received status: CastStatus(is_active_input=None, is_stand_by=None, volume_level=0.15000000596046448, volume_muted=False, app_id=None, display_name=None, namespaces=[], session_id=None, transport_id=None, status_text='')
2018-08-31 09:13:56 INFO (Thread-5) [pychromecast.controllers] Receiver:Launching app CC1AD845
2018-08-31 09:13:56 DEBUG (Thread-5) [pychromecast.socket_client] Sending: Message urn:x-cast:com.google.cast.receiver from sender-0 to receiver-0: {'type': 'LAUNCH', 'appId': 'CC1AD845', 'requestId': 285}
2018-08-31 09:13:57 DEBUG (Thread-5) [pychromecast.socket_client] Received: Message urn:x-cast:com.google.cast.receiver from receiver-0 to sender-0: {'requestId': 283, 'status': {'userEq': {'high_shelf': {'frequency': 4500.0, 'gain_db': 0.0, 'quality': 0.707}, 'low_shelf': {'frequency': 150.0, 'gain_db': 0.0, 'quality': 0.707}, 'max_peaking_eqs': 0, 'peaking_eqs': []}, 'volume': {'controlType': 'master', 'level': 0.15000000596046448, 'muted': False, 'stepInterval': 0.019999999552965164}}, 'type': 'RECEIVER_STATUS'}
2018-08-31 09:13:57 DEBUG (Thread-5) [pychromecast.controllers] Received status: CastStatus(is_active_input=None, is_stand_by=None, volume_level=0.15000000596046448, volume_muted=False, app_id=None, display_name=None, namespaces=[], session_id=None, transport_id=None, status_text='')
2018-08-31 09:13:58 DEBUG (Thread-5) [pychromecast.socket_client] Received: Message urn:x-cast:com.google.cast.receiver from receiver-0 to *: {'requestId': 285, 'status': {'applications': [{'appId': 'CC1AD845', 'displayName': 'Default Media Receiver', 'isIdleScreen': False, 'launchedFromCloud': False, 'namespaces': [{'name': 'urn:x-cast:com.google.cast.cac'}, {'name': 'urn:x-cast:com.google.cast.broadcast'}, {'name': 'urn:x-cast:com.google.cast.media'}], 'sessionId': '6e4cad47-cf32-4605-83ff-facc9036bc1d', 'statusText': 'Default Media Receiver', 'transportId': '6e4cad47-cf32-4605-83ff-facc9036bc1d'}], 'userEq': {'high_shelf': {'frequency': 4500.0, 'gain_db': 0.0, 'quality': 0.707}, 'low_shelf': {'frequency': 150.0, 'gain_db': 0.0, 'quality': 0.707}, 'max_peaking_eqs': 0, 'peaking_eqs': []}, 'volume': {'controlType': 'master', 'level': 0.15000000596046448, 'muted': False, 'stepInterval': 0.019999999552965164}}, 'type': 'RECEIVER_STATUS'}
2018-08-31 09:13:58 DEBUG (Thread-5) [pychromecast.controllers] Received status: CastStatus(is_active_input=None, is_stand_by=None, volume_level=0.15000000596046448, volume_muted=False, app_id='CC1AD845', display_name='Default Media Receiver', namespaces=['urn:x-cast:com.google.cast.cac', 'urn:x-cast:com.google.cast.broadcast', 'urn:x-cast:com.google.cast.media'], session_id='6e4cad47-cf32-4605-83ff-facc9036bc1d', transport_id='6e4cad47-cf32-4605-83ff-facc9036bc1d', status_text='Default Media Receiver')
2018-08-31 09:13:58 DEBUG (Thread-5) [pychromecast.socket_client] Sending: Message urn:x-cast:com.google.cast.tp.connection from sender-0 to 6e4cad47-cf32-4605-83ff-facc9036bc1d: {'type': 'CONNECT', 'origin': {}, 'userAgent': 'PyChromecast', 'senderInfo': {'sdkType': 2, 'version': '15.605.1.3', 'browserVersion': '44.0.2403.30', 'platform': 4, 'systemVersion': 'Macintosh; Intel Mac OS X10_10_3', 'connectionType': 1}}
2018-08-31 09:13:58 DEBUG (Thread-5) [pychromecast.socket_client] Sending: Message urn:x-cast:com.google.cast.media from sender-0 to 6e4cad47-cf32-4605-83ff-facc9036bc1d: {'type': 'GET_STATUS', 'requestId': 286}
2018-08-31 09:13:58 DEBUG (Thread-5) [pychromecast.controllers] Start app_launch_event_function...
2018-08-31 09:13:58 DEBUG (Thread-5) [pychromecast.socket_client] Sending: Message urn:x-cast:com.google.cast.media from sender-0 to 6e4cad47-cf32-4605-83ff-facc9036bc1d: {'media': {'contentId': 'http://192.168.1.250:8123/api/tts_proxy/65b91b94770dc101405423179bca45c6ada91604_en_-_google.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}}, 'type': 'LOAD', 'currentTime': 0, 'autoplay': True, 'customData': {}, 'requestId': 287, 'sessionId': '6e4cad47-cf32-4605-83ff-facc9036bc1d'}
2018-08-31 09:13:58 DEBUG (Thread-5) [pychromecast.socket_client] Received: Message urn:x-cast:com.google.cast.media from 6e4cad47-cf32-4605-83ff-facc9036bc1d to *: {'type': 'MEDIA_STATUS', 'status': [], 'requestId': 0}
2018-08-31 09:13:58 DEBUG (Thread-5) [pychromecast.controllers] Media:Received status {'type': 'MEDIA_STATUS', 'status': [], 'requestId': 0}
2018-08-31 09:13:58 DEBUG (Thread-5) [pychromecast.socket_client] Received: Message urn:x-cast:com.google.cast.media from 6e4cad47-cf32-4605-83ff-facc9036bc1d to sender-0: {'type': 'MEDIA_STATUS', 'status': [], 'requestId': 286}
2018-08-31 09:13:58 DEBUG (Thread-5) [pychromecast.controllers] Media:Received status {'type': 'MEDIA_STATUS', 'status': [], 'requestId': 286}
2018-08-31 09:13:58 DEBUG (Thread-5) [pychromecast.socket_client] Received: Message urn:x-cast:com.google.cast.media from 6e4cad47-cf32-4605-83ff-facc9036bc1d to *: {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'IDLE', 'currentTime': 0, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'media': {'contentId': 'http://192.168.1.250:8123/api/tts_proxy/65b91b94770dc101405423179bca45c6ada91604_en_-_google.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}}, 'currentItemId': 1, 'extendedStatus': {'playerState': 'LOADING', 'media': {'contentId': 'http://192.168.1.250:8123/api/tts_proxy/65b91b94770dc101405423179bca45c6ada91604_en_-_google.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}}}, 'repeatMode': 'REPEAT_OFF'}], 'requestId': 0}
2018-08-31 09:13:58 DEBUG (Thread-5) [pychromecast.controllers] Media:Received status {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'IDLE', 'currentTime': 0, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'media': {'contentId': 'http://192.168.1.250:8123/api/tts_proxy/65b91b94770dc101405423179bca45c6ada91604_en_-_google.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}}, 'currentItemId': 1, 'extendedStatus': {'playerState': 'LOADING', 'media': {'contentId': 'http://192.168.1.250:8123/api/tts_proxy/65b91b94770dc101405423179bca45c6ada91604_en_-_google.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}}}, 'repeatMode': 'REPEAT_OFF'}], 'requestId': 0}
2018-08-31 09:13:58 DEBUG (Thread-5) [pychromecast.socket_client] Received: Message urn:x-cast:com.google.cast.media from 6e4cad47-cf32-4605-83ff-facc9036bc1d to *: {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'PLAYING', 'currentTime': 0, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'media': {'contentId': 'http://192.168.1.250:8123/api/tts_proxy/65b91b94770dc101405423179bca45c6ada91604_en_-_google.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}, 'duration': 1.896, 'tracks': [{'trackId': 1, 'type': 'VIDEO'}], 'breakClips': [], 'breaks': []}, 'currentItemId': 1, 'items': [{'itemId': 1, 'media': {'contentId': 'http://192.168.1.250:8123/api/tts_proxy/65b91b94770dc101405423179bca45c6ada91604_en_-_google.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}, 'duration': 1.896}, 'autoplay': True, 'customData': {}}], 'repeatMode': 'REPEAT_OFF'}], 'requestId': 287}
2018-08-31 09:13:58 DEBUG (Thread-5) [pychromecast.controllers] Media:Received status {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'PLAYING', 'currentTime': 0, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'media': {'contentId': 'http://192.168.1.250:8123/api/tts_proxy/65b91b94770dc101405423179bca45c6ada91604_en_-_google.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}, 'duration': 1.896, 'tracks': [{'trackId': 1, 'type': 'VIDEO'}], 'breakClips': [], 'breaks': []}, 'currentItemId': 1, 'items': [{'itemId': 1, 'media': {'contentId': 'http://192.168.1.250:8123/api/tts_proxy/65b91b94770dc101405423179bca45c6ada91604_en_-_google.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}, 'duration': 1.896}, 'autoplay': True, 'customData': {}}], 'repeatMode': 'REPEAT_OFF'}], 'requestId': 287}
2018-08-31 09:13:59 DEBUG (Thread-5) [pychromecast.socket_client] Received: Message urn:x-cast:com.google.cast.media from 6e4cad47-cf32-4605-83ff-facc9036bc1d to *: {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'BUFFERING', 'currentTime': 0.345018, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'currentItemId': 1, 'repeatMode': 'REPEAT_OFF'}], 'requestId': 0}
2018-08-31 09:13:59 DEBUG (Thread-5) [pychromecast.controllers] Media:Received status {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'BUFFERING', 'currentTime': 0.345018, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'currentItemId': 1, 'repeatMode': 'REPEAT_OFF'}], 'requestId': 0}
2018-08-31 09:14:00 DEBUG (Thread-5) [pychromecast.socket_client] Received: Message urn:x-cast:com.google.cast.media from 6e4cad47-cf32-4605-83ff-facc9036bc1d to *: {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'PLAYING', 'currentTime': 1.357983, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'currentItemId': 1, 'repeatMode': 'REPEAT_OFF'}], 'requestId': 0}
2018-08-31 09:14:00 DEBUG (Thread-5) [pychromecast.controllers] Media:Received status {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'PLAYING', 'currentTime': 1.357983, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'currentItemId': 1, 'repeatMode': 'REPEAT_OFF'}], 'requestId': 0}
2018-08-31 09:14:01 DEBUG (Thread-5) [pychromecast.socket_client] Received: Message urn:x-cast:com.google.cast.media from 6e4cad47-cf32-4605-83ff-facc9036bc1d to *: {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'IDLE', 'currentTime': 0, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'currentItemId': 1, 'idleReason': 'FINISHED'}], 'requestId': 0}
2018-08-31 09:14:01 DEBUG (Thread-5) [pychromecast.controllers] Media:Received status {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'IDLE', 'currentTime': 0, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'currentItemId': 1, 'idleReason': 'FINISHED'}], 'requestId': 0}
2018-08-31 09:14:03 INFO (SyncWorker_19) [pychromecast.controllers] Not launching app CC1AD845 - already running
2018-08-31 09:14:03 DEBUG (SyncWorker_19) [pychromecast.socket_client] Sending: Message urn:x-cast:com.google.cast.media from sender-0 to 6e4cad47-cf32-4605-83ff-facc9036bc1d: {'media': {'contentId': 'http://195.222.57.33:8070/stream.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}}, 'type': 'LOAD', 'currentTime': 0, 'autoplay': True, 'customData': {}, 'requestId': 289, 'sessionId': '6e4cad47-cf32-4605-83ff-facc9036bc1d'}
2018-08-31 09:14:03 DEBUG (Thread-5) [pychromecast.socket_client] Received: Message urn:x-cast:com.google.cast.media from 6e4cad47-cf32-4605-83ff-facc9036bc1d to *: {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 2, 'playbackRate': 1, 'playerState': 'IDLE', 'currentTime': 0, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'media': {'contentId': 'http://195.222.57.33:8070/stream.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}}, 'currentItemId': 2, 'extendedStatus': {'playerState': 'LOADING', 'media': {'contentId': 'http://195.222.57.33:8070/stream.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}}}, 'repeatMode': 'REPEAT_OFF'}], 'requestId': 0}
2018-08-31 09:14:03 DEBUG (Thread-5) [pychromecast.controllers] Media:Received status {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 2, 'playbackRate': 1, 'playerState': 'IDLE', 'currentTime': 0, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'media': {'contentId': 'http://195.222.57.33:8070/stream.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}}, 'currentItemId': 2, 'extendedStatus': {'playerState': 'LOADING', 'media': {'contentId': 'http://195.222.57.33:8070/stream.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}}}, 'repeatMode': 'REPEAT_OFF'}], 'requestId': 0}
2018-08-31 09:14:03 DEBUG (Thread-5) [pychromecast.socket_client] Received: Message urn:x-cast:com.google.cast.media from 6e4cad47-cf32-4605-83ff-facc9036bc1d to *: {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 2, 'playbackRate': 1, 'playerState': 'BUFFERING', 'currentTime': 0, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'media': {'contentId': 'http://195.222.57.33:8070/stream.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}, 'duration': None, 'tracks': [{'trackId': 1, 'type': 'VIDEO'}], 'breakClips': [], 'breaks': []}, 'currentItemId': 2, 'items': [{'itemId': 2, 'media': {'contentId': 'http://195.222.57.33:8070/stream.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}, 'duration': None}, 'autoplay': True, 'customData': {}}], 'repeatMode': 'REPEAT_OFF'}], 'requestId': 289}
2018-08-31 09:14:03 DEBUG (Thread-5) [pychromecast.controllers] Media:Received status {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 2, 'playbackRate': 1, 'playerState': 'BUFFERING', 'currentTime': 0, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'media': {'contentId': 'http://195.222.57.33:8070/stream.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}, 'duration': None, 'tracks': [{'trackId': 1, 'type': 'VIDEO'}], 'breakClips': [], 'breaks': []}, 'currentItemId': 2, 'items': [{'itemId': 2, 'media': {'contentId': 'http://195.222.57.33:8070/stream.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}, 'duration': None}, 'autoplay': True, 'customData': {}}], 'repeatMode': 'REPEAT_OFF'}], 'requestId': 289}
2018-08-31 09:14:32 DEBUG (Thread-5) [pychromecast.socket_client] Received: Message urn:x-cast:com.google.cast.media from 6e4cad47-cf32-4605-83ff-facc9036bc1d to *: {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 2, 'playbackRate': 1, 'playerState': 'PLAYING', 'currentTime': 0.587233, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'currentItemId': 2, 'repeatMode': 'REPEAT_OFF'}], 'requestId': 0}
2018-08-31 09:14:32 DEBUG (Thread-5) [pychromecast.controllers] Media:Received status {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 2, 'playbackRate': 1, 'playerState': 'PLAYING', 'currentTime': 0.587233, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'currentItemId': 2, 'repeatMode': 'REPEAT_OFF'}], 'requestId': 0}
2018-08-31 09:15:08 DEBUG (SyncWorker_0) [pychromecast.socket_client] Sending: Message urn:x-cast:com.google.cast.media from sender-0 to 6e4cad47-cf32-4605-83ff-facc9036bc1d: {'type': 'STOP', 'mediaSessionId': 2, 'requestId': 296, 'sessionId': '6e4cad47-cf32-4605-83ff-facc9036bc1d'}
2018-08-31 09:15:08 DEBUG (Thread-5) [pychromecast.socket_client] Received: Message urn:x-cast:com.google.cast.media from 6e4cad47-cf32-4605-83ff-facc9036bc1d to *: {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 2, 'playbackRate': 1, 'playerState': 'IDLE', 'currentTime': 0, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'currentItemId': 2, 'idleReason': 'CANCELLED'}], 'requestId': 296}
2018-08-31 09:15:08 DEBUG (Thread-5) [pychromecast.controllers] Media:Received status {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 2, 'playbackRate': 1, 'playerState': 'IDLE', 'currentTime': 0, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'currentItemId': 2, 'idleReason': 'CANCELLED'}], 'requestId': 296}
@e1miran
Copy link

e1miran commented Sep 27, 2018

I can confirm this behavior. In my case latency average is around 30+ seconds.

@awarecan
Copy link
Contributor

Try to change your media_content_type to audio/mpeg

Another parameter is stream_type, which is fixed to BUFFERED now. You can try to change it to LIVE

--- a/homeassistant/components/media_player/cast.py
+++ b/homeassistant/components/media_player/cast.py
@@ -509,7 +509,7 @@ class CastDevice(MediaPlayerDevice):

     def play_media(self, media_type, media_id, **kwargs):
         """Play media from a URL."""
-        self._chromecast.media_controller.play_media(media_id, media_type)
+        self._chromecast.media_controller.play_media(media_id, media_type, stream_type='LIVE')

     # ========== Properties ==========
     @property

@e1miran
Copy link

e1miran commented Sep 27, 2018

I get an error when trying to use the stream_type parameter:
Invalid service data for media_player.play_media: extra keys not allowed @ data['stream_type']. Got 'LIVE'

@awarecan
Copy link
Contributor

awarecan commented Sep 27, 2018

Are you following my change?

I will ask you to change service data if it can be changed in there, which is NOT.
If you want to try the fix, please apply my patch to your local installed homeassistant, it maybe in /srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/media_player/cast.py depends on how you installed homeassistant

@e1miran
Copy link

e1miran commented Sep 27, 2018

Sorry... I misunderstood. I added the parameter to the play_media call. I didn't make a change to the cast.py component itself. I use HASSIO and don't think I can (don't know how to) access the component itself.

@e1miran
Copy link

e1miran commented Sep 27, 2018

So, looks like I need to add it as a custom component and make the change. I'll get back with the results once done.

@e1miran
Copy link

e1miran commented Sep 27, 2018

So I made the change to the cast.py file, within the play_media() method (line 512). I also changed media_content_type from audio/mp4 to audio/mpeg. It didn't make much of a difference.

@vladosam
Copy link
Author

@awarecan i also tried your patch with same result as @e1miran. Slow buffering remains.

@balloobbot
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

@e1miran
Copy link

e1miran commented Feb 5, 2019

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

Latest version is installed. Issue still persists.

@plantoschka
Copy link

I also have the same issue. I'm using a Google Home Mini as an alarm clock and want to use a radio station as wake up music after some TTS. But it takes up to 60 seconds before audio is playing.

@emontnemery
Copy link
Contributor

emontnemery commented Mar 25, 2019

It's most likely an issue with pychromecast not sending the right parameters to the cast for a live stream.
A workaround is to send a play command manually a few seconds after sending the play_media.

@vladosam, @e1miran, @plantoschka can you try adding something like this at the end of your automation:

  action:
    - service: media_player.play_media
      entity_id: media_player.living_room
      data:
        media_content_id: "http://malla.softnet.si:8000/live.mp3"
        media_content_type: music
    - delay: '00:00:05'
    - service: media_player.media_play
      entity_id: media_player.living_room

@vladosam
Copy link
Author

@emontnemery i don't see any change in adding media_player.play to automation. For eq. this stream starts almost immediately http://159.69.156.220:9020/stream.mp3 but this have 15 seconds delay http://malla.softnet.si:8000/live.mp3

@jcoin
Copy link

jcoin commented Mar 25, 2019

@emontnemery :

Tried you workaround on my automation ( via node-red) : added a call to media_player.media_play

The delay, which was up to 30 sec. in my case went down to 5 or 6 seconds, which is definitively an improvement

In my case, i try to play a stream from a local icecast

@emontnemery
Copy link
Contributor

@vladosam I updated the action example to be a bit more precise. Can you try it again?

@vladosam
Copy link
Author

@emontnemery it is late here so i'll try that tomorrow. :)

@vladosam
Copy link
Author

@emontnemery no change even with updated example. :(

muammar added a commit to muammar/mkchromecast that referenced this issue Apr 7, 2019
According to
home-assistant/core#16319 this
commit should help with delay. It helped me to go from 17 seconds to
3 seconds delay when using chromecast. Related to #221, #61 and
  probably #104.
@stale
Copy link

stale bot commented Jul 7, 2019

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@denisjoshua
Copy link

Home Assistant release with the issue: 0.76.2

Last working Home Assistant release (if known):

Operating environment (Hass.io/Docker/Windows/etc.): Linux/Venv

Component/platform: https://www.home-assistant.io/components/cast/

Description of problem: Slow buffering of web radio station. It waits 10 - 15 seconds sometimes more before playing. Google TTS plays almost instantly.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

    - service: tts.google_say
      data_template:
        entity_id: media_player.chromecastaudio0667
        message: >
           {% if is_state("input_select.radio_station", "Antena") %} "Next station: Antena"
           {% elif is_state("input_select.radio_station", "Radio Sarajevo") %} "Next station: Radio Sarajevo"
           {% elif is_state("input_select.radio_station", "Soma FM") %} "Next station: Soma FM
           {% elif is_state("input_select.radio_station", "Alt Rock") %} "Next station: Alternative rock
           {% elif is_state("input_select.radio_station", "Classic FM") %} "Next station: Classic FM
           {% elif is_state("input_select.radio_station", "Sleep Radio") %} "Next station: Sleep radio"
           {% elif is_state("input_select.radio_station", "Ambient Sleeping Pill") %} "Next station: Sleeping pill"
           {% elif is_state("input_select.radio_station", "Sleep Radio") %} "Next station: Sleep radio"
           {% elif is_state("input_select.radio_station", "Radio Art - Sleep") %} "Next station: Radio art"
           {% elif is_state("input_select.radio_station", "Ambi Nature Radio") %} "Next station: Nature radio"
           {% elif is_state("input_select.radio_station", "Calm Radio - Sleep") %} "Next station: Calm radio"
           {% endif %}
    - delay: '00:00:06'
    - service: media_player.play_media
      data_template:
        entity_id: media_player.chromecastaudio0667
        media_content_id: >
          {% if is_state("input_select.radio_station", "Antena") %} http://195.222.57.33:8070/stream.mp3
          {% elif is_state("input_select.radio_station", "Radio Sarajevo") %} http://malla.softnet.si:8000/live.mp3
          {% elif is_state("input_select.radio_station", "Soma FM") %} http://ice1.somafm.com/indiepop-128-aac
          {% elif is_state("input_select.radio_station", "Alt Rock") %} http://149.56.23.7:20254/stream
          {% elif is_state("input_select.radio_station", "Classic FM") %} http://19143.live.streamtheworld.com/CLASSICFM_SC
          {% elif is_state("input_select.radio_station", "Sleep Radio") %} http://37.59.28.208:8722/stream
          {% elif is_state("input_select.radio_station", "Ambient Sleeping Pill") %} http://perseus.shoutca.st:8447/h
          {% elif is_state("input_select.radio_station", "Sleep Radio") %} http://37.59.28.208:8722/stream
          {% elif is_state("input_select.radio_station", "Radio Art - Sleep") %} http://live.radioart.com/fSleep.mp3
          {% elif is_state("input_select.radio_station", "Ambi Nature Radio") %} http://94.23.252.14:8067/stream
          {% elif is_state("input_select.radio_station", "Calm Radio - Sleep") %} http://streams.calmradio.com/api/39/128/stream
          {% endif %}
        media_content_type: 'music'

Traceback (if applicable):


Additional information:

2018-08-31 09:13:56 INFO (SyncWorker_4) [pychromecast.controllers] Receiver:setting volume to 0.1
2018-08-31 09:13:56 DEBUG (SyncWorker_4) [pychromecast.socket_client] Sending: Message urn:x-cast:com.google.cast.receiver from sender-0 to receiver-0: {'type': 'SET_VOLUME', 'volume': {'level': 0.15}, 'requestId': 283}
2018-08-31 09:13:56 DEBUG (SyncWorker_3) [pychromecast.controllers] Receiver:Updating status
2018-08-31 09:13:56 DEBUG (SyncWorker_3) [pychromecast.socket_client] Sending: Message urn:x-cast:com.google.cast.receiver from sender-0 to receiver-0: {'type': 'GET_STATUS', 'requestId': 284}
2018-08-31 09:13:56 DEBUG (Thread-5) [pychromecast.socket_client] Received: Message urn:x-cast:com.google.cast.receiver from receiver-0 to sender-0: {'requestId': 284, 'status': {'userEq': {'high_shelf': {'frequency': 4500.0, 'gain_db': 0.0, 'quality': 0.707}, 'low_shelf': {'frequency': 150.0, 'gain_db': 0.0, 'quality': 0.707}, 'max_peaking_eqs': 0, 'peaking_eqs': []}, 'volume': {'controlType': 'master', 'level': 0.15000000596046448, 'muted': False, 'stepInterval': 0.019999999552965164}}, 'type': 'RECEIVER_STATUS'}
2018-08-31 09:13:56 DEBUG (Thread-5) [pychromecast.controllers] Received status: CastStatus(is_active_input=None, is_stand_by=None, volume_level=0.15000000596046448, volume_muted=False, app_id=None, display_name=None, namespaces=[], session_id=None, transport_id=None, status_text='')
2018-08-31 09:13:56 INFO (Thread-5) [pychromecast.controllers] Receiver:Launching app CC1AD845
2018-08-31 09:13:56 DEBUG (Thread-5) [pychromecast.socket_client] Sending: Message urn:x-cast:com.google.cast.receiver from sender-0 to receiver-0: {'type': 'LAUNCH', 'appId': 'CC1AD845', 'requestId': 285}
2018-08-31 09:13:57 DEBUG (Thread-5) [pychromecast.socket_client] Received: Message urn:x-cast:com.google.cast.receiver from receiver-0 to sender-0: {'requestId': 283, 'status': {'userEq': {'high_shelf': {'frequency': 4500.0, 'gain_db': 0.0, 'quality': 0.707}, 'low_shelf': {'frequency': 150.0, 'gain_db': 0.0, 'quality': 0.707}, 'max_peaking_eqs': 0, 'peaking_eqs': []}, 'volume': {'controlType': 'master', 'level': 0.15000000596046448, 'muted': False, 'stepInterval': 0.019999999552965164}}, 'type': 'RECEIVER_STATUS'}
2018-08-31 09:13:57 DEBUG (Thread-5) [pychromecast.controllers] Received status: CastStatus(is_active_input=None, is_stand_by=None, volume_level=0.15000000596046448, volume_muted=False, app_id=None, display_name=None, namespaces=[], session_id=None, transport_id=None, status_text='')
2018-08-31 09:13:58 DEBUG (Thread-5) [pychromecast.socket_client] Received: Message urn:x-cast:com.google.cast.receiver from receiver-0 to *: {'requestId': 285, 'status': {'applications': [{'appId': 'CC1AD845', 'displayName': 'Default Media Receiver', 'isIdleScreen': False, 'launchedFromCloud': False, 'namespaces': [{'name': 'urn:x-cast:com.google.cast.cac'}, {'name': 'urn:x-cast:com.google.cast.broadcast'}, {'name': 'urn:x-cast:com.google.cast.media'}], 'sessionId': '6e4cad47-cf32-4605-83ff-facc9036bc1d', 'statusText': 'Default Media Receiver', 'transportId': '6e4cad47-cf32-4605-83ff-facc9036bc1d'}], 'userEq': {'high_shelf': {'frequency': 4500.0, 'gain_db': 0.0, 'quality': 0.707}, 'low_shelf': {'frequency': 150.0, 'gain_db': 0.0, 'quality': 0.707}, 'max_peaking_eqs': 0, 'peaking_eqs': []}, 'volume': {'controlType': 'master', 'level': 0.15000000596046448, 'muted': False, 'stepInterval': 0.019999999552965164}}, 'type': 'RECEIVER_STATUS'}
2018-08-31 09:13:58 DEBUG (Thread-5) [pychromecast.controllers] Received status: CastStatus(is_active_input=None, is_stand_by=None, volume_level=0.15000000596046448, volume_muted=False, app_id='CC1AD845', display_name='Default Media Receiver', namespaces=['urn:x-cast:com.google.cast.cac', 'urn:x-cast:com.google.cast.broadcast', 'urn:x-cast:com.google.cast.media'], session_id='6e4cad47-cf32-4605-83ff-facc9036bc1d', transport_id='6e4cad47-cf32-4605-83ff-facc9036bc1d', status_text='Default Media Receiver')
2018-08-31 09:13:58 DEBUG (Thread-5) [pychromecast.socket_client] Sending: Message urn:x-cast:com.google.cast.tp.connection from sender-0 to 6e4cad47-cf32-4605-83ff-facc9036bc1d: {'type': 'CONNECT', 'origin': {}, 'userAgent': 'PyChromecast', 'senderInfo': {'sdkType': 2, 'version': '15.605.1.3', 'browserVersion': '44.0.2403.30', 'platform': 4, 'systemVersion': 'Macintosh; Intel Mac OS X10_10_3', 'connectionType': 1}}
2018-08-31 09:13:58 DEBUG (Thread-5) [pychromecast.socket_client] Sending: Message urn:x-cast:com.google.cast.media from sender-0 to 6e4cad47-cf32-4605-83ff-facc9036bc1d: {'type': 'GET_STATUS', 'requestId': 286}
2018-08-31 09:13:58 DEBUG (Thread-5) [pychromecast.controllers] Start app_launch_event_function...
2018-08-31 09:13:58 DEBUG (Thread-5) [pychromecast.socket_client] Sending: Message urn:x-cast:com.google.cast.media from sender-0 to 6e4cad47-cf32-4605-83ff-facc9036bc1d: {'media': {'contentId': 'http://192.168.1.250:8123/api/tts_proxy/65b91b94770dc101405423179bca45c6ada91604_en_-_google.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}}, 'type': 'LOAD', 'currentTime': 0, 'autoplay': True, 'customData': {}, 'requestId': 287, 'sessionId': '6e4cad47-cf32-4605-83ff-facc9036bc1d'}
2018-08-31 09:13:58 DEBUG (Thread-5) [pychromecast.socket_client] Received: Message urn:x-cast:com.google.cast.media from 6e4cad47-cf32-4605-83ff-facc9036bc1d to *: {'type': 'MEDIA_STATUS', 'status': [], 'requestId': 0}
2018-08-31 09:13:58 DEBUG (Thread-5) [pychromecast.controllers] Media:Received status {'type': 'MEDIA_STATUS', 'status': [], 'requestId': 0}
2018-08-31 09:13:58 DEBUG (Thread-5) [pychromecast.socket_client] Received: Message urn:x-cast:com.google.cast.media from 6e4cad47-cf32-4605-83ff-facc9036bc1d to sender-0: {'type': 'MEDIA_STATUS', 'status': [], 'requestId': 286}
2018-08-31 09:13:58 DEBUG (Thread-5) [pychromecast.controllers] Media:Received status {'type': 'MEDIA_STATUS', 'status': [], 'requestId': 286}
2018-08-31 09:13:58 DEBUG (Thread-5) [pychromecast.socket_client] Received: Message urn:x-cast:com.google.cast.media from 6e4cad47-cf32-4605-83ff-facc9036bc1d to *: {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'IDLE', 'currentTime': 0, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'media': {'contentId': 'http://192.168.1.250:8123/api/tts_proxy/65b91b94770dc101405423179bca45c6ada91604_en_-_google.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}}, 'currentItemId': 1, 'extendedStatus': {'playerState': 'LOADING', 'media': {'contentId': 'http://192.168.1.250:8123/api/tts_proxy/65b91b94770dc101405423179bca45c6ada91604_en_-_google.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}}}, 'repeatMode': 'REPEAT_OFF'}], 'requestId': 0}
2018-08-31 09:13:58 DEBUG (Thread-5) [pychromecast.controllers] Media:Received status {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'IDLE', 'currentTime': 0, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'media': {'contentId': 'http://192.168.1.250:8123/api/tts_proxy/65b91b94770dc101405423179bca45c6ada91604_en_-_google.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}}, 'currentItemId': 1, 'extendedStatus': {'playerState': 'LOADING', 'media': {'contentId': 'http://192.168.1.250:8123/api/tts_proxy/65b91b94770dc101405423179bca45c6ada91604_en_-_google.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}}}, 'repeatMode': 'REPEAT_OFF'}], 'requestId': 0}
2018-08-31 09:13:58 DEBUG (Thread-5) [pychromecast.socket_client] Received: Message urn:x-cast:com.google.cast.media from 6e4cad47-cf32-4605-83ff-facc9036bc1d to *: {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'PLAYING', 'currentTime': 0, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'media': {'contentId': 'http://192.168.1.250:8123/api/tts_proxy/65b91b94770dc101405423179bca45c6ada91604_en_-_google.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}, 'duration': 1.896, 'tracks': [{'trackId': 1, 'type': 'VIDEO'}], 'breakClips': [], 'breaks': []}, 'currentItemId': 1, 'items': [{'itemId': 1, 'media': {'contentId': 'http://192.168.1.250:8123/api/tts_proxy/65b91b94770dc101405423179bca45c6ada91604_en_-_google.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}, 'duration': 1.896}, 'autoplay': True, 'customData': {}}], 'repeatMode': 'REPEAT_OFF'}], 'requestId': 287}
2018-08-31 09:13:58 DEBUG (Thread-5) [pychromecast.controllers] Media:Received status {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'PLAYING', 'currentTime': 0, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'media': {'contentId': 'http://192.168.1.250:8123/api/tts_proxy/65b91b94770dc101405423179bca45c6ada91604_en_-_google.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}, 'duration': 1.896, 'tracks': [{'trackId': 1, 'type': 'VIDEO'}], 'breakClips': [], 'breaks': []}, 'currentItemId': 1, 'items': [{'itemId': 1, 'media': {'contentId': 'http://192.168.1.250:8123/api/tts_proxy/65b91b94770dc101405423179bca45c6ada91604_en_-_google.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}, 'duration': 1.896}, 'autoplay': True, 'customData': {}}], 'repeatMode': 'REPEAT_OFF'}], 'requestId': 287}
2018-08-31 09:13:59 DEBUG (Thread-5) [pychromecast.socket_client] Received: Message urn:x-cast:com.google.cast.media from 6e4cad47-cf32-4605-83ff-facc9036bc1d to *: {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'BUFFERING', 'currentTime': 0.345018, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'currentItemId': 1, 'repeatMode': 'REPEAT_OFF'}], 'requestId': 0}
2018-08-31 09:13:59 DEBUG (Thread-5) [pychromecast.controllers] Media:Received status {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'BUFFERING', 'currentTime': 0.345018, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'currentItemId': 1, 'repeatMode': 'REPEAT_OFF'}], 'requestId': 0}
2018-08-31 09:14:00 DEBUG (Thread-5) [pychromecast.socket_client] Received: Message urn:x-cast:com.google.cast.media from 6e4cad47-cf32-4605-83ff-facc9036bc1d to *: {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'PLAYING', 'currentTime': 1.357983, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'currentItemId': 1, 'repeatMode': 'REPEAT_OFF'}], 'requestId': 0}
2018-08-31 09:14:00 DEBUG (Thread-5) [pychromecast.controllers] Media:Received status {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'PLAYING', 'currentTime': 1.357983, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'currentItemId': 1, 'repeatMode': 'REPEAT_OFF'}], 'requestId': 0}
2018-08-31 09:14:01 DEBUG (Thread-5) [pychromecast.socket_client] Received: Message urn:x-cast:com.google.cast.media from 6e4cad47-cf32-4605-83ff-facc9036bc1d to *: {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'IDLE', 'currentTime': 0, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'currentItemId': 1, 'idleReason': 'FINISHED'}], 'requestId': 0}
2018-08-31 09:14:01 DEBUG (Thread-5) [pychromecast.controllers] Media:Received status {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 1, 'playbackRate': 1, 'playerState': 'IDLE', 'currentTime': 0, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'currentItemId': 1, 'idleReason': 'FINISHED'}], 'requestId': 0}
2018-08-31 09:14:03 INFO (SyncWorker_19) [pychromecast.controllers] Not launching app CC1AD845 - already running
2018-08-31 09:14:03 DEBUG (SyncWorker_19) [pychromecast.socket_client] Sending: Message urn:x-cast:com.google.cast.media from sender-0 to 6e4cad47-cf32-4605-83ff-facc9036bc1d: {'media': {'contentId': 'http://195.222.57.33:8070/stream.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}}, 'type': 'LOAD', 'currentTime': 0, 'autoplay': True, 'customData': {}, 'requestId': 289, 'sessionId': '6e4cad47-cf32-4605-83ff-facc9036bc1d'}
2018-08-31 09:14:03 DEBUG (Thread-5) [pychromecast.socket_client] Received: Message urn:x-cast:com.google.cast.media from 6e4cad47-cf32-4605-83ff-facc9036bc1d to *: {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 2, 'playbackRate': 1, 'playerState': 'IDLE', 'currentTime': 0, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'media': {'contentId': 'http://195.222.57.33:8070/stream.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}}, 'currentItemId': 2, 'extendedStatus': {'playerState': 'LOADING', 'media': {'contentId': 'http://195.222.57.33:8070/stream.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}}}, 'repeatMode': 'REPEAT_OFF'}], 'requestId': 0}
2018-08-31 09:14:03 DEBUG (Thread-5) [pychromecast.controllers] Media:Received status {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 2, 'playbackRate': 1, 'playerState': 'IDLE', 'currentTime': 0, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'media': {'contentId': 'http://195.222.57.33:8070/stream.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}}, 'currentItemId': 2, 'extendedStatus': {'playerState': 'LOADING', 'media': {'contentId': 'http://195.222.57.33:8070/stream.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}}}, 'repeatMode': 'REPEAT_OFF'}], 'requestId': 0}
2018-08-31 09:14:03 DEBUG (Thread-5) [pychromecast.socket_client] Received: Message urn:x-cast:com.google.cast.media from 6e4cad47-cf32-4605-83ff-facc9036bc1d to *: {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 2, 'playbackRate': 1, 'playerState': 'BUFFERING', 'currentTime': 0, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'media': {'contentId': 'http://195.222.57.33:8070/stream.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}, 'duration': None, 'tracks': [{'trackId': 1, 'type': 'VIDEO'}], 'breakClips': [], 'breaks': []}, 'currentItemId': 2, 'items': [{'itemId': 2, 'media': {'contentId': 'http://195.222.57.33:8070/stream.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}, 'duration': None}, 'autoplay': True, 'customData': {}}], 'repeatMode': 'REPEAT_OFF'}], 'requestId': 289}
2018-08-31 09:14:03 DEBUG (Thread-5) [pychromecast.controllers] Media:Received status {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 2, 'playbackRate': 1, 'playerState': 'BUFFERING', 'currentTime': 0, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'media': {'contentId': 'http://195.222.57.33:8070/stream.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}, 'duration': None, 'tracks': [{'trackId': 1, 'type': 'VIDEO'}], 'breakClips': [], 'breaks': []}, 'currentItemId': 2, 'items': [{'itemId': 2, 'media': {'contentId': 'http://195.222.57.33:8070/stream.mp3', 'streamType': 'BUFFERED', 'contentType': 'music', 'metadata': {}, 'duration': None}, 'autoplay': True, 'customData': {}}], 'repeatMode': 'REPEAT_OFF'}], 'requestId': 289}
2018-08-31 09:14:32 DEBUG (Thread-5) [pychromecast.socket_client] Received: Message urn:x-cast:com.google.cast.media from 6e4cad47-cf32-4605-83ff-facc9036bc1d to *: {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 2, 'playbackRate': 1, 'playerState': 'PLAYING', 'currentTime': 0.587233, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'currentItemId': 2, 'repeatMode': 'REPEAT_OFF'}], 'requestId': 0}
2018-08-31 09:14:32 DEBUG (Thread-5) [pychromecast.controllers] Media:Received status {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 2, 'playbackRate': 1, 'playerState': 'PLAYING', 'currentTime': 0.587233, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'activeTrackIds': [], 'currentItemId': 2, 'repeatMode': 'REPEAT_OFF'}], 'requestId': 0}
2018-08-31 09:15:08 DEBUG (SyncWorker_0) [pychromecast.socket_client] Sending: Message urn:x-cast:com.google.cast.media from sender-0 to 6e4cad47-cf32-4605-83ff-facc9036bc1d: {'type': 'STOP', 'mediaSessionId': 2, 'requestId': 296, 'sessionId': '6e4cad47-cf32-4605-83ff-facc9036bc1d'}
2018-08-31 09:15:08 DEBUG (Thread-5) [pychromecast.socket_client] Received: Message urn:x-cast:com.google.cast.media from 6e4cad47-cf32-4605-83ff-facc9036bc1d to *: {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 2, 'playbackRate': 1, 'playerState': 'IDLE', 'currentTime': 0, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'currentItemId': 2, 'idleReason': 'CANCELLED'}], 'requestId': 296}
2018-08-31 09:15:08 DEBUG (Thread-5) [pychromecast.controllers] Media:Received status {'type': 'MEDIA_STATUS', 'status': [{'mediaSessionId': 2, 'playbackRate': 1, 'playerState': 'IDLE', 'currentTime': 0, 'supportedMediaCommands': 274447, 'volume': {'level': 1, 'muted': False}, 'currentItemId': 2, 'idleReason': 'CANCELLED'}], 'requestId': 296}

Have you solve this issue please ?
I have a slow cast radio also... about 20 seconds
But if I paste same radio url in VLC in 2 seconds is start :-(
Thanks a lot
Denis

andreimoraru added a commit to andreimoraru/home-assistant-jukebox that referenced this issue Sep 10, 2021
A potential workaround described here home-assistant/core#16319 (comment) for the 40+ seconds delay after pressing Play button for local Icecast relay of an Internet radion stream
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants