pyatv icon indicating copy to clipboard operation
pyatv copied to clipboard

iOS remote volume controls stop working as soon as HA integration is active

Open josiasmontag opened this issue 3 years ago • 6 comments

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?

  1. Pair / activate HA integration with Apple TV
  2. Open remote control widget in iOS control center
  3. Try to control volume via side volume buttons -> Nothing happens
  4. Disable HA integration
  5. Reopen remote control widget in iOS control center
  6. 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.

josiasmontag avatar Jan 16 '22 22:01 josiasmontag

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.

postlund avatar Jan 19 '22 11:01 postlund

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.

josiasmontag avatar Jan 19 '22 17:01 josiasmontag

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.

postlund avatar Jan 19 '22 18:01 postlund

Wouldn’t it be possible to just open the connection on demand? So just when sending commands, controlling the volume etc.

josiasmontag avatar Jan 19 '22 18:01 josiasmontag

It's the same connection used for anything else, e.g. metadata so it would break stuff.

postlund avatar Jan 19 '22 19:01 postlund

Understood.

I just sent a bug report to Apple. I don't think this will have any result but worth a try 🤷‍♂️

josiasmontag avatar Jan 20 '22 12:01 josiasmontag

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.

josiasmontag avatar May 09 '23 08:05 josiasmontag

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?

postlund avatar Jul 13 '23 08:07 postlund

I can confirm that with some pyatv (or tvOS?) update this issue resolved and volume controls are working 👍

josiasmontag avatar Oct 24 '23 18:10 josiasmontag