postlund / pyatv

A client library for Apple TV and AirPlay devices
https://pyatv.dev
MIT License
883 stars 98 forks source link

Help me squash bugs before 0.9.0 is released #1298

Closed postlund closed 3 years ago

postlund commented 3 years ago

What's on your mind?

So, I'm getting very close to release v0.9.0 of pyatv, containing lots of updates. Especially under the hood. The biggest update is however the "MRP-over-AirPlay"-support, that is required to work with tvOS 15. Adding support for that also made it possible to support the HomePod with very little effort, so it is now possible to do that as well.

It would be really great to get some help testing things before shipping to iron out the last quirks (as I'm sure there are quite a few...). What mainly needs testing is tvOS 15 support and the HomePod, as mentioned. But general usage is also welcomed (other protocols, streaming, etc.) as a lot of improvements have been made that changes the general way pyatv works.

The HomePod does not require particular pairing or such, it should just work now. For instance to see what is playing:

$ atvremote -s 10.0.10.84 playing
  Media type: Unknown
Device state: Playing
       Title: Unpaid Intern
      Artist: Bo Burnham
       Album: Inside (The Songs)
    Position: 5/34s (14.7%)
      Repeat: Off
     Shuffle: Off

The Apple TV requires credentials however, so you need to pair with it first (atvremote -s <ip> --protocol airplay pair) and pass them via --airplay-credentials (atvremote -s <ip> --airplay-credentials <creds> playing). Only AirPlay credentials are really needed to test tvOS 15 support. Credentials obtained with previous versions of pyatv will not work, so you need to re-pair for this one.

This will work with tvOS 14 as well, but it's tricky to know if MRP tunneled over AirPlay or if regular MRP is used. An easy way is to look for this line in the --debug log:

2021-09-09 06:18:36 DEBUG [pyatv.protocols.airplay.remote_control]: Setting up remote control connection to 10.0.10.84:7000

It's also possible to limit to just testing AirPlay by specifying --scan-protocols:

$ atvrremote -s <ip> --scan-protocols airplay --airplay-credentials <creds> playing

One last thing: there are pre-built docker images now. So it's possible to test pyatv without having to install anything other than Docker. Version 0.9.0 will be the first proper "container release", but all commits to the master branch are automatically pushed as new images. It's as easy as this to run from master:

$ docker run  --rm --network=host ghcr.io/postlund/pyatv:master atvremote scan

I will be so thankful for all the help I can get here, to thank you!

bcmitri commented 3 years ago

I’ve also noticed that other TVs my house that support airplay are discovered and reported as Apple TV’s.

postlund commented 3 years ago

@bcmitri That is expected as the integration now supports everything pyatv supports, including (basic) AirPlay support. Nice for TTS for instance.

coolguymatt commented 3 years ago

Huh, that's... interesting. That would somehow suggest that one or more unique identifiers are changing somehow. If I prepare a branch with additional debug logs, can you try that and send the logs to me? Would help debugging a lot.

Sure thing!

bcmitri commented 3 years ago

I updated to the latest version and neglected to remove the previous integration first. Then, after removing it and restarting again ( a few times), I can’t get it to pair. I’m not sure if it’s because I neglected to remove the ills integration first, but the behaviour seems to be the same as it was with the old ) official) integration.

Am I the only one?

coolguymatt commented 3 years ago

I updated to the latest version and neglected to remove the previous integration first. Then, after removing it and restarting again ( a few times), I can’t get it to pair. I’m not sure if it’s because I neglected to remove the ills integration first, but the behaviour seems to be the same as it was with the old ) official) integration.

Am I the only one?

The new beta is missing the version so it doesn't load and the official integration does instead.

bcmitri commented 3 years ago

That would explain it, thanks.

geekofweek commented 3 years ago

@coolguymatt that just save me some effort trying to figure out why it wasn't working, nice catch.

coolguymatt commented 3 years ago

I think you need to change it to use pyatv 0.9.2 as well.

postlund commented 3 years ago

Amateur hour on my part... I have pushed an update and included changes to the manifest this time.

mschwartz commented 3 years ago

Reporting in. I upgraded my ATVs to 15. I used the Docker image to scan for devices, and got back all the ATVs and other airplay devices (TVs, speakers, receivers…).

I used the Docker image to atvremote pair (airplay) with each ATV. For each pair command, I got a 4-digit PIN displayed on the TV. Typed the pin at the atvremote prompt and it spit out credentials. I saved the credentials to my configuration file.

I had to edit my MQTT bridge to set_credentials() on each AppleTV found via scan(), and it works like a champ. Perhaps better than MRP and 14.7. Seems more responsive, less lag.

thanks!

postlund commented 3 years ago

Thanks for the report @mschwartz! Nice to hear that it is working 👍

mschwartz commented 3 years ago

Your support for this software is outstanding. Ready to go when 15 was released!

Again, thanks!

postlund commented 3 years ago

I will close this in favor of #1333 since pyatv 0.9.x has been out for a while now. Thanks everyone for helping out! 👌