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

SiriusXM/Chromecast Casting Issue #738

Open
rac146 opened this issue Jul 25, 2023 · 8 comments · May be fixed by #886
Open

SiriusXM/Chromecast Casting Issue #738

rac146 opened this issue Jul 25, 2023 · 8 comments · May be fixed by #886

Comments

@rac146
Copy link

rac146 commented Jul 25, 2023

There is an issue regarding Chromecast integration in Home Assistant and the SiriusXM app - if the cast integration is enabled, casting SiriusXM to a Chromecast device will fail with an error code 1001. Disabling cast integration in HASS fixes the problem.

Original discussion here - also confirmed another add-on that uses pychromecast (Music Assistant 2.0 Beta) results in the same behavior:

home-assistant/core#93360

@jsermer
Copy link

jsermer commented Jul 25, 2023

I'm able to repro the issue using the ./examples/simple_listener_example.py script in this repo.

Basic steps:

  1. ensure the cast home assistant integration is disabled and reboot home assistant
  2. use the siriusxm app on my android phone to cast to the same cast device I use in CAST_NAME below (it should work)
  3. clone this repo
  4. install pychromecast via pip locally
  5. run the script python ./examples/simple_listener_example.py --cast 'Kitchen Display' --show-debug --show-zeroconf-debug > /tmp/log.txt 2>&1
  6. use the siriusxm app on my android phone to cast to the same cast device I used in CAST_NAME above (you should see the error in the siriusxm app)

Below is the log file when I performed the failed cast attempt (apologies for the extra noise in here...I have quite a few chromecasts on my network)

log.txt

@PereViader
Copy link

Referencing this other one which is most likely the same home-assistant/core#87387

@krkeegan
Copy link

So just an update. SiriusXM completely redesigned their mobile app and now casting works for me!!

I am on and Android device with version 7.0.2 of the SiriusXM app.

Hope this helps someone.

@scythe944
Copy link

I haven't tried it yet, but I suppose it will work again. I have noticed that with the newly designed website and app (even though I don't like it much. I just want my favorites, don't care about the rest!) it appears that they stopped cutting off playback immediately if you had two devices playing from the same account. It used to be so bad that if I even turned on my stereo receiver it would cut off my stream on my computer almost immediately, even if I didn't open the SiriusXM app on the receiver and start using it. Seems far more laxed for now. Not sure if that will continue or if they'll harden that down the road. Glad this is fixed though!

@linkian19
Copy link

I know I'm resurrecting an old issue here - but can confirm that the issue is still present with Audible as mentioned above: home-assistant/core#87387

Can confirm that disabling both HA Google Cast integration and Music Assistant allows me to cast Audible just fine. If I re-enable, it breaks again.

@geoffoxholm
Copy link

I noticed that by adding a 2 second delay here, the issue is avoided for me (in the devcontainer HA environment):

I'm sure this is too invasive, but I wanted to note that I think something is happening such that if Audible gets a message it doesn't expect (even if it's just a status message), then it abandons the session. Sleeping for 2 seconds allows the expected messages to come from the Chromecast in the order expected by the application. I'm completely new to all of this, but am trying to help out.

def receive_message(self, _message: CastMessage, data: dict) -> bool:

    def receive_message(self, _message: CastMessage, data: dict) -> bool:
        """
        Called when a receiver message is received.

        data is message.payload_utf8 interpreted as a JSON dict.
        """

        sleep(2) # <!--- Delay to allow application to connect before processing

        if data[MESSAGE_TYPE] == TYPE_RECEIVER_STATUS:
            self._process_get_status(data)

            return True

        if data[MESSAGE_TYPE] == TYPE_LAUNCH_ERROR:
            self._process_launch_error(data)

            return True

        return False

@geoffoxholm
Copy link

How can I test this out on my main install? I've tried copying the cast component from homeassistant/core into custom_components but I can't figure out how to get that to load.

This is the only edit i made, by the way:

    def new_cast_status(self, status: CastStatus) -> None:
        # ... redacted for brevity... 

        # When a new cast status is received, give Audible time to load
        if status.app_id == "25456794":
            self.logger.debug("Detected Audible connection. Sleeping for 1s")
            time.sleep(1)

@geoffoxholm geoffoxholm linked a pull request Mar 29, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants