Similar issues here as well, where my Apple TV's, when put to sleep, would correctly put the TV to sleep as well (HDMI-CEC), but when they were woken up, the Audio settings of "XXX Room Apple TV -> XXX Room HomePod" would stick in settings, but the audio would be coming out of the TV, not the HomePod. Let the hair pulling and internet searching begin! Fun.
But alas, the answer (for me) was not to yell at Apple. Airplay 2 is very powerful, and honestly very well implemented. Yeah, there are bugs, but nine times out 10, the issue is with one's network setup and equipment. Want proof? Read on with what might be the fix for many of you.
(Again, not promising or guaranteeing this will fix anyone one's issue(s)) My issue was a bad firmware update running on my UniFi Switch (I have a more complex "prosumer" setup running all Ubiquiti hardware: controller, router, switch, AP's (access points). Turns out, the latest-and-greatest firmware running on the switch broke IGMP Snooping / Multicast, which is essential for Bonjour, Airplay 2 and Apple TV's to talk to each other and maintain connections (especially when devices are talking across multiple networks, into VLAN's, etc... but I digress into really important, but way-to-technical networking speak :-) ). Once I downgraded the switch firmware to the previous stable version, the Apple TV -> HomePod audio worked at wake. Phew.
Now, for some, the above fix might fit your set up as well. If so, great! But if not, here are a few must-have settings to share that must be in place in one's network—best practices for us Apple loving device users:
- Ensure Multicast'ing is ON
- Assign static IP's to all devices (especially if you have devices on different networks, eg. iPhones and computers on the "Data" network; Internet of Things devices—like the Smart TV, Homekit accessories, security cameras, etc.—on the "IoT" network).
- DHCP (random IP's within a prescribed range) can still be used for those devices that aren't talking to other devices
Hope this helps,
Matt