Skip to content

v6.0.2-sa1: Native CoreAudio renderer with spatial audio

Pre-release
Pre-release
Compare
Choose a tag to compare
@andygrundman andygrundman released this 31 Aug 00:34
· 34 commits to andyg.coreaudio-spatial-mixer since this release

Moonlight + spatial audio

  • M1 and newer Macs only. Sorry Intel users.
  • Spatial audio mode works with any headphones and Macbook built-in speakers.
  • Personalized HRTF is supported if you've done the scan-your-ears thing with an iPhone.
  • This was only tested against Sunshine on Windows 11, but it should work with other host OS's and might work with GFE.
  • The Sunshine option to enable/use Steam Streaming Speakers is the easiest way to have Windows send you a 5.1 or 7.1 stream.
  • I would recommend checking "mute host PC while streaming" and UNchecking "mute audio stream when not active".
  • You can quickly check that it's working by using the ctrl-alt-shift-s overlay and by playing the Windows speaker test:
    • Settings -> System -> Sound -> Steam Streaming Speakers -> Test
    • You should hear well-placed tones from all 6 or 8 channels.
    • Also try this with Macbook laptop speakers, it's kinda spooky.
  • You can freely switch between audio devices and it should reinitialize the stream quickly. This also means if you take out your AirPods the audio will immediately switch to your previous device instead of going silent like you might expect.
  • In games, you should choose the Home Theater mix and not a Headphones mix.
  • Don't mess with the Windows audio settings, and especially don't activate any of the Windows spatial audio settings.
  • The audio buffer is only about 30ms, if you can believe it. This means there is virtually no latency, but you might have dropouts. It's no worse than normal, but there is more audio data being streamed.
  • There is a hiddden audio quality setting in Sunshine, where you get a lower audio bitrate if your video bitrate is lower or you appear to be on a remote network. The current quality mode and bitrate are shown in the new audio stats overlay (ctrl-alt-shift-s).
    Video bitrate     Quality mode      Opus audio bitrate
                                      stereo     5.1     7.1
    ----------------------------------------------------------
    > 15Mbps          High             512k     1500k   2048k
    < 5Mbps           Normal            96k      256k    450k

Some listening ideas:

  • Blu-ray rips: I found mpv to be the best app for surround playback, because it will dynamically switch the channel layout if you reconnect from 7.1 to 5.1 for example. Use the Shift-I info screen to verify the channels it's outputting. mpv will upmix anything with less channels by default. If you have Atmos tracks on a Blu-ray it will play, but YMMV. Only the 7.1 "bed" channels can be decoded, meaning you will be missing some or all of the mix, depending on how many extra objects are involved.

  • 5.1 FLAC rips: I bought a 5.1 Pat Metheny DVD-Audio disc in 2001 many years before I understood what it was or had a player that could play it, so it's kinda wild to listen to it now in the most convoluted way possible. Foobar2000 will play these, but it doesn't play as nice if you change the channels while it's playing. I bet you didn't know that you can also play 5.1 FLACs spatially on a Mac natively in Quicktime or with quicklook.

  • The new Star Wars Outlaws game has a really great sound mix. It also supports Dolby Atmos, so technically you could already get a good spatial audio experience with the $15 Dolby app and the Atmos for Headphones setting over Moonlight. When using 5.1 or 7.1, be sure to set the in-game audio mode to Home Theater.

Known issues:

  • Head-tracking is disabled until there is a config option. You probably don't want it anyway.
  • Any USB, 3.5mm, and Bluetooth audio device gets treated as a headphone, there will be a config to override this later.
  • I don't know how to get the system sound menu to show that little "Multichannel" text or enable the spatial audio submenu for AirPods.