nn_audio_renderer

Family of src/nx/nn/audio_renderer.hook. The hooks_off setting turns a family off by its name.

The native nn::audio renderer (audio_renderer.c), for tools/hookgen, in the language of nn/hooks.hook. The audio renderer, with no audren:u session (audio_renderer.c): OpenAudioRenderer and every function that takes the handle it fills. RequestUpdateAudioRenderer runs the SDK's own managers on the game's AudioRendererConfig, whose buffers sit at an offset that differs between SDKs, as RequestUpdateAudioRenderer's code reads them. Read in an SDK of every major version from 0 to 20 but 2: 0.12.14; 1.3.1; 3.5.0; 4.4.0, 4.4.1, 4.5.0 and 5.4.180; 6.5.0, 7.3.2, 8.2.0 and 8.2.1; and 9.3.0 to 20.5.17, which share one. From SDK 6 the config also holds, at 0x40, where the rendered frames' count goes. The revision is the AudioRendererParameter's last word, after one more word in SDK 6 to 8. Before SDK 2 the parameter is the session's own struct, the handle is one word (so an argument after it comes one register earlier) and the voices' two sections each have a method; SDK 0 has no splitters. SDK 2 was not read: it has no hook, and keeps its own code: none of the functions that take the handle either, which its own OpenAudioRenderer fills with none of ours (a handler finds no renderer there, and Start gives InvalidHandle). A 32-bit game: the functions the 32-bit SDKs read have. In 0.12.16, 13 of them: the parameter is the 64-bit SDK 0's, the handle one word of 4 bytes, and the config's buffers are 4-byte fields (AudioRendererConfig32). In 4.4.0, those and ExecuteAudioRendererRendering, as SDK 3 to 5's: the parameter is theirs, the handle two words of 4 bytes (r0 and r1), the config's managers 4-byte pointers in their order and its buffers 4-byte fields at 0x28, as its RequestUpdateAudioRenderer reads them. In 10.6.0, the same functions but QueryAudioRendererSystemEvent, as SDK 9 on's: the parameter is theirs, the handle two words, the managers 4-byte pointers in their order, at 0x20 the address the 16 bytes of render info after the answer's sections go to, and the buffers 4-byte fields at 0x2c. The ones that take a size_t have another symbol there. A function that takes only the handle is marked a32. Each holds for the 64-bit SDKs' layout of the one read (a32 @version): below 1.0.0, from 4.0.0 below 6.0.0 and from 9.0.0 below 11.0.0, where the 64-bit config keeps one layout (the revisions REV4 and REV8 begin at 4.0.0 and 9.0.0 on switchbrew's audren:u). SDK 1 to 3 and 6 to 8, unread for a 32-bit game, have no hook here, nor any past 10.6.0

Page 1 2 3 4 5 6

struct nn::audio::AudioRendererParameter SDK < 2.0.0 source
FieldTypeOffset
revisionu320x30

Size 0x34.

struct nn::audio::AudioRendererParameter SDK >= 3.0.0, < 6.0.0 source
FieldTypeOffset
revisionu320x34

Size 0x38.

struct nn::audio::AudioRendererParameter SDK >= 6.0.0, < 9.0.0 source
FieldTypeOffset
revisionu320x38

Size 0x3c.

struct nn::audio::AudioRendererParameter SDK >= 9.0.0 source
FieldTypeOffset
revisionu320x34

Size 0x38.

struct nn::audio::AudioRendererConfig SDK < 1.0.0 source
FieldTypeOffset
inaddr0x48
in_sizeu640x50
outaddr0x58
out_sizeu640x60

Size 0x68.

struct nn::audio::AudioRendererConfig SDK >= 1.0.0, < 2.0.0 source
FieldTypeOffset
inaddr0x50
in_sizeu640x58
outaddr0x60
out_sizeu640x68

Size 0x70.

struct nn::audio::AudioRendererConfig SDK >= 3.0.0, < 4.0.0 source
FieldTypeOffset
inaddr0x50
in_sizeu640x58
outaddr0x60
out_sizeu640x68

Size 0x70.

struct nn::audio::AudioRendererConfig SDK >= 4.0.0, < 6.0.0 source
FieldTypeOffset
inaddr0x40
in_sizeu640x48
outaddr0x50
out_sizeu640x58

Size 0x60.

struct nn::audio::AudioRendererConfig SDK >= 6.0.0, < 9.0.0 source
FieldTypeOffset
inaddr0x50
in_sizeu640x58
outaddr0x60
out_sizeu640x68

Size 0x70.

struct nn::audio::AudioRendererConfig SDK >= 9.0.0 source
FieldTypeOffset
inaddr0x48
in_sizeu640x50
outaddr0x58
out_sizeu640x60

Size 0x68.

struct nn::audio::AudioRendererConfig32 SDK < 1.0.0 source
FieldTypeOffset
inu320x2c
in_sizeu320x30
outu320x34
out_sizeu320x38

Size 0x3c.

struct nn::audio::AudioRendererConfig32 SDK >= 4.0.0, < 6.0.0 source
FieldTypeOffset
inu320x28
in_sizeu320x2c
outu320x30
out_sizeu320x34

Size 0x38.

struct nn::audio::AudioRendererConfig32 SDK >= 9.0.0, < 11.0.0 source
FieldTypeOffset
inu320x2c
in_sizeu320x30
outu320x34
out_sizeu320x38

Size 0x3c.

nn::audio::GetAudioRendererWorkBufferSize(nn::audio::AudioRendererParameter const&) SDK < 2.0.0 source

_ZN2nn5audio30GetAudioRendererWorkBufferSizeERKNS0_22AudioRendererParameterE
As C: usize (addr param)
Handler: nnaudio_get_renderer_work_buffer_size (audio_renderer.c)
Uses: nn::audio::AudioRendererParameter

nn::audio::OpenAudioRenderer(nn::audio::AudioRendererHandle*, nn::audio::AudioRendererParameter const&, void*, unsigned long) SDK < 2.0.0 source

_ZN2nn5audio17OpenAudioRendererEPNS0_19AudioRendererHandleERKNS0_22AudioRendererParameterEPvm
As C: u32 (addr handle, addr param, addr work, usize size)
Handler: nnaudio_open_renderer_word (audio_renderer.c)
Uses: nn::audio::AudioRendererParameter

Page 1 2 3 4 5 6


Made from ScarletNX's Sail at 166ad3910f80. The hooks' and the SVCs' declarations and their handlers are ScarletNX's (GPL-3.0-or-later); the SVCs' declarations are Eden's, as hos.svc says.