Skip to content

Commit

Permalink
CoreAudio: fix mapping of 7.1 surround channels (was Ls Rs Rls Rrs, n…
Browse files Browse the repository at this point in the history
…ow 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.
  • Loading branch information
andygrundman committed Aug 31, 2024
1 parent 3099183 commit c2c2dc4
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,12 @@ OSStatus inputCallback(void *inRefCon,
layout = kAudioChannelLayoutTag_Stereo;
break;
case 6:
layout = kAudioChannelLayoutTag_AudioUnit_5_1; // L R C LFE Ls Rs
// Back in the DVD era I remember 5.1 meant side surrounds (WAVE_5_1_A), but at some point it became back surrounds?
// layout = kAudioChannelLayoutTag_WAVE_5_1_A; // L R C LFE Ls Rs
layout = kAudioChannelLayoutTag_WAVE_5_1_B; // L R C LFE Rls Rrs
break;
case 8:
layout = kAudioChannelLayoutTag_AudioUnit_7_1; // L R C LFE Ls Rs Rls Rrs
layout = kAudioChannelLayoutTag_WAVE_7_1; // L R C LFE Rls Rrs Ls Rs
break;
case 12:
layout = kAudioChannelLayoutTag_Atmos_7_1_4; // L R C LFE Ls Rs Rls Rrs Vhl Vhr Ltr Rtr
Expand All @@ -161,6 +163,8 @@ OSStatus inputCallback(void *inRefCon,
return false;
}

// XXX Allow user to override channel layout

status = setStreamFormatAndACL(sampleRate, layout, kAudioUnitScope_Input, 0);
if (status != noErr) {
CA_LogError(status, "Failed to set AUSpatialRenderer input stream format to %d channels", inChannelCount);
Expand Down

0 comments on commit c2c2dc4

Please sign in to comment.