AirConnect icon indicating copy to clipboard operation
AirConnect copied to clipboard

Implement AirPlay2 - Please

Open jrubbel opened this issue 3 years ago • 19 comments

Hi,

I love your software - it enables me to use my older Sonos Boxes with Airplay!. As an improvement it would be great to integrate Airplay2 to be compatible with HomeKit. Have a look at this work here https://github.com/mikebrady/shairport-sync/issues/535

Thanks Jesko

jrubbel avatar Feb 16 '21 13:02 jrubbel

See previous issues: #258, #218, #114, #97, #88, #79, #53.

pwt avatar Feb 16 '21 13:02 pwt

@philippe44 I’ve looked through the related items and it’s not clear why it gets outright dismissed rather than put on the backlog to collect further thoughts & attract community contributions (and prevent new duplicate issues being raised!)

It seems AirPlay 2 prevents calls interrupting the audio which is possibly one clear enhancement?

stevendarby avatar Apr 21 '21 04:04 stevendarby

It's just that I prefer to close issues but fair enough, I'll label it

philippe44 avatar Apr 21 '21 04:04 philippe44

it would be really cool - please re-open :-) This would integrate (non-ap2-compatible) Sonos Speakers into HomeKit! Even a 'manual', diy description with airupnp, rpiplay or shairport would be really nice! And a further step to maintain the sustainability of older Sonos products! Please think about it and re-open the request :)

jrubbel avatar Sep 12 '21 10:09 jrubbel

why not use this for airplay and then homebridge/home assistant to integrate with homekit

nmcc1212 avatar Nov 11 '21 11:11 nmcc1212

@nmcc1212 do you think that would work? my understanding is that homekit needs a ap2 device to stream music to, so I am not expecting HomeBridge to fully work. I would like to use grouping feature (e.g. in Apple Music) and tell Siri to play some Music on my Play:1s.....However, if you have some additional information, please share it here - appreciated!

jrubbel avatar Nov 22 '21 16:11 jrubbel

I'm currently doing this, using https://github.com/ebaauw/homebridge-zp to control volume and play/pause and using airConnect for airplay

Screenshot 2021-11-23 at 6 44 03 pm Screenshot 2021-11-23 at 6 44 45 pm

nmcc1212 avatar Nov 23 '21 18:11 nmcc1212

the only quick is it showing as a bulb, but you can change the icon that it shows like you can see in the first screenshot

nmcc1212 avatar Nov 23 '21 18:11 nmcc1212

also the homebride plugin linked above supports Sonos zones and stereo pairs

nmcc1212 avatar Nov 23 '21 18:11 nmcc1212

For a AirPlay2 implementation I would like to vote as well. Are there any thoughts about currently?

fpPierre avatar Dec 09 '21 07:12 fpPierre

@philippe44 I know there are many open issues on this topic, and I don't mean to belabor the idea that folks of course want airplay2 support - I'm assuming based on the level of effort in trying to even decipher and figure out how to build it is the main curve. But I'm not sure if you've seen this promising news: https://github.com/mikebrady/shairport-sync/issues/535#issuecomment-1002299880 - from the folks working on shairport-sync, they've managed to get the basics working it seems. So if the difficulty was a starting point, I figure it's worth sharing this in case it could make this that much easier.

Happy to build out a dev channel to auto-build docker for testing as well if that's easier to run the paces. Recently had some work to do fixing up the container, options, dockerfile, and build process - so its relatively fresh in my brain.

1activegeek avatar Jan 14 '22 01:01 1activegeek

It's just a lot of time and I know you know :smile: that this is the thing I (we) can't buy. Also, as you, when I do things for free, it has to mean something personal, I have to either use it or have a real interest in it. AirPlay2 unfortunately does not reach any of this criteria and will be time consuming, so that means more frustration and in these free open source things, fun has to be prime criteria, frustration is worst of worse.

philippe44 avatar Jan 14 '22 22:01 philippe44

Totally understood. Just wanted to inquire - might also help everyone stop badgering you 😛 I never delved deep enough to understand the mechanisms so I couldn't necessarily do it myself. Though if the mood and value strikes you - tag me in, I'm game to help however I can. And thank you as always for the great work on the core app, it still works fantastically for us and our army of Google Home Minis!! 😄

1activegeek avatar Jan 15 '22 22:01 1activegeek

An interesting advantage that AirPlay 2 has over AirPlay 1 is that it allows speakers to be added into Apple HomeKit and providing universal control (such as the remote feature in the iOS Control Center). Hopefully in the future AirPlay 2 will gain additional features that make it a big leap from AirPlay 1 :D

squishycat92 avatar Feb 12 '22 09:02 squishycat92

AP2 itself does not allow the speaker to be controlled by HomeKit - HK is also not a prerequisite to be able to ... control speakers via HK. The Remote in iOS control centre is MRP, possibly also via a type 130 control channel to the RTSP controller. Although those are intended for TV/video applications. Shairport-sync have done enormous work - their implementation still has some rough edges around PTP and a sprinkling of bugs and inconsistencies in the AP2 implementation, but on the whole, it works. Their implementation is more tightly coupled around the audio output modules, and requires... work to get lifted into this project.

The features AP2 provides do not improve what AP1 does to deliver the same functionality. What is it that people think AP2 will give that AP1 does not? Just groupings?

systemcrash avatar Feb 14 '22 03:02 systemcrash

AP2 not interrupting phone calls is another benefit

stevendarby avatar Feb 14 '22 04:02 stevendarby

AP2 itself does not allow the speaker to be controlled by HomeKit - HK is also not a prerequisite to be able to ... control speakers via HK.

As per #346, timtn states that AirPlay 2 is required for integration with HomeKit.

The features AP2 provides do not improve what AP1 does to deliver the same functionality. What is it that people think AP2 will give that AP1 does not? Just groupings?

Yes, along with the added benefits of lower latency, and I believe the ability to make the speaker do tasks independent of the streaming device - like picking up calls without interrupting an audio stream like stevendarby mentioned a few seconds ago.

squishycat92 avatar Feb 14 '22 04:02 squishycat92

AP2 not interrupting phone calls is another benefit

Neither AP2, nor AP1 interrupt phones calls :wink: but I guess that depends on how loud the music is :smile:

@squishycat92 HK integration is possible with AP2, but AP2 is not a prerequisite. HK runs via HAP, which is also a connection option in AP2. For it to be useful, however, multi-threading is necessary. I have no idea whether this project implements threading.

Latency is the same in AP1/2. In both AP1 or 2, you can reduce the buffer size to reduce the latency. One potential benefit of AP2 is... buffered (TCP) streaming, which neither or chromecast nor upnp were specifically designed to accommodate, I don't think. Although combined, some features do seem like they could improve the flexibility of this project. Anyway, as I understand it, PRs are welcome.

systemcrash avatar Feb 14 '22 13:02 systemcrash

Ah, alright. I guess we'll just have to wait and see if AirPlay 2 and HomeKit make it into airconnect, I don't think it supports HK as of right now.

squishycat92 avatar Feb 14 '22 15:02 squishycat92

There is a goplay2 implementation https://github.com/openairplay/goplay2 as airplay2 receiver written in go. Feel like promising to leverage that and integrate with airconnect. The big advantage for me in airplay2 is the ability to stream audio to multiple devices simultaneously at my home.

twei7 avatar Nov 02 '22 01:11 twei7

I don't speak go and there is always the possibility to stream to multiple speakers with AirPlay1, just not all clients will show it / enable it. So, AFAIC, this is a no-go (no pun intendent)

philippe44 avatar Nov 02 '22 02:11 philippe44

There is a goplay2 implementation https://github.com/openairplay/goplay2 as airplay2 receiver written in go. Feel like promising to leverage that and integrate with airconnect. The big advantage for me in airplay2 is the ability to stream audio to multiple devices simultaneously at my home.

goplay2 is broken after MacOS updated to 13.1 and the repo seems not active for a long time...

lenciel avatar Dec 22 '22 03:12 lenciel

There is a goplay2 implementation https://github.com/openairplay/goplay2 as airplay2 receiver written in go. Feel like promising to leverage that and integrate with airconnect. The big advantage for me in airplay2 is the ability to stream audio to multiple devices simultaneously at my home.

goplay2 is broken after MacOS updated to 13.1 and the repo seems not active for a long time...

That’s right. But also find another project that seems even better than goplay2 https://github.com/mikebrady/shairport-sync

twei7 avatar Dec 22 '22 03:12 twei7