pyatv
pyatv copied to clipboard
iOS remote volume controls stop working as soon as HA integration is active
Describe the bug
I am experiencing a rather strange issue with the HA integration (pyatv-beta via HACS).
As soon as the HA integration is paired, the volume control of the remote widget (iOS control center) stops working. I was able to reproduce this with 2 different Apple TVs (4K, latest tvOS 15).
pyatv seems to somehow interfere with the original iOS control center widget.
Can someone else reproduce the same problem?
How to reproduce the bug?
- Pair / activate HA integration with Apple TV
- Open remote control widget in iOS control center
- Try to control volume via side volume buttons -> Nothing happens
- Disable HA integration
- Reopen remote control widget in iOS control center
- Try to control volume via side volume buttons -> Works as expected
What is expected behavior?
The volume control works regardless of the HA integration
Operating System
iOS 15.2
Python
Other
pyatv
0.9.8
Device
Apple TV 4K tvOS 15
Additional context
HomeAssistant 2021.12.9 with HACS pyatv-beta 0.9.8.
Huh, that's new. I need to try that myself as I also have problems with my volume controls. I suspect I have to take new logs from iOS and compare to what I'm doing. One thing to verify though: do you happen to own two iOS devices? If you disable the Apple TV integration, can you control the volume from both devices at the same time? Just want to conclude if it's a one-device-limit or if it's purely because of pyatv.
can you control the volume from both devices at the same time?
Just tested this. You can control the volume only at one iOS device at the same time. As soon as you close the remote on the first device though, you can control with the second device.
So it basically just behaves as pyatv would have the remote control open all the time.
That is a very strange limitation in tvOS. Why would it behave like that? Maybe worth reprint as a bug to Apple... Your conclusion is correct however since Home Assistant keeps the connection open at all time, so it will allocate the controls because of that.
Wouldn’t it be possible to just open the connection on demand? So just when sending commands, controlling the volume etc.
It's the same connection used for anything else, e.g. metadata so it would break stuff.
Understood.
I just sent a bug report to Apple. I don't think this will have any result but worth a try 🤷♂️
Interestingly, it is the Companion session breaking the iOS volume controls (and not the MRP connection). I have disabled the Companion protocol in my HA instance and the volume controls are working fine again.
Volume controls have started to work for me, they didn't work before. Can someone check if this issue is still relevant or if it is fixed in tvOS now?
I can confirm that with some pyatv (or tvOS?) update this issue resolved and volume controls are working 👍