Skip to content

Commit c2c2dc4

Browse files
committed
CoreAudio: fix mapping of 7.1 surround channels (was Ls Rs Rls Rrs, now Rls Rrs Ls Rs).
CoreAudio: change 5.1 to use back surrounds instead of side to match how Sunshine configures the virtual 5.1 layout.
1 parent 3099183 commit c2c2dc4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

app/streaming/audio/renderers/coreaudio/au_spatial_renderer.mm

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,12 @@ OSStatus inputCallback(void *inRefCon,
148148
layout = kAudioChannelLayoutTag_Stereo;
149149
break;
150150
case 6:
151-
layout = kAudioChannelLayoutTag_AudioUnit_5_1; // L R C LFE Ls Rs
151+
// Back in the DVD era I remember 5.1 meant side surrounds (WAVE_5_1_A), but at some point it became back surrounds?
152+
// layout = kAudioChannelLayoutTag_WAVE_5_1_A; // L R C LFE Ls Rs
153+
layout = kAudioChannelLayoutTag_WAVE_5_1_B; // L R C LFE Rls Rrs
152154
break;
153155
case 8:
154-
layout = kAudioChannelLayoutTag_AudioUnit_7_1; // L R C LFE Ls Rs Rls Rrs
156+
layout = kAudioChannelLayoutTag_WAVE_7_1; // L R C LFE Rls Rrs Ls Rs
155157
break;
156158
case 12:
157159
layout = kAudioChannelLayoutTag_Atmos_7_1_4; // L R C LFE Ls Rs Rls Rrs Vhl Vhr Ltr Rtr
@@ -161,6 +163,8 @@ OSStatus inputCallback(void *inRefCon,
161163
return false;
162164
}
163165

166+
// XXX Allow user to override channel layout
167+
164168
status = setStreamFormatAndACL(sampleRate, layout, kAudioUnitScope_Input, 0);
165169
if (status != noErr) {
166170
CA_LogError(status, "Failed to set AUSpatialRenderer input stream format to %d channels", inChannelCount);

0 commit comments

Comments
 (0)