From 6ee614dfda30dbcd7c7d945976535188591a329e Mon Sep 17 00:00:00 2001 From: str1k3r <115313679+S1l3ntStr1ke87@users.noreply.github.com> Date: Sat, 18 Jul 2026 01:19:10 -0400 Subject: [PATCH] fix(orbis): better fix for orbis voicechat crash This most likely can be fixed a more proper way but this is what works and is better then the previous method --- Minecraft.Client/Orbis/Network/SonyVoiceChat_Orbis.cpp | 8 +++----- Minecraft.Client/Orbis/Network/SonyVoiceChat_Orbis.h | 5 +++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Minecraft.Client/Orbis/Network/SonyVoiceChat_Orbis.cpp b/Minecraft.Client/Orbis/Network/SonyVoiceChat_Orbis.cpp index 48e6f566..9f00d2f7 100644 --- a/Minecraft.Client/Orbis/Network/SonyVoiceChat_Orbis.cpp +++ b/Minecraft.Client/Orbis/Network/SonyVoiceChat_Orbis.cpp @@ -26,8 +26,6 @@ static const int sc_thresholdValue = 100; static const bool sc_verbose = false; -static const int sce_voice_port = 25566; // str1k3r - use of SCE_VOICE_INVALID_PORT_ID causes a crash when loading / making worlds. - // #define _USE_PCM_AUDIO_ //#define USE_PCM_MIC_DATA @@ -43,14 +41,14 @@ static void CreatePort(uint32_t *portId, const SceVoicePortParam *pArg) int err = sceVoiceCreatePort( portId, pArg ); assert(err == SCE_OK); - assert(*portId != sce_voice_port); + assert(*portId != VOICE_INVALID_PORT_ID); C4JThread::PopAffinity(); // PS4 only } static void DeletePort(uint32_t& port) { int32_t result; - if (port != sce_voice_port) + if (port != VOICE_INVALID_PORT_ID) { result = sceVoiceDeletePort( port ); if (result != SCE_OK) @@ -58,7 +56,7 @@ static void DeletePort(uint32_t& port) app.DebugPrintf("sceVoiceDeletePort failed %0x\n", result); assert(0); } - port = sce_voice_port; + port = VOICE_INVALID_PORT_ID; } } diff --git a/Minecraft.Client/Orbis/Network/SonyVoiceChat_Orbis.h b/Minecraft.Client/Orbis/Network/SonyVoiceChat_Orbis.h index f7feb585..455f0b53 100644 --- a/Minecraft.Client/Orbis/Network/SonyVoiceChat_Orbis.h +++ b/Minecraft.Client/Orbis/Network/SonyVoiceChat_Orbis.h @@ -8,6 +8,7 @@ static const int sc_maxVoiceDataSize = 2048; +#define VOICE_INVALID_PORT_ID 0xff // str1k3r - use of SCE_VOICE_INVALID_PORT_ID causes a crash when loading / making worlds. class VoicePacket { @@ -87,9 +88,9 @@ public: public: SQRLocalVoiceDevice() - : m_headsetPort(SCE_VOICE_INVALID_PORT_ID) - , m_microphonePort(SCE_VOICE_INVALID_PORT_ID) , m_localUserID(SCE_USER_SERVICE_USER_ID_INVALID) + : m_headsetPort(VOICE_INVALID_PORT_ID) + , m_microphonePort(VOICE_INVALID_PORT_ID) { for(int i=0;i<4;i++) m_localConnections[i] = 0;