moonlight-stream / moonlight-ios

GameStream client for iOS/tvOS
GNU General Public License v3.0
1.17k stars 299 forks source link

spatial audio headphones support #590

Open benjaminfrombe opened 1 year ago

benjaminfrombe commented 1 year ago

It would be great if spatial audio headphones were supported, now the headphone channels are always stereo.

Danos0100 commented 11 months ago

Theoretically this should be possible by requesting a 5.1 stream and then running it through Apple's spatial audio library. Multichannel streams don't have to be Dolby Audio as can be seen by playing the wave test file here: https://www2.iis.fraunhofer.de/AAC/multichannel.html. The multichannel AAC file should work as well, however as of iOS 17, multichannel AAC files don't work anymore. The iPhone still says 'spatial audio' if you go to control center, but it is played as normal stereo.

What you can already do is using Windows Sonic (free) or Dolby Atmos for headphones (paid) to create a virtual surround signal on the Windows side of your setup. As this is still a stereo signal (on a technical perspective), you can use this on your Airpods as well – just without headtracking, of course.

benjaminfrombe commented 11 months ago

Some apps (like infuse) have already implemented this. When you request a 5.1 stream, your spatial audio capable headset will give you surround sound.

prlaodude commented 10 months ago

Would also love to have this. Especially with the Vision Pro around the corner.

Danos0100 commented 7 months ago

Okay, so requesting a 5.1 or 7.1 stream is entirely possible and the Apple TV version of moonlight-ios uses this. However when connecting AirPod to the Apple TV, the stream remains stereo and doesn't even offer upmixing. This probably has to do with Moonlight using the opus library to decode the audio stream? D:

bayramog commented 4 months ago

Would be very great feature and it will definitely increase our gaming experience

rramnel commented 4 months ago

With iPadOS 18, I believe there is an API for developers to support Spatial Audio. I hope this feature can be implemented.

I have an iPad Pro M4 running iPadOS 18 Public Beta. I could also help to test if needed.

rramnel commented 2 months ago

There is a new beta version of Moonlight that supports Spatial Audio and Head tracking for macOS running Apple Silicon. I just tried it with my AirPods Max and it works great! Link to the beta build below

https://ci.appveyor.com/project/cgutman/moonlight-qt/builds/50523331