From: Mohamad Al-Jaf <mohamadaljaf@gmail.com> --- dlls/dsound/dsound.c | 42 ++++++++++++++++++++++++++++++++++++ dlls/dsound/dsound_private.h | 2 +- dlls/dsound/primary.c | 12 ++++++++++- 3 files changed, 54 insertions(+), 2 deletions(-) diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c index fe8011d9b94..c21090d95e2 100644 --- a/dlls/dsound/dsound.c +++ b/dlls/dsound/dsound.c @@ -1151,6 +1151,48 @@ void DSOUND_ParseSpeakerConfig(DirectSoundDevice *device) device->lfe_channel = 3; break; + case DSSPEAKER_7POINT1_WIDE: + device->speaker_angles[0] = M_PI/180.0f * -135.0f; + device->speaker_angles[1] = M_PI/180.0f * -45.0f; + device->speaker_angles[2] = M_PI/180.0f * 0.0f; + device->speaker_angles[3] = M_PI/180.0f * 45.0f; + device->speaker_angles[4] = M_PI/180.0f * 135.0f; + device->speaker_angles[5] = M_PI/180.0f * -10.0f; + device->speaker_angles[6] = M_PI/180.0f * 10.0f; + device->speaker_angles[7] = 9999.0f; + device->speaker_num[0] = 4; /* Rear left */ + device->speaker_num[1] = 0; /* Front left */ + device->speaker_num[2] = 2; /* Front centre */ + device->speaker_num[3] = 1; /* Front right */ + device->speaker_num[4] = 5; /* Rear right */ + device->speaker_num[5] = 6; /* Front left of center */ + device->speaker_num[6] = 7; /* Front right of center */ + device->speaker_num[7] = 3; /* LFE */ + device->num_speakers = 8; + device->lfe_channel = 3; + break; + + case DSSPEAKER_7POINT1_SURROUND: + device->speaker_angles[0] = M_PI/180.0f * -135.0f; + device->speaker_angles[1] = M_PI/180.0f * -45.0f; + device->speaker_angles[2] = M_PI/180.0f * 0.0f; + device->speaker_angles[3] = M_PI/180.0f * 45.0f; + device->speaker_angles[4] = M_PI/180.0f * 135.0f; + device->speaker_angles[5] = M_PI/180.0f * -90.0f; + device->speaker_angles[6] = M_PI/180.0f * 90.0f; + device->speaker_angles[7] = 9999.0f; + device->speaker_num[0] = 4; /* Rear left */ + device->speaker_num[1] = 0; /* Front left */ + device->speaker_num[2] = 2; /* Front centre */ + device->speaker_num[3] = 1; /* Front right */ + device->speaker_num[4] = 5; /* Rear right */ + device->speaker_num[5] = 6; /* Side left */ + device->speaker_num[6] = 7; /* Side right */ + device->speaker_num[7] = 3; /* LFE */ + device->num_speakers = 8; + device->lfe_channel = 3; + break; + default: WARN("unknown speaker_config %lu\n", device->speaker_config); } diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h index c7917304d80..75279dacf87 100644 --- a/dlls/dsound/dsound_private.h +++ b/dlls/dsound/dsound_private.h @@ -32,7 +32,7 @@ #include "wine/list.h" -#define DS_MAX_CHANNELS 6 +#define DS_MAX_CHANNELS 8 extern int ds_hel_buflen; diff --git a/dlls/dsound/primary.c b/dlls/dsound/primary.c index 7ed0dc755e3..e180dbaeacd 100644 --- a/dlls/dsound/primary.c +++ b/dlls/dsound/primary.c @@ -52,6 +52,12 @@ static DWORD speaker_config_to_channel_mask(DWORD speaker_config) case DSSPEAKER_5POINT1_BACK: return SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT; + + case DSSPEAKER_7POINT1_SURROUND: + return KSAUDIO_SPEAKER_5POINT1 | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT; + + case DSSPEAKER_7POINT1_WIDE: + return KSAUDIO_SPEAKER_5POINT1 | SPEAKER_FRONT_LEFT_OF_CENTER | SPEAKER_FRONT_RIGHT_OF_CENTER; } WARN("unknown speaker_config %lu\n", speaker_config); @@ -93,7 +99,11 @@ static DWORD DSOUND_FindSpeakerConfig(IMMDevice *mmdevice, int channels) PropVariantClear(&pv); IPropertyStore_Release(store); - if ((channels >= 6 || channels == 0) && (phys_speakers & KSAUDIO_SPEAKER_5POINT1) == KSAUDIO_SPEAKER_5POINT1) + if ((channels >= 8 || channels == 0) && (phys_speakers & KSAUDIO_SPEAKER_7POINT1_SURROUND) == KSAUDIO_SPEAKER_7POINT1_SURROUND) + return DSSPEAKER_7POINT1_SURROUND; + else if ((channels >= 8 || channels == 0) && (phys_speakers & KSAUDIO_SPEAKER_7POINT1) == KSAUDIO_SPEAKER_7POINT1) + return DSSPEAKER_7POINT1_WIDE; + else if ((channels >= 6 || channels == 0) && (phys_speakers & KSAUDIO_SPEAKER_5POINT1) == KSAUDIO_SPEAKER_5POINT1) return DSSPEAKER_5POINT1_BACK; else if ((channels >= 6 || channels == 0) && (phys_speakers & KSAUDIO_SPEAKER_5POINT1_SURROUND) == KSAUDIO_SPEAKER_5POINT1_SURROUND) return DSSPEAKER_5POINT1_SURROUND; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10557