Audio services: Difference between revisions
m →audctl |
|||
| (16 intermediate revisions by 2 users not shown) | |||
| Line 341: | Line 341: | ||
|- | |- | ||
| 6 || [6.0.0-16.1.0] GetDspUsage | | 6 || [6.0.0-16.1.0] GetDspUsage | ||
|} | |||
= (S2) auddev:s = | |||
This is "nn::audio::sysdev::ISessionManager". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 0 || | |||
|- | |||
| 1 || | |||
|} | |||
== Cmd0 == | |||
No input, returns an [[#IAdspShellSession|IAdspShellSession]]. | |||
== Cmd1 == | |||
No input, returns an [[#IClientManager|IClientManager]]. | |||
== IAdspShellSession == | |||
This is "nn::audio::adspshell::IAdspShellSession". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 0 || SendKernelDebugCommand | |||
|- | |||
| 1 || SendFatalErrorCommand | |||
|- | |||
| 2 || SendReadMemoryCommand | |||
|- | |||
| 3 || SendStressTestCommand | |||
|} | |||
== IClientManager == | |||
This is "nn::audio::dpm::IClientManager". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 0 || | |||
|} | |||
=== Cmd0 === | |||
No input, returns an [[#IClientSession|IClientSession]]. | |||
=== IClientSession === | |||
This is "nn::audio::dpm::IClientSession". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 0 || CreateProcess | |||
|- | |||
| 1 || WaitProcess | |||
|- | |||
| 2 || TerminateProcess | |||
|} | |} | ||
| Line 371: | Line 432: | ||
! Cmd || Name | ! Cmd || Name | ||
|- | |- | ||
| 0 || [[#GetSampleRate]] | | 0 || [[#GetSampleRate|GetSampleRate]] | ||
|- | |- | ||
| 1 || [[#GetSampleCount]] | | 1 || [[#GetSampleCount|GetSampleCount]] | ||
|- | |- | ||
| 2 || [[#GetMixBufferCount]] | | 2 || [[#GetMixBufferCount|GetMixBufferCount]] | ||
|- | |- | ||
| 3 || [[#GetState]] | | 3 || [[#GetState|GetState]] | ||
|- | |- | ||
| 4 || RequestUpdate | | 4 || [[#RequestUpdate|RequestUpdate]] | ||
|- | |- | ||
| 5 || Start | | 5 || [[#Start|Start]] | ||
|- | |- | ||
| 6 || Stop | | 6 || [[#Stop|Stop]] | ||
|- | |- | ||
| 7 || QuerySystemEvent | | 7 || [[#QuerySystemEvent|QuerySystemEvent]] | ||
|- | |- | ||
| 8 || [[#SetRenderingTimeLimit]] | | 8 || [[#SetRenderingTimeLimit|SetRenderingTimeLimit]] | ||
|- | |- | ||
| 9 || [[#GetRenderingTimeLimit]] | | 9 || [[#GetRenderingTimeLimit|GetRenderingTimeLimit]] | ||
|- | |- | ||
| 10 || [3.0.0+] RequestUpdateAuto | | 10 || [3.0.0+] [[#RequestUpdateAuto|RequestUpdateAuto]] | ||
|- | |- | ||
| 11 || [3.0.0+] ExecuteAudioRendererRendering | | 11 || [3.0.0+] ExecuteAudioRendererRendering | ||
| Line 411: | Line 472: | ||
=== GetState === | === GetState === | ||
No input. Returns an u32 '''State''' (0=Started, 1=Stopped). | No input. Returns an u32 '''State''' (0=Started, 1=Stopped). | ||
The output is determined using the flag updated by [[#Start|Start]]/[[#Stop|Stop]]. | |||
=== RequestUpdate === | |||
Takes two type-0x6 output buffers and a type-0x5 input buffer. | |||
=== Start === | |||
No input/output. | |||
Besides logging, this calls a func which essentially clears a state field and sets a flag, and also calls a func. | |||
The thread which handles generating/sending ADSP commands will only do so when the above flag indicates the state is Started. | |||
=== Stop === | |||
No input/output. | |||
After logging, this calls a func which essentially returns when the flag from [[#Start|Start]] is not set. Various funcs are called, then the flag is cleared. If needed, this waits on an event, then this returns. | |||
=== QuerySystemEvent === | |||
No input, returns an output Event handle. | |||
=== SetRenderingTimeLimit === | === SetRenderingTimeLimit === | ||
| Line 417: | Line 498: | ||
=== GetRenderingTimeLimit === | === GetRenderingTimeLimit === | ||
No input. Returns an u32 '''RenderingTimeLimit'''. | No input. Returns an u32 '''RenderingTimeLimit'''. | ||
=== RequestUpdateAuto === | |||
Takes two type-0x22 output buffers and a type-0x21 input buffer. | |||
This is identical to [[#RequestUpdate|RequestUpdate]] besides the buffer-types. | |||
== IAudioDevice == | == IAudioDevice == | ||
| Line 453: | Line 539: | ||
| 14 || [13.0.0+] ListAudioOutputDeviceName | | 14 || [13.0.0+] ListAudioOutputDeviceName | ||
|- | |- | ||
| 15 || [17.0.0+] AcquireAudioInputDeviceNotification | | 15 || [17.0.0+] [[#AcquireAudioInputDeviceNotification|AcquireAudioInputDeviceNotification]] | ||
|- | |- | ||
| 16 || [17.0.0+] ReleaseAudioInputDeviceNotification | | 16 || [17.0.0+] [[#ReleaseAudioInputDeviceNotification|ReleaseAudioInputDeviceNotification]] | ||
|- | |- | ||
| 17 || [17.0.0+] AcquireAudioOutputDeviceNotification | | 17 || [17.0.0+] [[#AcquireAudioOutputDeviceNotification|AcquireAudioOutputDeviceNotification]] | ||
|- | |- | ||
| 18 || [17.0.0+] ReleaseAudioOutputDeviceNotification | | 18 || [17.0.0+] [[#ReleaseAudioOutputDeviceNotification|ReleaseAudioOutputDeviceNotification]] | ||
|- | |- | ||
| 19 || [18.0.0+] SetAudioDeviceOutputVolumeAutoTuneEnabled | | 19 || [18.0.0+] SetAudioDeviceOutputVolumeAutoTuneEnabled | ||
|- | |- | ||
| 20 || [18.0.0+] IsAudioDeviceOutputVolumeAutoTuneEnabled | | 20 || [18.0.0+] IsAudioDeviceOutputVolumeAutoTuneEnabled | ||
|- | |||
| 21 || [21.0.0+] IsActiveOutputDeviceEstimatedLowLatency | |||
|} | |} | ||
| Line 489: | Line 577: | ||
=== GetActiveAudioOutputDeviceName === | === GetActiveAudioOutputDeviceName === | ||
Takes a type-0x6 output buffer, returns no output. | Takes a type-0x6 output buffer, returns no output. | ||
=== AcquireAudioInputDeviceNotification === | |||
Takes an input u64, returns an output handle. | |||
On NX this just returns an error. | |||
=== ReleaseAudioInputDeviceNotification === | |||
Takes an input u64, no output. | |||
On NX this just returns an error. | |||
=== AcquireAudioOutputDeviceNotification === | |||
Takes an input u64, returns an output handle. | |||
On NX this just returns an error. | |||
=== ReleaseAudioOutputDeviceNotification === | |||
Takes an input u64, no output. | |||
On NX this just returns an error. | |||
= audout:a = | = audout:a = | ||
| Line 688: | Line 796: | ||
|- | |- | ||
| 42 || [15.0.0+] SetNativeVolumeForDebug | | 42 || [15.0.0+] SetNativeVolumeForDebug | ||
|- | |||
| 43 || [21.0.0+] | |||
|- | |- | ||
| 5000 || [19.0.0+] | | 5000 || [19.0.0+] | ||
| Line 734: | Line 844: | ||
[13.0.0+] No input, returns a total of 9-bytes of output. | [13.0.0+] No input, returns a total of 9-bytes of output. | ||
[20.0.0+] Now takes a 0x400-bytes type-0x16 output buffer and no longer returns any output. | |||
== UpdateHeadphoneSettings == | == UpdateHeadphoneSettings == | ||
| Line 748: | Line 860: | ||
[20.0.0+] Now takes a total of 0x40-bytes of input and the type-0x16 output buffer is now 0x2000-bytes instead of 0x1000-bytes. | [20.0.0+] Now takes a total of 0x40-bytes of input and the type-0x16 output buffer is now 0x2000-bytes instead of 0x1000-bytes. | ||
= codecctl = | = codecctl = | ||
| Line 853: | Line 962: | ||
|- | |- | ||
| 9 || [16.0.0+] GetWorkBufferSizeForMultiStreamExEx | | 9 || [16.0.0+] GetWorkBufferSizeForMultiStreamExEx | ||
|- | |||
| 100 || [S2] | |||
|} | |} | ||
| Line 890: | Line 1,001: | ||
The input buffer is a [[#OpusMultiStreamParametersEx]] struct. | The input buffer is a [[#OpusMultiStreamParametersEx]] struct. | ||
== Cmd100 == | |||
No input, returns an [[#IClientSession_2|IClientSession]]. | |||
== IHardwareOpusDecoder == | == IHardwareOpusDecoder == | ||
| Line 958: | Line 1,072: | ||
The bool flag indicates whether or not a reset of the decoder context is being requested. | The bool flag indicates whether or not a reset of the decoder context is being requested. | ||
== IClientSession == | |||
This is "nn::codec::hwacod::IClientSession". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 0 || | |||
|- | |||
| 1 || | |||
|- | |||
| 10 || | |||
|} | |||
=== Cmd10 === | |||
Takes {...}, returns an [[#IHardwareAudioCodecManagerSession|IHardwareAudioCodecManagerSession]]. | |||
=== IHardwareAudioCodecManagerSession === | |||
This is "nn::codec::hwacod::IHardwareAudioCodecManagerSession". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 0 || | |||
|- | |||
| 1 || | |||
|- | |||
| 10 || | |||
|} | |||
= auddebug = | = auddebug = | ||
| Line 1,021: | Line 1,166: | ||
|- | |- | ||
| 1 || RequestResumeAudioForDebug | | 1 || RequestResumeAudioForDebug | ||
|} | |||
= (S2) aud:u = | |||
This is "nn::audio::IUserClientSession". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 0 || | |||
|- | |||
| 1 || | |||
|- | |||
| 2 || | |||
|- | |||
| 3 || | |||
|} | |||
== Cmd0 == | |||
No input, returns an output [[#audin:u|IAudioInManager]]. | |||
== Cmd1 == | |||
No input, returns an output [[#audout:u|IAudioOutManager]]. | |||
== Cmd2 == | |||
No input, returns an output [[#audren:u|IAudioRendererManager]]. | |||
== Cmd3 == | |||
No input, returns an output [[#ISpatialDownmixOutputModeManager|ISpatialDownmixOutputModeManager]]. | |||
=== ISpatialDownmixOutputModeManager === | |||
This is "nn::audio::detail::ISpatialDownmixOutputModeManager". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 0 || | |||
|} | |||
==== Cmd0 ==== | |||
Takes a PID, an u32, u64, no output. | |||
= (S2) auddmg:u = | |||
This is "nn::audio::devmgr::IUserSessionManager". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 0 || | |||
|} | |||
== Cmd0 == | |||
Takes a PID, an u32, an u64 pid_reserved, returns an output [[#IUserSession|IUserSession]]. | |||
=== IUserSession === | |||
This is "nn::audio::devmgr::IUserSession". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 0 || | |||
|- | |||
| 100 || | |||
|- | |||
| 200 || | |||
|- | |||
| 300 || | |||
|- | |||
| 401 || | |||
|- | |||
| 500 || | |||
|- | |||
| 600 || | |||
|- | |||
| 700 || | |||
|- | |||
| 800 || | |||
|- | |||
| 900 || | |||
|- | |||
| 1000 || | |||
|- | |||
| 1500 || | |||
|- | |||
| 1550 || | |||
|- | |||
| 1600 || | |||
|- | |||
| 2000 || | |||
|- | |||
| 2100 || | |||
|- | |||
| 2200 || | |||
|- | |||
| 2301 || | |||
|} | |||
= (S2) auddmg:s = | |||
This is "nn::audio::devmgr::ISystemSessionManager". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 0 || | |||
|} | |||
== Cmd0 == | |||
Takes a PID, an u32, an u64 pid_reserved, returns an output [[#ISystemSession|ISystemSession]]. | |||
== ISystemSession == | |||
This is "nn::audio::devmgr::ISystemSession". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 0 || ListPhysicalDeviceNames | |||
|- | |||
| 1 || EnableSoundDriver | |||
|- | |||
| 2 || DisableSoundDriver | |||
|- | |||
| 3 || IsSoundDriverEnabled | |||
|- | |||
| 4 || ListPhysicalDeviceIds | |||
|- | |||
| 5 || GetPhysicalDeviceId | |||
|- | |||
| 6 || GetPhysicalDeviceProfile | |||
|- | |||
| 7 || MapRawInputDevice | |||
|- | |||
| 8 || MapAndBindPhysicalDevice | |||
|- | |||
| 9 || UnmapPhysicalDevice | |||
|- | |||
| 10 || GetBoundPhysicalDeviceProfile | |||
|- | |||
| 11 || GetRawInputPhysicalDeviceProfile | |||
|- | |||
| 12 || SetVirtualDeviceGain | |||
|- | |||
| 13 || GetVirtualDeviceGain | |||
|- | |||
| 14 || SetAppletVirtualDeviceGain | |||
|- | |||
| 15 || GetAppletVirtualDeviceGain | |||
|- | |||
| 16 || SetAppletCaptureDeviceGain | |||
|- | |||
| 17 || GetAppletCaptureDeviceGain | |||
|- | |||
| 18 || SetAppletBiquadFilterMode | |||
|- | |||
| 19 || SetAppletBiquadFilterParameters | |||
|- | |||
| 20 || GetAppletBiquadFilterParameters | |||
|- | |||
| 21 || SuspendAppletVirtualDevice | |||
|- | |||
| 22 || ResumeAppletVirtualDevice | |||
|- | |||
| 23 || SetPhysicalDeviceGain | |||
|- | |||
| 24 || GetPhysicalDeviceGain | |||
|- | |||
| 25 || SetPhysicalDeviceFeature | |||
|- | |||
| 26 || GetPhysicalDeviceFeature | |||
|- | |||
| 27 || SetGlobalPhysicalDeviceFeature | |||
|- | |||
| 28 || GetGlobalPhysicalDeviceFeature | |||
|- | |||
| 29 || AcquireGlobalPhysicalDeviceEvent | |||
|- | |||
| 30 || ReleaseGlobalPhysicalDeviceEvent | |||
|- | |||
| 31 || BindPhysicalDevice | |||
|- | |||
| 32 || SetMonauralDownmixMode | |||
|- | |||
| 33 || SetControl | |||
|- | |||
| 34 || GetMonauralDownmixMode | |||
|- | |||
| 35 || GetControl | |||
|- | |||
| 36 || ShellCommand | |||
|- | |||
| 37 || SetAppletVirtualDeviceLoudnessNormalization | |||
|- | |||
| 38 || GetAppletVirtualDeviceLoudnessNormalization | |||
|- | |||
| 39 || SetLoudnessNormalizationParameters | |||
|- | |||
| 40 || GetLoudnessNormalizationParameters | |||
|- | |||
| 41 || GetLoudnessNormalizationStatistics | |||
|- | |||
| 42 || SetAppletVirtualDeviceLoudnessNormalizationBiasParameters | |||
|- | |||
| 43 || GetAppletVirtualDeviceLoudnessNormalizationBiasParameters | |||
|- | |||
| 44 || SetAppletVirtualDevicePostGain | |||
|- | |||
| 45 || GetAppletVirtualDevicePostGain | |||
|- | |||
| 46 || UnbindVirtualDevice | |||
|} | |||
= (S2) audsmx:u = | |||
This is "nn::audio::sysmix::IUserSessionManager". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 0 || | |||
|} | |||
== Cmd0 == | |||
Takes a PID, a Process handle, an u32, an u64 pid_reserved, returns an output [[#IUserSession_2|IUserSession]]. | |||
Official sw uses hard-coded value 0x1 for the u32. | |||
An error is returned when there's already an [[#IUserSession|IUserSession]] open with the same PID. | |||
=== IUserSession === | |||
This is "nn::audio::sysmix::IUserSession". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 1 || | |||
|- | |||
| 2 || | |||
|- | |||
| 3 || | |||
|} | |||
==== Cmd1 ==== | |||
Takes a type-0x5 input buffer, two input u32s, 3 u64s, returns an output [[#IExternalStreamSession|IExternalStreamSession]]. | |||
==== Cmd2 ==== | |||
Takes a type-0x5 input buffer, no output. | |||
==== Cmd3 ==== | |||
Takes a type-0x5 input buffer, no output. | |||
==== IExternalStreamSession ==== | |||
This is "nn::audio::sysmix::IExternalStreamSession". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 0 || | |||
|- | |||
| 1 || | |||
|- | |||
| 2 || | |||
|- | |||
| 3 || | |||
|- | |||
| 4 || | |||
|- | |||
| 5 || | |||
|- | |||
| 6 || | |||
|- | |||
| 7 || | |||
|- | |||
| 8 || | |||
|- | |||
| 9 || | |||
|- | |||
| 10 || | |||
|- | |||
| 11 || | |||
|- | |||
| 12 || | |||
|} | |} | ||
| Line 1,447: | Line 1,879: | ||
| 0x100 | | 0x100 | ||
| u8 array of channel mappings | | u8 array of channel mappings | ||
|} | |||
= BehaviorInfo Revision = | |||
This is the revision field used with audren. This controls which format is used for the data used with [[#IAudioRenderer|IAudioRenderer]] RequestUpdate*, etc. | |||
Bitmask 0xFFFFFF == 0x564552 (REV) is used for determining whether the user-process is using NX-platform. On Ounce, the revision value is identical except that bitmask 0xFFFFFF is 0x764552 (REv). | |||
{| class="wikitable" border="1" | |||
|- | |||
! System Version | |||
! Value | |||
! Required by | |||
|- | |||
| [1.0.0+] | |||
| 0x31564552 (REV1) | |||
| IsAudioRenererProcessingTimeLimit70PercentSupported | |||
|- | |||
| [2.0.0+] | |||
| 0x32564552 (REV2) | |||
| IsAdpcmLoopContextBugFixed, IsSplitterSupported | |||
|- | |||
| [3.0.0+] | |||
| 0x33564552 (REV3) | |||
| IsLongSizePreDelaySupported | |||
|- | |||
| [4.0.0+] | |||
| 0x34564552 (REV4) | |||
| IsAudioRenererProcessingTimeLimit75PercentSupported | |||
|- | |||
| [6.0.0+] | |||
| 0x35564552 (REV5) | |||
| | |||
* IsAudioRenererProcessingTimeLimit80PercentSupported | |||
* IsCommandProcessingTimeEstimatorVersion2Supported | |||
* IsVariadicCommandBufferSizeSupported | |||
* IsFlushVoiceWaveBuffersSupported | |||
* IsSplitterBugFixed | |||
* IsElapsedFrameCountSupported | |||
* IsPerformanceMetricsDataFormatVersion2Supported | |||
* GetPerformanceMetricsDataFormat | |||
* IsVoicePitchAndSrcSkippedSupported | |||
* IsVoicePlayedSampleCountResetAtLoopPointSupported | |||
|- | |||
| [6.1.0+] | |||
| 0x36564552 (REV6) | |||
| IsBiquadFilterEffectStateClaerBugFixed | |||
|- | |||
| [7.0.0+] | |||
| 0x37564552 (REV7) | |||
| | |||
* IsVolumeMixParameterPrecisionQ23Supported | |||
* UseBiquadFilterFloatProcessing | |||
* IsMixInParameterDirtyOnlyUpdateSupported | |||
|- | |||
| [9.0.0+] | |||
| 0x38564552 (REV8) | |||
| | |||
* IsWaveBufferVer2Supported | |||
* IsCommandProcessingTimeEstimatorVersion3Supported | |||
|- | |||
| [12.0.0+] | |||
| 0x39564552 (REV9) | |||
| IsEffectInfoVersion2Supported | |||
|- | |||
| [13.0.0+] | |||
| 0x3A564552 | |||
| | |||
* UseMultiTapBiquadFilterProcessing | |||
* IsCommandProcessingTimeEstimatorVersion4Supported | |||
* IsDeviceApiVersion2Supported | |||
|- | |||
| [14.0.0+] | |||
| 0x3B564552 | |||
| | |||
* IsDelayChannelMappingChanged | |||
* IsReverbChannelMappingChanged | |||
* IsI3dl2ReverbChannelMappingChanged | |||
* IsCommandProcessingTimeEstimatorVersion5Supported | |||
|- | |||
| [17.0.0+] | |||
| 0x3C564552 | |||
| IsBiquadFilterParameterForSplitterEnabled | |||
|- | |||
| [18.0.0+] | |||
| 0x3D564552 | |||
| IsSplitterPrevVolumeResetSupported | |||
|- | |||
| | |||
| 0x3E564552 | |||
| IsSplitterDepopBugFixEnabled | |||
|- | |||
| [19.0.0+] | |||
| 0x3F564552 | |||
| IsBiquadFilterParameterFloatSupported | |||
|} | |} | ||