Audio services: Difference between revisions
No edit summary |
|||
(23 intermediate revisions by 3 users not shown) | |||
Line 145: | Line 145: | ||
|- | |- | ||
| 4 || [3.0.0+] ListAudioInsAutoFiltered | | 4 || [3.0.0+] ListAudioInsAutoFiltered | ||
|- | |||
| 5 || [5.0.0+] | |||
|} | |} | ||
Line 226: | Line 228: | ||
|- | |- | ||
| 10 || [6.0.0+] FlushFinalOutputRecorderBuffers | | 10 || [6.0.0+] FlushFinalOutputRecorderBuffers | ||
|} | |||
= auddev = | |||
This is "nn::audio::detail::IAudioSnoopManager". | |||
This was added with [6.0.0+]. | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 0 || | |||
|- | |||
| 1 || | |||
|- | |||
| 6 || | |||
|} | |} | ||
Line 237: | Line 255: | ||
| 0 || OpenAudioRenderer | | 0 || OpenAudioRenderer | ||
|- | |- | ||
| 1 || | | 1 || GetWorkBufferSize | ||
|- | |- | ||
| 2 || [[#GetAudioDeviceService]] | | 2 || [[#GetAudioDeviceService]] | ||
|- | |- | ||
| 3 || [3.0.0+] | | 3 || [3.0.0+] OpenAudioRendererForManualExecution | ||
|- | |- | ||
| 4 || [4.0.0+] GetAudioDeviceServiceWithRevisionInfo | | 4 || [4.0.0+] GetAudioDeviceServiceWithRevisionInfo | ||
Line 370: | Line 388: | ||
| 5 || [4.0.0+] SetAudioOutsProcessRecordVolume | | 5 || [4.0.0+] SetAudioOutsProcessRecordVolume | ||
|} | |} | ||
[4.0.0+] RequestSuspendAudioOuts/RequestResumeAudioOuts no longer returns an output handle. | |||
= audin:a = | = audin:a = | ||
Line 386: | Line 406: | ||
| 3 || SetAudioInsProcessMasterVolume | | 3 || SetAudioInsProcessMasterVolume | ||
|} | |} | ||
[4.0.0+] RequestSuspendAudioIns/RequestResumeAudioIns no longer returns an output handle. | |||
= audrec:a = | = audrec:a = | ||
Line 398: | Line 420: | ||
| 1 || RequestResumeFinalOutputRecorders | | 1 || RequestResumeFinalOutputRecorders | ||
|} | |} | ||
[4.0.0+] RequestSuspendFinalOutputRecorders/RequestResumeFinalOutputRecorders no longer returns an output handle. | |||
= audren:a = | = audren:a = | ||
Line 422: | Line 446: | ||
| 7 || [4.0.0+] SetAudioRenderersProcessRecordVolume | | 7 || [4.0.0+] SetAudioRenderersProcessRecordVolume | ||
|} | |} | ||
[4.0.0+] RequestSuspendAudioRenderers/RequestResumeAudioRenderers no longer returns an output handle. | |||
= audout:d, audin:d, audrec:d, audren:d = | = audout:d, audin:d, audrec:d, audren:d = | ||
Line 501: | Line 527: | ||
|- | |- | ||
| 26 || [4.0.0+] UpdateHeadphoneSettings | | 26 || [4.0.0+] UpdateHeadphoneSettings | ||
|- | |||
| 27 || [7.0.0+] | |||
|} | |} | ||
Line 589: | Line 617: | ||
| 1 || [[#GetWorkBufferSize]] | | 1 || [[#GetWorkBufferSize]] | ||
|- | |- | ||
| 2 || [3.0.0+] OpenHardwareOpusDecoderForMultiStream | | 2 || [3.0.0+] [[#OpenHardwareOpusDecoderForMultiStream]] | ||
|- | |- | ||
| 3 || [3.0.0+] GetWorkBufferSizeForMultiStream | | 3 || [3.0.0+] [[#GetWorkBufferSizeForMultiStream]] | ||
|} | |} | ||
Line 597: | Line 625: | ||
== Initialize == | == Initialize == | ||
Takes two | Takes two s32s '''SampleRate''' and '''ChannelCount''' packed as an u64, an u32 '''WorkBufferSize''' and a TransferMemory handle for '''WorkBuffer'''. Returns an [[#IHardwareOpusDecoder]] object. The TransferMemory is created by the user-process with permissions=0. | ||
== GetWorkBufferSize== | == GetWorkBufferSize== | ||
Takes two | Takes two s32s '''SampleRate''' and '''ChannelCount''' packed as an u64. Returns the u32 required size for the decoder's work buffer. Official user-processes align the output size to page-alignment. | ||
== OpenHardwareOpusDecoderForMultiStream == | |||
Takes a type-0x19 input buffer, an u32 '''WorkBufferSize''' and a TransferMemory handle for '''WorkBuffer'''. Returns an [[#IHardwareOpusDecoder]] object. The TransferMemory is created by the user-process with permissions=0. | |||
The input buffer is a [[#MultiStreamParameters]] struct. The user-process initializes this struct the same way as [[#GetWorkBufferSizeForMultiStream]], except that an u8-array specified by the user is copied to +0x10 with size '''ChannelCount''', when '''ChannelCount''' above 0. | |||
== GetWorkBufferSizeForMultiStream == | |||
Takes a type-0x19 input buffer. Returns the u32 required size for the decoder's work buffer. Official user-processes align the output size to page-alignment. | |||
The input buffer is a [[#MultiStreamParameters]] struct. | |||
== MultiStreamParameters == | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset | |||
! Size | |||
! Description | |||
|- | |||
| 0x0 | |||
| 0x4 | |||
| Sample rate (Hz) | |||
|- | |||
| 0x4 | |||
| 0x4 | |||
| Number of channels | |||
|- | |||
| 0x8 | |||
| 0x4 | |||
| Number of streams | |||
|- | |||
| 0xC | |||
| 0x4 | |||
| Number of stereo streams | |||
|- | |||
| 0x10 | |||
| 0x100 | |||
| u8 array of channel mappings | |||
|} | |||
== IHardwareOpusDecoder == | == IHardwareOpusDecoder == | ||
Line 613: | Line 679: | ||
| 1 || [[#SetContext]] | | 1 || [[#SetContext]] | ||
|- | |- | ||
| 2 || [4.0.0+] DecodeInterleavedForMultiStreamOld ([3.0.0-3.0.2] DecodeInterleavedForMultiStream) | | 2 || [4.0.0+] [[#DecodeInterleavedForMultiStreamOld]] ([3.0.0-3.0.2] DecodeInterleavedForMultiStream) | ||
|- | |- | ||
| 3 || [3.0.0+] SetContextForMultiStream | | 3 || [3.0.0+] [[#SetContextForMultiStream]] | ||
|- | |- | ||
| 4 || [6.0.0+] DecodeInterleavedWithPerfOld ([4.0.0-5.1.0] DecodeInterleavedWithPerf) | | 4 || [6.0.0+] [[#DecodeInterleavedWithPerfOld]] ([4.0.0-5.1.0] DecodeInterleavedWithPerf) | ||
|- | |- | ||
| 5 || [6.0.0+] DecodeInterleavedForMultiStreamWithPerfOld ([4.0.0-5.1.0] DecodeInterleavedForMultiStreamWithPerf) | | 5 || [6.0.0+] [[#DecodeInterleavedForMultiStreamWithPerfOld]] ([4.0.0-5.1.0] DecodeInterleavedForMultiStreamWithPerf) | ||
|- | |- | ||
| 6 || [6.0.0+] DecodeInterleaved | | 6 || [6.0.0+] [[#DecodeInterleaved]] | ||
|- | |- | ||
| 7 || [6.0.0+] DecodeInterleavedForMultiStream | | 7 || [6.0.0+] [[#DecodeInterleavedForMultiStream]] | ||
|- | |||
| 8 || [7.0.0+] | |||
|- | |||
| 9 || [7.0.0+] | |||
|} | |} | ||
=== DecodeInterleavedOld === | === DecodeInterleavedOld === | ||
Takes a type-5 input buffer ('''OpusDataIn''') and a type-6 output buffer ('''PcmDataOut'''). Decodes the Opus source data to PCM and returns | Takes a type-5 input buffer ('''OpusDataIn''') and a type-6 output buffer ('''PcmDataOut'''). Decodes the Opus source data to PCM and returns output s32 '''DecodedDataSize''' and s32 '''DecodedSampleCount'''. | ||
Calls the same func as [[#DecodeInterleaved]] internally with flag=0 and out_u64_ptr=NULL. | |||
=== SetContext === | === SetContext === | ||
Takes a type-5 input buffer ('''DecoderContextIn'''). Sends the unknown context data to the hardware decoder. The input buffer is unused. | |||
=== DecodeInterleavedForMultiStreamOld === | |||
Takes a type-5 input buffer ('''OpusDataIn''') and a type-6 output buffer ('''PcmDataOut'''). Decodes the Opus source data to PCM and returns output s32 '''DecodedDataSize''' and s32 '''DecodedSampleCount'''. | |||
Calls the same func as [[#DecodeInterleavedForMultiStream]] internally with flag=0 and out_u64_ptr=NULL. | |||
=== SetContextForMultiStream === | |||
Takes a type-5 input buffer ('''DecoderContextIn'''). Sends the unknown context data to the hardware decoder. | Takes a type-5 input buffer ('''DecoderContextIn'''). Sends the unknown context data to the hardware decoder. | ||
=== DecodeInterleavedWithPerfOld === | |||
Takes a type-0x5 input buffer ('''OpusDataIn''') and a type-0x46 output buffer ('''PcmDataOut'''). Decodes the Opus source data to PCM and returns output s32 '''DecodedDataSize''', s32 '''DecodedSampleCount''', and an u64. | |||
The output u64 is ignored by official user-processes. | |||
Calls the same func as [[#DecodeInterleaved]] internally with flag=0. | |||
=== DecodeInterleavedForMultiStreamWithPerfOld === | |||
Takes a type-0x5 input buffer ('''OpusDataIn''') and a type-0x46 output buffer ('''PcmDataOut'''). Decodes the Opus source data to PCM and returns output s32 '''DecodedDataSize''', s32 '''DecodedSampleCount''', and an u64. | |||
The output u64 is ignored by official user-processes. | |||
Calls the same func as [[#DecodeInterleavedForMultiStream]] internally with flag=0. | |||
=== DecodeInterleaved === | |||
Takes an input u8 bool flag, a type-0x5 input buffer ('''OpusDataIn''') and a type-0x46 output buffer ('''PcmDataOut'''). Decodes the Opus source data to PCM and returns output s32 '''DecodedDataSize''', s32 '''DecodedSampleCount''', and an u64. | |||
The bool flag indicates whether or not a reset of the decoder context is being requested. | |||
=== DecodeInterleavedForMultiStream === | |||
Takes an input u8 bool flag, a type-0x5 input buffer ('''OpusDataIn''') and a type-0x46 output buffer ('''PcmDataOut'''). Decodes the Opus source data to PCM and returns output s32 '''DecodedDataSize''', s32 '''DecodedSampleCount''', and an u64. | |||
The bool flag indicates whether or not a reset of the decoder context is being requested. | |||
= auddebug = | = auddebug = |