diff --git a/nx/include/switch/services/audren.h b/nx/include/switch/services/audren.h index 5dfe3ba7..521d6463 100644 --- a/nx/include/switch/services/audren.h +++ b/nx/include/switch/services/audren.h @@ -24,10 +24,12 @@ #define AUDREN_MEMPOOL_ALIGNMENT 0x1000 #define AUDREN_BUFFER_ALIGNMENT 0x40 -#define AUDREN_REVISION_1 0x31564552 // REV1 [1.0.0+?] -#define AUDREN_REVISION_2 0x32564552 // REV2 [2.0.0+?] -#define AUDREN_REVISION_3 0x33564552 // REV3 [3.0.0+?] -#define AUDREN_REVISION_4 0x34564552 // REV4 [somewhere after 3.0.0, possibly 4.0.0+?] +#define AUDREN_REVISION_1 0x31564552 // REV1 [1.0.0+] +#define AUDREN_REVISION_2 0x32564552 // REV2 [2.0.0+] +#define AUDREN_REVISION_3 0x33564552 // REV3 [3.0.0+] +#define AUDREN_REVISION_4 0x34564552 // REV4 [4.0.0+] +#define AUDREN_REVISION_5 0x35564552 // REV5 [6.0.0+] +#define AUDREN_REVISION_6 0x36564552 // REV6 [6.1.0+] #define AUDREN_NODEID(_a,_b,_c) ((((u32)(_a) & 0xF) << 28) | (((u32)(_b) & 0xFFF) << 16) | ((u32)(_c) & 0xFFFF)) #define AUDREN_FINAL_MIX_ID 0 diff --git a/nx/source/services/audren.c b/nx/source/services/audren.c index d22d049d..1a2b7e06 100644 --- a/nx/source/services/audren.c +++ b/nx/source/services/audren.c @@ -5,6 +5,7 @@ #include "kernel/ipc.h" #include "kernel/tmem.h" #include "kernel/event.h" +#include "kernel/detect.h" #include "services/sm.h" #include "services/applet.h" #include "services/audren.h" @@ -55,8 +56,14 @@ Result audrenInitialize(const AudioRendererConfig* config) return MAKERESULT(Module_Libnx, LibnxError_BadInput); // Choose revision (i.e. if splitters are used then at least revision 2 must be used) - // (TODO: abstract away differences between revisions according to provided parameters) - g_audrenRevision = AUDREN_REVISION_3; // todo: ?!? + if (kernelAbove400()) + g_audrenRevision = AUDREN_REVISION_4; + else if (kernelAbove300()) + g_audrenRevision = AUDREN_REVISION_3; + else if (kernelAbove200()) + g_audrenRevision = AUDREN_REVISION_2; + else + g_audrenRevision = AUDREN_REVISION_1; // Prepare parameter structure AudioRendererParameter param = {0};