home-assistant-libs / pychromecast

Library for Python 3 to communicate with the Google Chromecast.
MIT License
2.54k stars 379 forks source link

dashcast: Namespace urn:x-cast:com.madmod.dashcast is not supported by current app #972

Open dtreskunov opened 1 month ago

dtreskunov commented 1 month ago

I have installed DashCast by following the following guide: google-nest-hub-as-dashboard-with-dashcast-add-on

It worked a few times, but now I'm seeing the following error: Namespace urn:x-cast:com.madmod.dashcast is not supported by current app

The error can be replicated by running examples/dashcast_example.py in the master branch (a786600):

python -m examples.dashcast_example --known-host 192.168.0.30 --cast 'Kitchen display' --show-discovery-debug
2024-10-09 15:22:49 DEBUG (MainThread) [pychromecast.discovery] Addded host 192.168.0.30
2024-10-09 15:22:49 DEBUG (Thread-2) [pychromecast.discovery] HostBrowser thread started
2024-10-09 15:22:49 DEBUG (Thread-2) [pychromecast.dial] Resolved service HostServiceInfo(host='192.168.0.30', port=8009) to 192.168.0.30
2024-10-09 15:22:49 DEBUG (Thread-2) [pychromecast.dial] Resolved service HostServiceInfo(host='192.168.0.30', port=8009) to 192.168.0.30
2024-10-09 15:22:49 DEBUG (zeroconf-ServiceBrowser-_googlecast._tcp-2794753) [pychromecast.discovery] add_service _googlecast._tcp.local., Google-Nest-Mini-01dd967e8d9b4846fbd108a7a7c6d85c._googlecast._tcp.local.
2024-10-09 15:22:49 DEBUG (zeroconf-ServiceBrowser-_googlecast._tcp-2794753) [pychromecast.discovery] Addded host 192.168.0.10
2024-10-09 15:22:49 DEBUG (zeroconf-ServiceBrowser-_googlecast._tcp-2794753) [pychromecast.discovery] add_service _googlecast._tcp.local., Chromecast-HD-82c4724d6998d1556a6ab04b144e98fb._googlecast._tcp.local.
2024-10-09 15:22:49 DEBUG (zeroconf-ServiceBrowser-_googlecast._tcp-2794753) [pychromecast.discovery] Addded host 192.168.0.29
2024-10-09 15:22:49 DEBUG (zeroconf-ServiceBrowser-_googlecast._tcp-2794753) [pychromecast.discovery] add_service _googlecast._tcp.local., Google-Cast-Group-fc244a8107d044fa9bc28b64b81a5d3b-1._googlecast._tcp.local.
2024-10-09 15:22:49 DEBUG (zeroconf-ServiceBrowser-_googlecast._tcp-2794753) [pychromecast.discovery] add_service _googlecast._tcp.local., Google-Nest-Hub-eacf87532318ff209b6a4f02dcf558d1._googlecast._tcp.local.
2024-10-09 15:22:49 DEBUG (Thread-4) [pychromecast.dial] get_info_from_service resolved service MDNSServiceInfo(name='Google-Nest-Hub-eacf87532318ff209b6a4f02dcf558d1._googlecast._tcp.local.') to service_info ServiceInfo(type='_googlecast._tcp.local.', name='Google-Nest-Hub-eacf87532318ff209b6a4f02dcf558d1._googlecast._tcp.local.', addresses=[b'\xc0\xa8\x00\x1e'], port=8009, weight=0, priority=0, server='fuchsia-3886-f707-1869.local.', properties={b'id': b'eacf87532318ff209b6a4f02dcf558d1', b'cd': b'E10F875EEDEDDF5E8F33AD23961BD09A', b'rm': b'0504DBDDED0EEAA2', b've': b'05', b'md': b'Google Nest Hub', b'ic': b'/setup/icon.png', b'fn': b'Kitchen display', b'ca': b'231941', b'st': b'1', b'bs': b'FA8FCA7C38DD', b'nf': b'1', b'rs': b'Casting: Dummy 15:21:47 GMT-0700 (Pacific Daylight Time)'}, interface_index=None)

CastInfo(services={MDNSServiceInfo(name='Google-Nest-Hub-eacf87532318ff209b6a4f02dcf558d1._googlecast._tcp.local.')}, uuid=UUID('eacf8753-2318-ff20-9b6a-4f02dcf558d1'), model_name='Google Nest Hub', friendly_name='Kitchen display', host='192.168.0.30', port=8009, cast_type='cast', manufacturer='Google Inc.')
2024-10-09 15:22:50 DEBUG (Thread-2) [pychromecast.discovery] Host 192.168.0.30:8009 (eacf8753-2318-ff20-9b6a-4f02dcf558d1) up, adding or updating host based service
2024-10-09 15:22:50 DEBUG (Thread-2) [pychromecast.discovery] Host 192.168.0.30:32252 (fc244a81-07d0-44fa-9bc2-8b64b81a5d3b) up, adding or updating host based service

CastStatus(is_active_input=False, is_stand_by=True, volume_level=0.4399999976158142, volume_muted=False, app_id='84912283', display_name='DashCast', namespaces=['urn:x-cast:com.google.cast.debugoverlay', 'urn:x-cast:com.google.cast.cac', 'urn:x-cast:com.google.cast.media'], session_id='d804ccea-1594-47ec-8386-77031a8605d5', transport_id='d804ccea-1594-47ec-8386-77031a8605d5', status_text='Casting: Dummy 15:21:47 GMT-0700 (Pacific Daylight Time)', icon_url='', volume_control_type='master')

<MediaStatus {'metadata_type': 0, 'title': 'Dummy 15:21:47 GMT-0700 (Pacific Daylight Time)', 'series_title': None, 'season': None, 'episode': None, 'artist': None, 'album_name': None, 'album_artist': None, 'track': None, 'subtitle_tracks': [], 'images': [], 'supports_pause': True, 'supports_seek': True, 'supports_stream_volume': True, 'supports_stream_mute': True, 'supports_skip_forward': False, 'supports_skip_backward': False, 'current_time': 0, 'content_id': 'https://cast.home-assistant.io/images/google-nest-hub.png', 'content_type': 'image/jpeg', 'duration': 0, 'stream_type': 'BUFFERED', 'idle_reason': None, 'media_session_id': 12, 'playback_rate': 1, 'player_state': 'PAUSED', 'supported_media_commands': 12303, 'volume_level': 1, 'volume_muted': False, 'media_custom_data': {}, 'media_metadata': {'metadataType': 0, 'title': 'Dummy 15:21:47 GMT-0700 (Pacific Daylight Time)'}, 'current_subtitle_tracks': [], 'last_updated': datetime.datetime(2024, 10, 9, 22, 22, 50, 14959)}>

Loading 1st URL
2024-10-09 15:22:51 INFO (MainThread) [pychromecast.controllers] Not launching app 84912283 - already running
2024-10-09 15:22:51 INFO (MainThread) [pychromecast.controllers] Not launching app 84912283 - already running
Failed to load second URL
Loaded 2nd URL
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/dtreskunov/github/pychromecast/examples/dashcast_example.py", line 101, in <module>
    d.load_url(
  File "/Users/dtreskunov/github/pychromecast/pychromecast/controllers/dashcast.py", line 71, in load_url
    self.launch(
  File "/Users/dtreskunov/github/pychromecast/pychromecast/controllers/__init__.py", line 97, in launch
    self._socket_client.receiver_controller.launch_app(
  File "/Users/dtreskunov/github/pychromecast/pychromecast/controllers/receiver.py", line 174, in launch_app
    self._send_launch_message(app_id, force_launch, callback_function)
  File "/Users/dtreskunov/github/pychromecast/pychromecast/controllers/receiver.py", line 229, in _send_launch_message
    callback_function(True, None)
  File "/Users/dtreskunov/github/pychromecast/pychromecast/response_handler.py", line 71, in _callback
    on_success(callback_function=callback_function)
  File "/Users/dtreskunov/github/pychromecast/pychromecast/controllers/dashcast.py", line 67, in launch_callback
    self.send_message(
  File "/Users/dtreskunov/github/pychromecast/pychromecast/controllers/__init__.py", line 148, in send_message
    self.launch(
  File "/Users/dtreskunov/github/pychromecast/pychromecast/controllers/__init__.py", line 97, in launch
    self._socket_client.receiver_controller.launch_app(
  File "/Users/dtreskunov/github/pychromecast/pychromecast/controllers/receiver.py", line 174, in launch_app
    self._send_launch_message(app_id, force_launch, callback_function)
  File "/Users/dtreskunov/github/pychromecast/pychromecast/controllers/receiver.py", line 229, in _send_launch_message
    callback_function(True, None)
  File "/Users/dtreskunov/github/pychromecast/pychromecast/response_handler.py", line 71, in _callback
    on_success(callback_function=callback_function)
  File "/Users/dtreskunov/github/pychromecast/pychromecast/controllers/__init__.py", line 186, in send_message_nocheck
    self._message_func(
  File "/Users/dtreskunov/github/pychromecast/pychromecast/socket_client.py", line 953, in send_app_message
    raise UnsupportedNamespace(
pychromecast.error.UnsupportedNamespace: Namespace urn:x-cast:com.madmod.dashcast is not supported by current app. Supported are urn:x-cast:com.google.cast.debugoverlay, urn:x-cast:com.google.cast.cac, urn:x-cast:com.google.cast.media
dtreskunov commented 1 month ago

After calling media_player.stop the error went away. I suspect restarting the device would also fix it.