philippe44 / AirConnect

Use AirPlay to stream to UPnP/Sonos & Chromecast devices
Other
3.46k stars 217 forks source link

Implement AirPlay2 - Please #326

Closed jrubbel closed 1 year ago

jrubbel commented 3 years ago

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

pwt commented 3 years ago

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

stevendarby commented 3 years ago

@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?

philippe44 commented 3 years ago

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

jrubbel commented 2 years ago

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 :)

nmcc1212 commented 2 years ago

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

jrubbel commented 2 years ago

@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!

nmcc1212 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

fpPierre commented 2 years ago

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

1activegeek commented 2 years ago

@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.

philippe44 commented 2 years ago

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.

1activegeek commented 2 years ago

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!! 😄

squishycat92 commented 2 years ago

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

systemcrash commented 2 years ago

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?

stevendarby commented 2 years ago

AP2 not interrupting phone calls is another benefit

squishycat92 commented 2 years ago

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.

systemcrash commented 2 years ago

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.

squishycat92 commented 2 years ago

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.

twei7 commented 1 year ago

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.

philippe44 commented 1 year ago

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)

lenciel commented 1 year ago

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...

twei7 commented 1 year ago

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