mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-27 00:28:14 +00:00
feat(libSceVoiceChat): export missing firmware voice chat interfaces
This commit is contained in:
1 parent
72a3d9f2a4
commit
0f38f0fe58
4 files changed
+168
No files matched your search
@@ -574,4 +574,14 @@ if(BUILD_TESTING)
|
||||
set_tests_properties(guest_acm PROPERTIES ENVIRONMENT_MODIFICATION
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libSceAcm>")
|
||||
endif()
|
||||
|
||||
add_test_executable(guest_voice_chat_tests tests/GuestVoiceChat.cpp)
|
||||
target_include_directories(guest_voice_chat_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(guest_voice_chat_tests PRIVATE libSceVoiceChat libc)
|
||||
configure_windows_unwind(guest_voice_chat_tests)
|
||||
add_test(NAME guest_voice_chat COMMAND guest_voice_chat_tests)
|
||||
if(WIN32)
|
||||
set_tests_properties(guest_voice_chat PROPERTIES ENVIRONMENT_MODIFICATION
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libSceVoiceChat>")
|
||||
endif()
|
||||
endif()
|
||||
@@ -65,4 +65,101 @@ VOICECHAT_OFFLINE_REQUEST(sceVoiceChatRequestCreateVoiceChatGroup)
|
||||
VOICECHAT_OFFLINE_REQUEST(sceVoiceChatRequestJoinVoiceChatGroup)
|
||||
VOICECHAT_OFFLINE_REQUEST(sceVoiceChatRequestLeaveVoiceChatGroup)
|
||||
VOICECHAT_OFFLINE_REQUEST(sceVoiceChatRequestDeleteVoiceChatGroup)
|
||||
|
||||
VOICECHAT_OFFLINE_REQUEST(sceVoiceChatRequest0)
|
||||
VOICECHAT_OFFLINE_REQUEST(sceVoiceChatRequest1)
|
||||
VOICECHAT_OFFLINE_REQUEST(sceVoiceChatRequestAcsTts)
|
||||
VOICECHAT_OFFLINE_REQUEST(sceVoiceChatRequestAction)
|
||||
VOICECHAT_OFFLINE_REQUEST(sceVoiceChatRequestSetMemberVolume)
|
||||
VOICECHAT_OFFLINE_REQUEST(sceVoiceChatRequestUpdateGameSessionVoiceChatChannelName)
|
||||
VOICECHAT_OFFLINE_REQUEST(sceVoiceChatRequestUpdatePlayerSessionVoiceChatChannelName)
|
||||
|
||||
int APS5_VABI sceVoiceChatAbortRequest(int requestId) {
|
||||
(void)requestId;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceVoiceChatGetActiveChannel(void* channel) {
|
||||
(void)channel;
|
||||
logSoft(__func__, "SIGNED_OUT (offline)");
|
||||
return VOICECHAT_ERROR_SIGNED_OUT;
|
||||
}
|
||||
|
||||
int APS5_VABI sceVoiceChatGetChannelMemberActiveChannelMatchingState(void* a, void* b) {
|
||||
(void)a;
|
||||
(void)b;
|
||||
logSoft(__func__, "SIGNED_OUT (offline)");
|
||||
return VOICECHAT_ERROR_SIGNED_OUT;
|
||||
}
|
||||
|
||||
int APS5_VABI sceVoiceChatGetChannelMemberVoiceConnectionState(void* a, void* b) {
|
||||
(void)a;
|
||||
(void)b;
|
||||
logSoft(__func__, "SIGNED_OUT (offline)");
|
||||
return VOICECHAT_ERROR_SIGNED_OUT;
|
||||
}
|
||||
|
||||
int APS5_VABI sceVoiceChatGetChatChannelMemberInfoList(void* a, void* b) {
|
||||
(void)a;
|
||||
(void)b;
|
||||
logSoft(__func__, "SIGNED_OUT (offline)");
|
||||
return VOICECHAT_ERROR_SIGNED_OUT;
|
||||
}
|
||||
|
||||
int APS5_VABI sceVoiceChatGetChatGroupMemberInfoList(void* a, void* b) {
|
||||
(void)a;
|
||||
(void)b;
|
||||
logSoft(__func__, "SIGNED_OUT (offline)");
|
||||
return VOICECHAT_ERROR_SIGNED_OUT;
|
||||
}
|
||||
|
||||
int APS5_VABI sceVoiceChatGetMicState(void* state) {
|
||||
(void)state;
|
||||
logSoft(__func__, "SIGNED_OUT (offline)");
|
||||
return VOICECHAT_ERROR_SIGNED_OUT;
|
||||
}
|
||||
|
||||
int APS5_VABI sceVoiceChatGetUserVoiceVolumeGain(void* a, void* gain) {
|
||||
(void)a;
|
||||
(void)gain;
|
||||
logSoft(__func__, "SIGNED_OUT (offline)");
|
||||
return VOICECHAT_ERROR_SIGNED_OUT;
|
||||
}
|
||||
|
||||
int APS5_VABI sceVoiceChatSetUserVoiceVolumeGain(void* a, int32_t gain) {
|
||||
(void)a;
|
||||
(void)gain;
|
||||
logSoft(__func__, "SIGNED_OUT (offline)");
|
||||
return VOICECHAT_ERROR_SIGNED_OUT;
|
||||
}
|
||||
|
||||
int APS5_VABI sceVoiceChatRegisterChannelEventHandler(void* a, void* b) { (void)a; (void)b; return 0; }
|
||||
int APS5_VABI sceVoiceChatRegisterDaemonEventHandler(void* a, void* b) { (void)a; (void)b; return 0; }
|
||||
int APS5_VABI sceVoiceChatRegisterMemberEventHandler(void* a, void* b) { (void)a; (void)b; return 0; }
|
||||
int APS5_VABI sceVoiceChatRegisterPartyUserStateChangedHandler(void* a, void* b) { (void)a; (void)b; return 0; }
|
||||
int APS5_VABI sceVoiceChatRegisterVoiceEventHandler(void* a, void* b) { (void)a; (void)b; return 0; }
|
||||
|
||||
int APS5_VABI sceVoiceChatStartAccessibilityEvent(void* a) { (void)a; return 0; }
|
||||
int APS5_VABI sceVoiceChatStartChannelEvent(void* a) { (void)a; return 0; }
|
||||
int APS5_VABI sceVoiceChatStartDaemonEvent(void* a) { (void)a; return 0; }
|
||||
int APS5_VABI sceVoiceChatStartMemberEvent(void* a) { (void)a; return 0; }
|
||||
int APS5_VABI sceVoiceChatStartRangedMemberEvent(void* a) { (void)a; return 0; }
|
||||
int APS5_VABI sceVoiceChatStartVoiceEvent(void* a) { (void)a; return 0; }
|
||||
|
||||
int APS5_VABI sceVoiceChatStopAccessibilityEvent(void* a) { (void)a; return 0; }
|
||||
int APS5_VABI sceVoiceChatStopChannelEvent(void* a) { (void)a; return 0; }
|
||||
int APS5_VABI sceVoiceChatStopDaemonEvent(void* a) { (void)a; return 0; }
|
||||
int APS5_VABI sceVoiceChatStopMemberEvent(void* a) { (void)a; return 0; }
|
||||
int APS5_VABI sceVoiceChatStopRangedMemberEvent(void* a) { (void)a; return 0; }
|
||||
int APS5_VABI sceVoiceChatStopVoiceEvent(void* a) { (void)a; return 0; }
|
||||
|
||||
int APS5_VABI sceVoiceChatUnregisterAccessibilityEventHandler(void* a) { (void)a; return 0; }
|
||||
int APS5_VABI sceVoiceChatUnregisterChannelEventHandler(void* a) { (void)a; return 0; }
|
||||
int APS5_VABI sceVoiceChatUnregisterDaemonEventHandler(void* a) { (void)a; return 0; }
|
||||
int APS5_VABI sceVoiceChatUnregisterMemberEventHandler(void* a) { (void)a; return 0; }
|
||||
int APS5_VABI sceVoiceChatUnregisterMicEventHandler(void* a) { (void)a; return 0; }
|
||||
int APS5_VABI sceVoiceChatUnregisterPartyUserStateChangedHandler(void* a) { (void)a; return 0; }
|
||||
int APS5_VABI sceVoiceChatUnregisterRangedMemberEventHandler(void* a) { (void)a; return 0; }
|
||||
int APS5_VABI sceVoiceChatUnregisterVoiceEventHandler(void* a) { (void)a; return 0; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
#include "prx/libc/include/general/VabiMacros.hpp"
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
|
||||
extern "C" {
|
||||
int APS5_VABI sceVoiceChatInitialize(void* param);
|
||||
int APS5_VABI sceVoiceChatTerminate(void);
|
||||
int APS5_VABI sceVoiceChatRegisterHandlers(void* a);
|
||||
int APS5_VABI sceVoiceChatRegisterMicEventHandler(void* a, void* b);
|
||||
int APS5_VABI sceVoiceChatRegisterChannelEventHandler(void* a, void* b);
|
||||
int APS5_VABI sceVoiceChatUnregisterMicEventHandler(void* a);
|
||||
int APS5_VABI sceVoiceChatProcessEvent(void);
|
||||
int APS5_VABI sceVoiceChatStartChannelEvent(void* a);
|
||||
int APS5_VABI sceVoiceChatStopChannelEvent(void* a);
|
||||
int APS5_VABI sceVoiceChatGetMicState(int32_t* state);
|
||||
int APS5_VABI sceVoiceChatGetUserVoiceVolumeGain(void* a, int32_t* gain);
|
||||
int APS5_VABI sceVoiceChatSetUserVoiceVolumeGain(void* a, int32_t gain);
|
||||
int APS5_VABI sceVoiceChatGetActiveChannel(void* channel);
|
||||
int APS5_VABI sceVoiceChatCreateRequest(void* a, void* b);
|
||||
int APS5_VABI sceVoiceChatRequestAcsTts(int requestId, void* a, void* b);
|
||||
int APS5_VABI sceVoiceChatAbortRequest(int requestId);
|
||||
}
|
||||
|
||||
static void Require(bool value, const char* what) {
|
||||
if (value) return;
|
||||
std::printf("VoiceChat: %s\n", what);
|
||||
std::abort();
|
||||
}
|
||||
|
||||
int main() {
|
||||
constexpr int kSignedOut = static_cast<int>(0x80550006u);
|
||||
|
||||
Require(sceVoiceChatInitialize(nullptr) == 0, "initialization failed");
|
||||
Require(sceVoiceChatProcessEvent() == 0, "event processing failed");
|
||||
Require(sceVoiceChatRegisterHandlers(nullptr) == 0, "register handlers failed");
|
||||
Require(sceVoiceChatRegisterMicEventHandler(nullptr, nullptr) == 0, "register mic event handler failed");
|
||||
Require(sceVoiceChatRegisterChannelEventHandler(nullptr, nullptr) == 0, "register channel event handler failed");
|
||||
Require(sceVoiceChatUnregisterMicEventHandler(nullptr) == 0, "unregister mic event handler failed");
|
||||
Require(sceVoiceChatStartChannelEvent(nullptr) == 0, "start channel event failed");
|
||||
Require(sceVoiceChatStopChannelEvent(nullptr) == 0, "stop channel event failed");
|
||||
|
||||
Require(sceVoiceChatGetMicState(nullptr) == kSignedOut, "get mic state did not return signed out");
|
||||
Require(sceVoiceChatGetUserVoiceVolumeGain(nullptr, nullptr) == kSignedOut, "get volume gain did not return signed out");
|
||||
Require(sceVoiceChatSetUserVoiceVolumeGain(nullptr, 50) == kSignedOut, "set volume gain did not return signed out");
|
||||
|
||||
Require(sceVoiceChatGetActiveChannel(nullptr) == kSignedOut, "get active channel did not return signed out");
|
||||
Require(sceVoiceChatCreateRequest(nullptr, nullptr) == kSignedOut, "create request did not return signed out");
|
||||
Require(sceVoiceChatRequestAcsTts(1, nullptr, nullptr) == kSignedOut, "tts request did not return signed out");
|
||||
Require(sceVoiceChatAbortRequest(1) == 0, "abort request failed");
|
||||
Require(sceVoiceChatTerminate() == 0, "termination failed");
|
||||
|
||||
std::puts("VoiceChat tests passed");
|
||||
return 0;
|
||||
}
|
||||
@@ -1,5 +1,10 @@
|
||||
# libSceVoiceChat technical debt
|
||||
|
||||
### Silent stubs
|
||||
|
||||
- [sceVoiceChatAbortRequest, sceVoiceChatRegisterChannelEventHandler, sceVoiceChatRegisterDaemonEventHandler, sceVoiceChatRegisterMemberEventHandler, sceVoiceChatRegisterPartyUserStateChangedHandler, sceVoiceChatRegisterVoiceEventHandler, sceVoiceChatStartAccessibilityEvent, sceVoiceChatStartChannelEvent, sceVoiceChatStartDaemonEvent, sceVoiceChatStartMemberEvent, sceVoiceChatStartRangedMemberEvent, sceVoiceChatStartVoiceEvent, sceVoiceChatStopAccessibilityEvent, sceVoiceChatStopChannelEvent, sceVoiceChatStopDaemonEvent, sceVoiceChatStopMemberEvent, sceVoiceChatStopRangedMemberEvent, sceVoiceChatStopVoiceEvent, sceVoiceChatUnregisterAccessibilityEventHandler, sceVoiceChatUnregisterChannelEventHandler, sceVoiceChatUnregisterDaemonEventHandler, sceVoiceChatUnregisterMemberEventHandler, sceVoiceChatUnregisterMicEventHandler, sceVoiceChatUnregisterPartyUserStateChangedHandler, sceVoiceChatUnregisterRangedMemberEventHandler, sceVoiceChatUnregisterVoiceEventHandler](../../../core/libs/prx/libSceVoiceChat/Export.cpp) (libSceVoiceChat) - offline handler registration and event controls return 0 without connecting to a voice chat daemon, because the host environment does not run a PSN voice chat service; titles that register event listeners or start/stop audio capture events proceed safely without throwing
|
||||
|
||||
### Unknown function info
|
||||
|
||||
- [sceVoiceChatAbortRequest, sceVoiceChatGetActiveChannel, sceVoiceChatGetChannelMemberActiveChannelMatchingState, sceVoiceChatGetChannelMemberVoiceConnectionState, sceVoiceChatGetChatChannelMemberInfoList, sceVoiceChatGetChatGroupMemberInfoList, sceVoiceChatGetMicState, sceVoiceChatGetUserVoiceVolumeGain, sceVoiceChatRegisterChannelEventHandler, sceVoiceChatRegisterDaemonEventHandler, sceVoiceChatRegisterMemberEventHandler, sceVoiceChatRegisterPartyUserStateChangedHandler, sceVoiceChatRegisterVoiceEventHandler, sceVoiceChatRequest0, sceVoiceChatRequest1, sceVoiceChatRequestAcsTts, sceVoiceChatRequestAction, sceVoiceChatRequestSetMemberVolume, sceVoiceChatRequestUpdateGameSessionVoiceChatChannelName, sceVoiceChatRequestUpdatePlayerSessionVoiceChatChannelName, sceVoiceChatSetUserVoiceVolumeGain, sceVoiceChatStartAccessibilityEvent, sceVoiceChatStartChannelEvent, sceVoiceChatStartDaemonEvent, sceVoiceChatStartMemberEvent, sceVoiceChatStartRangedMemberEvent, sceVoiceChatStartVoiceEvent, sceVoiceChatStopAccessibilityEvent, sceVoiceChatStopChannelEvent, sceVoiceChatStopDaemonEvent, sceVoiceChatStopMemberEvent, sceVoiceChatStopRangedMemberEvent, sceVoiceChatStopVoiceEvent, sceVoiceChatUnregisterAccessibilityEventHandler, sceVoiceChatUnregisterChannelEventHandler, sceVoiceChatUnregisterDaemonEventHandler, sceVoiceChatUnregisterMemberEventHandler, sceVoiceChatUnregisterMicEventHandler, sceVoiceChatUnregisterPartyUserStateChangedHandler, sceVoiceChatUnregisterRangedMemberEventHandler, sceVoiceChatUnregisterVoiceEventHandler](../../../core/libs/prx/libSceVoiceChat/Export.cpp) (libSceVoiceChat) - parameter layouts are inferred; offline, handlers and event controls return 0, query calls, volume gain controls, and requests return `SIGNED_OUT` (0x80550006) without modifying guest buffers
|
||||
- [sceVoiceChatRequestCreateVoiceChatGroup, sceVoiceChatRequestJoinVoiceChatGroup, sceVoiceChatRequestLeaveVoiceChatGroup, sceVoiceChatRequestDeleteVoiceChatGroup](../../../core/libs/prx/libSceVoiceChat/Export.cpp) (libSceVoiceChat) - assumed to take a request id and two pointers like the other `sceVoiceChatRequest*` calls; offline, every argument is ignored and `SIGNED_OUT` is returned, as for those
|
||||
Reference in new issue
Block a user