Audio services: Difference between revisions

ByLaws (talk | contribs)
m Correct reference to GetAudioRendererState
(32 intermediate revisions by 3 users not shown)
Line 47: Line 47:


== OpenAudioOutAuto ==
== OpenAudioOutAuto ==
Same as [[#OpenAudioOut]], but takes a type-0x21 input buffer instead.
Same as [[#OpenAudioOut]], but takes a type-0x21 input buffer and a type-0x22 output buffer instead.


== IAudioOut ==
== IAudioOut ==
Line 145: Line 145:
|-
|-
| 4 || [3.0.0+] ListAudioInsAutoFiltered
| 4 || [3.0.0+] ListAudioInsAutoFiltered
|-
| 5 || [5.0.0+] OpenAudioInProtocolSpecified
|}
|}


Line 207: Line 209:
| 0 || GetFinalOutputRecorderState
| 0 || GetFinalOutputRecorderState
|-
|-
| 1 || StartFinalOutputRecorder
| 1 || Start
|-
|-
| 2 || StopFinalOutputRecorder
| 2 || Stop
|-
|-
| 3 || AppendFinalOutputRecorderBuffer
| 3 || AppendFinalOutputRecorderBuffer
Line 215: Line 217:
| 4 || RegisterBufferEvent
| 4 || RegisterBufferEvent
|-
|-
| 5 || GetReleasedFinalOutputRecorderBuffer
| 5 || GetReleasedFinalOutputRecorderBuffers
|-
|-
| 6 || ContainsFinalOutputRecorderBuffer
| 6 || ContainsFinalOutputRecorderBuffer
Line 223: Line 225:
| 8 || [3.0.0+] AppendFinalOutputRecorderBufferAuto
| 8 || [3.0.0+] AppendFinalOutputRecorderBufferAuto
|-
|-
| 9 || [3.0.0+] GetReleasedFinalOutputRecorderBufferAuto
| 9 || [3.0.0+] GetReleasedFinalOutputRecorderBuffersAuto
|-
|-
| 10 || [6.0.0+] FlushFinalOutputRecorderBuffers
| 10 || [6.0.0+] FlushFinalOutputRecorderBuffers
|-
| 11 || [9.0.0+] AttachWorkBuffer
|}
= auddev =
This is "nn::audio::detail::IAudioSnoopManager".
This was added with [6.0.0+].
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 || EnableDspUsageMeasurement
|-
| 1 || DisableDspUsageMeasurement
|-
| 6 || GetDspUsage
|}
|}


Line 237: Line 257:
| 0 || OpenAudioRenderer
| 0 || OpenAudioRenderer
|-
|-
| 1 || GetAudioRendererWorkBufferSize
| 1 || GetWorkBufferSize
|-
|-
| 2 || [[#GetAudioDeviceService]]
| 2 || [[#GetAudioDeviceService]]
|-
|-
| 3 || [3.0.0+] OpenAudioRendererAuto
| 3 || [3.0.0+] OpenAudioRendererForManualExecution
|-
|-
| 4 || [4.0.0+] GetAudioDeviceServiceWithRevisionInfo
| 4 || [4.0.0+] GetAudioDeviceServiceWithRevisionInfo
Line 262: Line 282:
| 2 || [[#GetMixBufferCount]]
| 2 || [[#GetMixBufferCount]]
|-
|-
| 3 || [[#GetState]]
| 3 || [[#GetAudioRendererState]]
|-
|-
| 4 || RequestUpdate
| 4 || RequestUpdate
Line 306: Line 326:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || ListAudioDeviceName
| 0 || [[#ListAudioDeviceName]]
|-
|-
| 1 || [[#SetAudioDeviceOutputVolume]]
| 1 || [[#SetAudioDeviceOutputVolume]]
Line 318: Line 338:
| 5 || GetActiveChannelCount
| 5 || GetActiveChannelCount
|-
|-
| 6 || [3.0.0+] ListAudioDeviceNameAuto
| 6 || [3.0.0+] [[#ListAudioDeviceNameAuto]]
|-
|-
| 7 || [3.0.0+] [[#SetAudioDeviceOutputVolumeAuto]]
| 7 || [3.0.0+] [[#SetAudioDeviceOutputVolumeAuto]]
Line 332: Line 352:
| 13 || [5.0.0+] GetAudioSystemMasterVolumeSetting
| 13 || [5.0.0+] GetAudioSystemMasterVolumeSetting
|}
|}
=== ListAudioDeviceName ===
Takes a type-0x6 output buffer containing an array of '''DeviceName''', returns an output s32 for total number of output entries.


=== SetAudioDeviceOutputVolume ===
=== SetAudioDeviceOutputVolume ===
Line 338: Line 361:
=== GetAudioDeviceOutputVolume ===
=== GetAudioDeviceOutputVolume ===
Takes a type-0x5 input buffer containing the '''DeviceName'''. Returns an output float.
Takes a type-0x5 input buffer containing the '''DeviceName'''. Returns an output float.
=== ListAudioDeviceNameAuto ===
Takes a type-0x22 output buffer containing an array of '''DeviceName''', returns an output s32 for total number of output entries.


=== SetAudioDeviceOutputVolumeAuto ===
=== SetAudioDeviceOutputVolumeAuto ===
Line 364: Line 390:
| 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 380: Line 408:
| 3 || SetAudioInsProcessMasterVolume
| 3 || SetAudioInsProcessMasterVolume
|}
|}
[4.0.0+] RequestSuspendAudioIns/RequestResumeAudioIns no longer returns an output handle.


= audrec:a =
= audrec:a =
Line 392: Line 422:
| 1 || RequestResumeFinalOutputRecorders
| 1 || RequestResumeFinalOutputRecorders
|}
|}
[4.0.0+] RequestSuspendFinalOutputRecorders/RequestResumeFinalOutputRecorders no longer returns an output handle.


= audren:a =
= audren:a =
Line 416: Line 448:
| 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 495: Line 529:
|-
|-
| 26 || [4.0.0+] UpdateHeadphoneSettings
| 26 || [4.0.0+] UpdateHeadphoneSettings
|-
| 27 || [7.0.0+] SetVolumeMappingTableForDev
|}
|}


Line 583: Line 619:
| 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 591: Line 627:


== Initialize ==
== Initialize ==
Takes two u32s '''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.
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 u32s '''SampleRate''' and '''ChannelCount''' packed as an u64. Returns the required size for the decoder's work buffer.
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 603: Line 677:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || [4.0.0+] [[#DecodeInterleavedOld]] ([1.0.0-3.0.2] [[#DecodeInterleavedOld|#DecodeInterleaved]])
| 0 || [4.0.0+] [[#DecodeInterleavedOld]] ([1.0.0-3.0.2] DecodeInterleaved)
|-
|-
| 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]]
|-
| 4 || [6.0.0+] [[#DecodeInterleavedWithPerfOld]] ([4.0.0-5.1.0] DecodeInterleavedWithPerf)
|-
|-
| 3 || [3.0.0+] SetContextForMultiStream
| 5 || [6.0.0+] [[#DecodeInterleavedForMultiStreamWithPerfOld]] ([4.0.0-5.1.0] DecodeInterleavedForMultiStreamWithPerf)
|-
|-
| 4 || [6.0.0+] DecodeInterleavedWithPerfOld ([4.0.0-5.1.0] DecodeInterleavedWithPerf)
| 6 || [6.0.0+] DecodeInterleavedWithPerfAndResetOld ([6.0.0-6.2.0] DecodeInterleaved)
|-
|-
| 5 || [6.0.0+] DecodeInterleavedForMultiStreamWithPerfOld ([4.0.0-5.1.0] DecodeInterleavedForMultiStreamWithPerf)
| 7 || [6.0.0+] DecodeInterleavedForMultiStreamWithPerfAndResetOld ([6.0.0-6.2.0] DecodeInterleavedForMultiStream)
|-
|-
| 6 || [6.0.0+] DecodeInterleaved
| 8 || [7.0.0+] [[#DecodeInterleaved]]
|-
|-
| 7 || [6.0.0+] DecodeInterleavedForMultiStream
| 9 || [7.0.0+] [[#DecodeInterleavedForMultiStream]]
|}
|}


=== 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 two u32s '''DecodedSampleCount''' and '''DecodedDataSize'''.
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 =