Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDL_CoreAudio: Use correct 7.1 audio configuration #11709

Closed
Danos0100 opened this issue Dec 24, 2024 · 1 comment
Closed

SDL_CoreAudio: Use correct 7.1 audio configuration #11709

Danos0100 opened this issue Dec 24, 2024 · 1 comment

Comments

@Danos0100
Copy link

Danos0100 commented Dec 24, 2024

At the moment, when receiving an 8 channel stream, sdl is harcoded to use kAudioChannelLayoutTag_MPEG_7_1_A as channel layout. This layout however is not commonly used, as it uses a 'left of center' and a 'right of center' speaker between Front Left and Center/between Front Right and Center.

layout.mChannelLayoutTag = kAudioChannelLayoutTag_MPEG_7_1_A;

(L R C LFE Ls Rs Lc Rc)
This leads to SDL-apps on iOS/tvOS trying to output 7.1 audio (like steam link for example) to actually play back surround back audio stream on the surround side speakers and the surround side stream on the front left + center and front right + center speakers, while the surround back speakers stay silent. This also applies to virtualized spatial sound when using AirPods and letting apple do the spatialization.

This needs to be changed to
kAudioChannelLayoutTag_WAVE_7_1 (8 channels, L R C LFE Rls Rrs Ls Rs) (this is the same channel order that is used in windows).

SDL3 has the same problem:

layout.mChannelLayoutTag = kAudioChannelLayoutTag_MPEG_7_1_A;

(credit goes to @andygrundman for helping me to find out, why moonlight-ios and steam link use the 7.1 front layout)

(also tagging @slouken as this breaks steam link's 7.1 sound on iOS and tvOS currently)

@slouken
Copy link
Collaborator

slouken commented Dec 24, 2024

Fixed, thanks!

slouken added a commit that referenced this issue Dec 24, 2024
slouken added a commit that referenced this issue Dec 24, 2024
Fixes #11709

(cherry picked from commit b217885)
(cherry picked from commit 348bb53)
Danos0100 added a commit to Danos0100/moonlight-ios that referenced this issue Dec 25, 2024
This fixes 7.1 playback. Before this commit, SDL used 7.1 front audio configuration with Center Left and Center Right speakers, but without Rear speakers.

See libsdl-org/SDL#11709 for more details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants