diff options
-rw-r--r-- | alc/alc.cpp | 11 | ||||
-rw-r--r-- | alc/backends/base.cpp | 22 | ||||
-rw-r--r-- | alc/backends/coreaudio.cpp | 1 | ||||
-rw-r--r-- | alc/backends/dsound.cpp | 6 | ||||
-rw-r--r-- | alc/backends/oboe.cpp | 36 | ||||
-rw-r--r-- | alc/backends/opensl.cpp | 3 | ||||
-rw-r--r-- | alc/backends/pulseaudio.cpp | 8 | ||||
-rw-r--r-- | alc/backends/wasapi.cpp | 19 | ||||
-rw-r--r-- | alc/backends/wave.cpp | 1 | ||||
-rw-r--r-- | alc/backends/winmm.cpp | 1 | ||||
-rw-r--r-- | alc/panning.cpp | 28 | ||||
-rw-r--r-- | core/devformat.cpp | 2 | ||||
-rw-r--r-- | core/devformat.h | 3 |
13 files changed, 27 insertions, 114 deletions
diff --git a/alc/alc.cpp b/alc/alc.cpp index 7cc35617..21c95cbd 100644 --- a/alc/alc.cpp +++ b/alc/alc.cpp @@ -1359,8 +1359,7 @@ ALCenum EnumFromDevFmt(DevFmtChannels channels) case DevFmtMono: return ALC_MONO_SOFT; case DevFmtStereo: return ALC_STEREO_SOFT; case DevFmtQuad: return ALC_QUAD_SOFT; - case DevFmtX51: /* fall-through */ - case DevFmtX51Rear: return ALC_5POINT1_SOFT; + case DevFmtX51: return ALC_5POINT1_SOFT; case DevFmtX61: return ALC_6POINT1_SOFT; case DevFmtX71: return ALC_7POINT1_SOFT; case DevFmtAmbi3D: return ALC_BFORMAT3D_SOFT; @@ -1443,11 +1442,6 @@ const std::array<InputRemixMap,3> X51Downmix{{ { BackRight, {{{SideLeft, 0.0f}, {SideRight, 1.0f}}} }, { BackCenter, {{{SideLeft, 0.5f}, {SideRight, 0.5f}}} }, }}; -const std::array<InputRemixMap,3> X51RearDownmix{{ - { SideLeft, {{{BackLeft, 1.0f}, {BackRight, 0.0f}}} }, - { SideRight, {{{BackLeft, 0.0f}, {BackRight, 1.0f}}} }, - { BackCenter, {{{BackLeft, 0.5f}, {BackRight, 0.5f}}} }, -}}; const std::array<InputRemixMap,2> X61Downmix{{ { BackLeft, {{{BackCenter, 0.5f}, {SideLeft, 0.5f}}} }, { BackRight, {{{BackCenter, 0.5f}, {SideRight, 0.5f}}} }, @@ -1830,7 +1824,6 @@ ALCenum UpdateDeviceParams(ALCdevice *device, const int *attrList) case DevFmtStereo: device->RealOut.RemixMap = StereoDownmix; break; case DevFmtQuad: device->RealOut.RemixMap = QuadDownmix; break; case DevFmtX51: device->RealOut.RemixMap = X51Downmix; break; - case DevFmtX51Rear: device->RealOut.RemixMap = X51RearDownmix; break; case DevFmtX61: device->RealOut.RemixMap = X61Downmix; break; case DevFmtX71: device->RealOut.RemixMap = X71Downmix; break; case DevFmtAmbi3D: break; @@ -3180,7 +3173,7 @@ START_API_FUNC { "surround51", DevFmtX51, 0 }, { "surround61", DevFmtX61, 0 }, { "surround71", DevFmtX71, 0 }, - { "surround51rear", DevFmtX51Rear, 0 }, + { "surround51rear", DevFmtX51, 0 }, { "ambi1", DevFmtAmbi3D, 1 }, { "ambi2", DevFmtAmbi3D, 2 }, { "ambi3", DevFmtAmbi3D, 3 }, diff --git a/alc/backends/base.cpp b/alc/backends/base.cpp index 0c28d238..dea29a80 100644 --- a/alc/backends/base.cpp +++ b/alc/backends/base.cpp @@ -79,14 +79,6 @@ void BackendBase::setDefaultWFXChannelOrder() mDevice->RealOut.ChannelIndex[SideLeft] = 4; mDevice->RealOut.ChannelIndex[SideRight] = 5; break; - case DevFmtX51Rear: - mDevice->RealOut.ChannelIndex[FrontLeft] = 0; - mDevice->RealOut.ChannelIndex[FrontRight] = 1; - mDevice->RealOut.ChannelIndex[FrontCenter] = 2; - mDevice->RealOut.ChannelIndex[LFE] = 3; - mDevice->RealOut.ChannelIndex[BackLeft] = 4; - mDevice->RealOut.ChannelIndex[BackRight] = 5; - break; case DevFmtX61: mDevice->RealOut.ChannelIndex[FrontLeft] = 0; mDevice->RealOut.ChannelIndex[FrontRight] = 1; @@ -117,11 +109,11 @@ void BackendBase::setDefaultChannelOrder() switch(mDevice->FmtChans) { - case DevFmtX51Rear: + case DevFmtX51: mDevice->RealOut.ChannelIndex[FrontLeft] = 0; mDevice->RealOut.ChannelIndex[FrontRight] = 1; - mDevice->RealOut.ChannelIndex[BackLeft] = 2; - mDevice->RealOut.ChannelIndex[BackRight] = 3; + mDevice->RealOut.ChannelIndex[SideLeft] = 2; + mDevice->RealOut.ChannelIndex[SideRight] = 3; mDevice->RealOut.ChannelIndex[FrontCenter] = 4; mDevice->RealOut.ChannelIndex[LFE] = 5; return; @@ -140,7 +132,6 @@ void BackendBase::setDefaultChannelOrder() case DevFmtMono: case DevFmtStereo: case DevFmtQuad: - case DevFmtX51: case DevFmtX61: case DevFmtAmbi3D: setDefaultWFXChannelOrder(); @@ -151,6 +142,13 @@ void BackendBase::setDefaultChannelOrder() #ifdef _WIN32 void BackendBase::setChannelOrderFromWFXMask(uint chanmask) { + constexpr uint x51{SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER + | SPEAKER_LOW_FREQUENCY | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT}; + constexpr uint x51rear{SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER + | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT}; + /* Swap a 5.1 mask using the back channels for one with the sides. */ + if(chanmask == x51rear) chanmask = x51; + auto get_channel = [](const DWORD chanbit) noexcept -> al::optional<Channel> { switch(chanbit) diff --git a/alc/backends/coreaudio.cpp b/alc/backends/coreaudio.cpp index b41b7d00..1111b340 100644 --- a/alc/backends/coreaudio.cpp +++ b/alc/backends/coreaudio.cpp @@ -760,7 +760,6 @@ void CoreAudioCapture::open(const char *name) case DevFmtQuad: case DevFmtX51: - case DevFmtX51Rear: case DevFmtX61: case DevFmtX71: case DevFmtAmbi3D: diff --git a/alc/backends/dsound.cpp b/alc/backends/dsound.cpp index 401f8165..6513e8f3 100644 --- a/alc/backends/dsound.cpp +++ b/alc/backends/dsound.cpp @@ -402,10 +402,8 @@ bool DSoundPlayback::reset() mDevice->FmtChans = DevFmtStereo; else if(speakers == DSSPEAKER_QUAD) mDevice->FmtChans = DevFmtQuad; - else if(speakers == DSSPEAKER_5POINT1_SURROUND) + else if(speakers == DSSPEAKER_5POINT1_SURROUND || speakers == DSSPEAKER_5POINT1_BACK) mDevice->FmtChans = DevFmtX51; - else if(speakers == DSSPEAKER_5POINT1_BACK) - mDevice->FmtChans = DevFmtX51Rear; else if(speakers == DSSPEAKER_7POINT1 || speakers == DSSPEAKER_7POINT1_SURROUND) mDevice->FmtChans = DevFmtX71; else @@ -422,7 +420,6 @@ bool DSoundPlayback::reset() case DevFmtStereo: OutputType.dwChannelMask = STEREO; break; case DevFmtQuad: OutputType.dwChannelMask = QUAD; break; case DevFmtX51: OutputType.dwChannelMask = X5DOT1; break; - case DevFmtX51Rear: OutputType.dwChannelMask = X5DOT1REAR; break; case DevFmtX61: OutputType.dwChannelMask = X6DOT1; break; case DevFmtX71: OutputType.dwChannelMask = X7DOT1; break; } @@ -639,7 +636,6 @@ void DSoundCapture::open(const char *name) case DevFmtStereo: InputType.dwChannelMask = STEREO; break; case DevFmtQuad: InputType.dwChannelMask = QUAD; break; case DevFmtX51: InputType.dwChannelMask = X5DOT1; break; - case DevFmtX51Rear: InputType.dwChannelMask = X5DOT1REAR; break; case DevFmtX61: InputType.dwChannelMask = X6DOT1; break; case DevFmtX71: InputType.dwChannelMask = X7DOT1; break; case DevFmtAmbi3D: diff --git a/alc/backends/oboe.cpp b/alc/backends/oboe.cpp index ddc3f0b9..aefda974 100644 --- a/alc/backends/oboe.cpp +++ b/alc/backends/oboe.cpp @@ -131,38 +131,15 @@ bool OboePlayback::reset() mStream->getBufferCapacityInFrames())); TRACE("Got stream with properties:\n%s", oboe::convertToText(mStream.get())); - switch(mStream->getChannelCount()) + if(static_cast<uint>(mStream->getChannelCount()) != mDevice->channelsFromFmt()) { - case oboe::ChannelCount::Mono: - mDevice->FmtChans = DevFmtMono; - break; - case oboe::ChannelCount::Stereo: - mDevice->FmtChans = DevFmtStereo; - break; - /* Other potential configurations. Could be wrong, but better than failing. - * Assume WFX channel order. - */ - case 4: - mDevice->FmtChans = DevFmtQuad; - break; - case 6: - mDevice->FmtChans = DevFmtX51Rear; - break; - case 7: - mDevice->FmtChans = DevFmtX61; - break; - case 8: - mDevice->FmtChans = DevFmtX71; - break; - default: - if(mStream->getChannelCount() < 1) + if(mStream->getChannelCount() >= 2) + mDevice->FmtChans = DevFmtStereo; + else if(mStream->getChannelCount() == 1) + mDevice->FmtChans = DevFmtMono; + else throw al::backend_exception{al::backend_error::DeviceError, "Got unhandled channel count: %d", mStream->getChannelCount()}; - /* Assume first two channels are front left/right. We can do a stereo - * mix and keep the other channels silent. - */ - mDevice->FmtChans = DevFmtStereo; - break; } setDefaultWFXChannelOrder(); @@ -252,7 +229,6 @@ void OboeCapture::open(const char *name) break; case DevFmtQuad: case DevFmtX51: - case DevFmtX51Rear: case DevFmtX61: case DevFmtX71: case DevFmtAmbi3D: diff --git a/alc/backends/opensl.cpp b/alc/backends/opensl.cpp index 7be7f031..eb65afa6 100644 --- a/alc/backends/opensl.cpp +++ b/alc/backends/opensl.cpp @@ -68,9 +68,6 @@ constexpr SLuint32 GetChannelMask(DevFmtChannels chans) noexcept case DevFmtX51: return SL_SPEAKER_FRONT_LEFT | SL_SPEAKER_FRONT_RIGHT | SL_SPEAKER_FRONT_CENTER | SL_SPEAKER_LOW_FREQUENCY | SL_SPEAKER_SIDE_LEFT | SL_SPEAKER_SIDE_RIGHT; - case DevFmtX51Rear: return SL_SPEAKER_FRONT_LEFT | SL_SPEAKER_FRONT_RIGHT | - SL_SPEAKER_FRONT_CENTER | SL_SPEAKER_LOW_FREQUENCY | SL_SPEAKER_BACK_LEFT | - SL_SPEAKER_BACK_RIGHT; case DevFmtX61: return SL_SPEAKER_FRONT_LEFT | SL_SPEAKER_FRONT_RIGHT | SL_SPEAKER_FRONT_CENTER | SL_SPEAKER_LOW_FREQUENCY | SL_SPEAKER_BACK_CENTER | SL_SPEAKER_SIDE_LEFT | SL_SPEAKER_SIDE_RIGHT; diff --git a/alc/backends/pulseaudio.cpp b/alc/backends/pulseaudio.cpp index 23bcecad..cece08a0 100644 --- a/alc/backends/pulseaudio.cpp +++ b/alc/backends/pulseaudio.cpp @@ -785,7 +785,7 @@ void PulsePlayback::sinkInfoCallback(pa_context*, const pa_sink_info *info, int { DevFmtX71, X71ChanMap }, { DevFmtX61, X61ChanMap }, { DevFmtX51, X51ChanMap }, - { DevFmtX51Rear, X51RearChanMap }, + { DevFmtX51, X51RearChanMap }, { DevFmtQuad, QuadChanMap }, { DevFmtStereo, StereoChanMap }, { DevFmtMono, MonoChanMap } @@ -957,9 +957,6 @@ bool PulsePlayback::reset() case DevFmtX51: chanmap = X51ChanMap; break; - case DevFmtX51Rear: - chanmap = X51RearChanMap; - break; case DevFmtX61: chanmap = X61ChanMap; break; @@ -1238,9 +1235,6 @@ void PulseCapture::open(const char *name) case DevFmtX51: chanmap = X51ChanMap; break; - case DevFmtX51Rear: - chanmap = X51RearChanMap; - break; case DevFmtX61: chanmap = X61ChanMap; break; diff --git a/alc/backends/wasapi.cpp b/alc/backends/wasapi.cpp index d38fc25d..e726e8f1 100644 --- a/alc/backends/wasapi.cpp +++ b/alc/backends/wasapi.cpp @@ -876,10 +876,9 @@ HRESULT WasapiPlayback::resetProxy() mDevice->FmtChans = DevFmtX71; else if(chancount >= 7 && (chanmask&X61Mask) == X6DOT1) mDevice->FmtChans = DevFmtX61; - else if(chancount >= 6 && (chanmask&X51Mask) == X5DOT1) + else if(chancount >= 6 && ((chanmask&X51Mask) == X5DOT1 + || (chanmask&X51RearMask) == X5DOT1REAR)) mDevice->FmtChans = DevFmtX51; - else if(chancount >= 6 && (chanmask&X51RearMask) == X5DOT1REAR) - mDevice->FmtChans = DevFmtX51Rear; else if(chancount >= 4 && (chanmask&QuadMask) == QUAD) mDevice->FmtChans = DevFmtQuad; else if(chancount >= 2 && (chanmask&StereoMask) == STEREO) @@ -912,10 +911,6 @@ HRESULT WasapiPlayback::resetProxy() OutputType.Format.nChannels = 6; OutputType.dwChannelMask = X5DOT1; break; - case DevFmtX51Rear: - OutputType.Format.nChannels = 6; - OutputType.dwChannelMask = X5DOT1REAR; - break; case DevFmtX61: OutputType.Format.nChannels = 7; OutputType.dwChannelMask = X6DOT1; @@ -995,10 +990,9 @@ HRESULT WasapiPlayback::resetProxy() mDevice->FmtChans = DevFmtX71; else if(chancount >= 7 && (chanmask&X61Mask) == X6DOT1) mDevice->FmtChans = DevFmtX61; - else if(chancount >= 6 && (chanmask&X51Mask) == X5DOT1) + else if(chancount >= 6 && ((chanmask&X51Mask) == X5DOT1 + || (chanmask&X51RearMask) == X5DOT1REAR)) mDevice->FmtChans = DevFmtX51; - else if(chancount >= 6 && (chanmask&X51RearMask) == X5DOT1REAR) - mDevice->FmtChans = DevFmtX51Rear; else if(chancount >= 4 && (chanmask&QuadMask) == QUAD) mDevice->FmtChans = DevFmtQuad; else if(chancount >= 2 && (chanmask&StereoMask) == STEREO) @@ -1421,10 +1415,6 @@ HRESULT WasapiCapture::resetProxy() InputType.Format.nChannels = 6; InputType.dwChannelMask = X5DOT1; break; - case DevFmtX51Rear: - InputType.Format.nChannels = 6; - InputType.dwChannelMask = X5DOT1REAR; - break; case DevFmtX61: InputType.Format.nChannels = 7; InputType.dwChannelMask = X6DOT1; @@ -1509,7 +1499,6 @@ HRESULT WasapiCapture::resetProxy() return (chancount == 4 && (chanmask == 0 || (chanmask&QuadMask) == QUAD)); /* 5.1 (Side) and 5.1 (Rear) are interchangeable here. */ case DevFmtX51: - case DevFmtX51Rear: return (chancount == 6 && (chanmask == 0 || (chanmask&X51Mask) == X5DOT1 || (chanmask&X51RearMask) == X5DOT1REAR)); case DevFmtX61: diff --git a/alc/backends/wave.cpp b/alc/backends/wave.cpp index 259cbc62..b0ead591 100644 --- a/alc/backends/wave.cpp +++ b/alc/backends/wave.cpp @@ -269,7 +269,6 @@ bool WaveBackend::reset() case DevFmtStereo: chanmask = 0x01 | 0x02; break; case DevFmtQuad: chanmask = 0x01 | 0x02 | 0x10 | 0x20; break; case DevFmtX51: chanmask = 0x01 | 0x02 | 0x04 | 0x08 | 0x200 | 0x400; break; - case DevFmtX51Rear: chanmask = 0x01 | 0x02 | 0x04 | 0x08 | 0x010 | 0x020; break; case DevFmtX61: chanmask = 0x01 | 0x02 | 0x04 | 0x08 | 0x100 | 0x200 | 0x400; break; case DevFmtX71: chanmask = 0x01 | 0x02 | 0x04 | 0x08 | 0x010 | 0x020 | 0x200 | 0x400; break; case DevFmtAmbi3D: diff --git a/alc/backends/winmm.cpp b/alc/backends/winmm.cpp index 5a2f00f8..e0e82283 100644 --- a/alc/backends/winmm.cpp +++ b/alc/backends/winmm.cpp @@ -476,7 +476,6 @@ void WinMMCapture::open(const char *name) case DevFmtQuad: case DevFmtX51: - case DevFmtX51Rear: case DevFmtX61: case DevFmtX71: case DevFmtAmbi3D: diff --git a/alc/panning.cpp b/alc/panning.cpp index 02c181d6..be7f13e1 100644 --- a/alc/panning.cpp +++ b/alc/panning.cpp @@ -399,9 +399,9 @@ DecoderView MakeDecoderView(ALCdevice *device, const AmbDecConf *conf, else if(speaker.Name == "CE") ch = FrontCenter; else if(speaker.Name == "LS") - ch = (device->FmtChans == DevFmtX51Rear) ? BackLeft : SideLeft; + ch = SideLeft; else if(speaker.Name == "RS") - ch = (device->FmtChans == DevFmtX51Rear) ? BackRight : SideRight; + ch = SideRight; else if(speaker.Name == "LB") ch = (device->FmtChans == DevFmtX51) ? SideLeft : BackLeft; else if(speaker.Name == "RB") @@ -500,26 +500,6 @@ constexpr DecoderConfig<DualBand, 5> X51Config{ {{4.90109850e-1f, -3.77305010e-1f, -3.73106990e-1f, 1.25914530e-1f, 1.45133000e-2f}}, }} }; -constexpr DecoderConfig<DualBand, 5> X51RearConfig{ - 2, false, {{BackLeft, FrontLeft, FrontCenter, FrontRight, BackRight}}, - DevAmbiScaling::FuMa, - /*HF*/{{1.00000000e+0f, 1.00000000e+0f, 1.00000000e+0f}}, - {{ - {{5.67316000e-1f, 4.22920000e-1f, -3.15495000e-1f, -6.34490000e-2f, -2.92380000e-2f}}, - {{3.68584000e-1f, 2.72349000e-1f, 3.21616000e-1f, 1.92645000e-1f, 4.82600000e-2f}}, - {{1.83579000e-1f, 0.00000000e+0f, 1.99588000e-1f, 0.00000000e+0f, 9.62820000e-2f}}, - {{3.68584000e-1f, -2.72349000e-1f, 3.21616000e-1f, -1.92645000e-1f, 4.82600000e-2f}}, - {{5.67316000e-1f, -4.22920000e-1f, -3.15495000e-1f, 6.34490000e-2f, -2.92380000e-2f}}, - }}, - /*LF*/{{1.00000000e+0f, 1.00000000e+0f, 1.00000000e+0f}}, - {{ - {{4.90109850e-1f, 3.77305010e-1f, -3.73106990e-1f, -1.25914530e-1f, 1.45133000e-2f}}, - {{1.49085730e-1f, 3.03561680e-1f, 1.53290060e-1f, 2.45112480e-1f, -1.50753130e-1f}}, - {{1.37654920e-1f, 0.00000000e+0f, 4.49417940e-1f, 0.00000000e+0f, 2.57844070e-1f}}, - {{1.49085730e-1f, -3.03561680e-1f, 1.53290060e-1f, -2.45112480e-1f, -1.50753130e-1f}}, - {{4.90109850e-1f, -3.77305010e-1f, -3.73106990e-1f, 1.25914530e-1f, 1.45133000e-2f}}, - }} -}; constexpr DecoderConfig<SingleBand, 5> X61Config{ 2, false, {{SideLeft, FrontLeft, FrontRight, SideRight, BackCenter}}, DevAmbiScaling::N3D, @@ -566,7 +546,6 @@ void InitPanning(ALCdevice *device, const bool hqdec=false, const bool stablize= case DevFmtStereo: decoder = StereoConfig; break; case DevFmtQuad: decoder = QuadConfig; break; case DevFmtX51: decoder = X51Config; break; - case DevFmtX51Rear: decoder = X51RearConfig; break; case DevFmtX61: decoder = X61Config; break; case DevFmtX71: decoder = X71Config; break; case DevFmtAmbi3D: @@ -871,8 +850,7 @@ void aluInitRenderer(ALCdevice *device, int hrtf_id, HrtfRequestMode hrtf_appreq switch(device->FmtChans) { case DevFmtQuad: layout = "quad"; break; - case DevFmtX51: /* fall-through */ - case DevFmtX51Rear: layout = "surround51"; break; + case DevFmtX51: layout = "surround51"; break; case DevFmtX61: layout = "surround61"; break; case DevFmtX71: layout = "surround71"; break; /* Mono, Stereo, and Ambisonics output don't use custom decoders. */ diff --git a/core/devformat.cpp b/core/devformat.cpp index d13ef3c6..c841b634 100644 --- a/core/devformat.cpp +++ b/core/devformat.cpp @@ -26,7 +26,6 @@ uint ChannelsFromDevFmt(DevFmtChannels chans, uint ambiorder) noexcept case DevFmtStereo: return 2; case DevFmtQuad: return 4; case DevFmtX51: return 6; - case DevFmtX51Rear: return 6; case DevFmtX61: return 7; case DevFmtX71: return 8; case DevFmtAmbi3D: return (ambiorder+1) * (ambiorder+1); @@ -56,7 +55,6 @@ const char *DevFmtChannelsString(DevFmtChannels chans) noexcept case DevFmtStereo: return "Stereo"; case DevFmtQuad: return "Quadraphonic"; case DevFmtX51: return "5.1 Surround"; - case DevFmtX51Rear: return "5.1 Surround (Rear)"; case DevFmtX61: return "6.1 Surround"; case DevFmtX71: return "7.1 Surround"; case DevFmtAmbi3D: return "Ambisonic 3D"; diff --git a/core/devformat.h b/core/devformat.h index 34695361..e6d30924 100644 --- a/core/devformat.h +++ b/core/devformat.h @@ -50,9 +50,6 @@ enum DevFmtChannels : unsigned char { DevFmtX71, DevFmtAmbi3D, - /* Similar to 5.1, except using rear channels instead of sides */ - DevFmtX51Rear, - DevFmtChannelsDefault = DevFmtStereo }; #define MAX_OUTPUT_CHANNELS 16 |