Revert cast platform polling mode#14027
Conversation
|
Do we know if there are any apps that will send |
|
All apps I've seen only send |
|
Ok. I tested Spotify a little without polling. It seems to sometimes (for example if pausing) send an old Is it only Spotify that's misbehaving? It's a rather common app though... |
|
@dersger I have YouTube and the default media receiver do the same during my testing... And it's true there is this old |
|
I didn't get any problem when I used YouTube from an Android phone. But I do get the polling problem when using screen mirroring from the phone, or if using mirroring from a Chrome browser in Win10. I get media_position 0.0 and state playing repeatedly during mirroring. |
|
I think that if we want to re-introduce this behavior again in the future, we should limit it to apps that are known broken, like netflix. |
Description:
We used to rely on the cast device notifying us of all media status changed via callbacks. However, some apps like Netflix sometimes didn't send those callbacks even though the state had changed. In #13275, I introduced a semi-polling mode for the cast platform: we would still respond to all callbacks, but in addition we would poll the chromecast device every 30 seconds for the current state to resolve the Netflix media status issue.
However, it turned out that some other apps on the other hand don't like the polling mode at all :(. When polled for the current state via a
GET_STATUSrequest, they responded with the media status of the most recent callback media status, not the actual media status (but only for a some apps 🤬). As there's no information in theMEDIA_STATUSmessages to which timestamp thecurrentTimeattribute corresponds, there's no good way to solve this IMHO.This PR reverts #13770 and partially reverts #13275 to go back to the old callback-only method. It has its own issues, but is a lot better than the issues mentioned in #13770.
I must say, the cast protocol is extremely weird with lots of these things. I seriously would have expected a better quality out of one of google's products.
Related issue (if applicable): fixes #
Example entry for
configuration.yaml(if applicable):Checklist:
tox. Your PR cannot be merged unless tests passIf the code does not interact with devices: