![]() |
vitasdk
Documentation of the vitasdk
|
Exports for Kernel. More...
Enumerations | |
| enum | SceCodecOutputRoute { SCE_CODEC_OUTPUT_ROUTE_NONE = 0x0000 , SCE_CODEC_OUTPUT_ROUTE_HEADPHONE = 0x0400 , SCE_CODEC_OUTPUT_ROUTE_DOCK = 0x0500 , SCE_CODEC_OUTPUT_ROUTE_SPEAKER = 0x1100 } |
| Complete output-route configurations used by SceAVConfig on FW 3.60. More... | |
| enum | SceCodecAudioOutMode { SCE_CODEC_AUDIO_OUT_MODE_COMPRESSED = 0x0100 , SCE_CODEC_AUDIO_OUT_MODE_NORMAL = 0x0200 } |
| External-codec audio-output profiles used by SceAudio. More... | |
| enum | SceCodecAudioInputMode { SCE_CODEC_AUDIO_INPUT_MODE_INACTIVE = -1 , SCE_CODEC_AUDIO_INPUT_MODE_BUILTIN_MIC = 0 , SCE_CODEC_AUDIO_INPUT_MODE_HEADSET_MIC = 1 , SCE_CODEC_AUDIO_INPUT_MODE_UNK_2 = 2 } |
| External-codec audio-input profiles used by SceAudioIn. More... | |
Functions | |
| int | ksceCodecReadRegister (SceUInt32 reg) |
| Read a raw register from the external audio codec. | |
| int | ksceCodecWriteRegister (SceUInt32 reg, SceUInt32 value) |
| Write a raw register in the external audio codec. | |
| int | ksceCodecGetOutputState (SceInt32 *speaker_gain_db, SceInt32 *headphone_gain_db) |
| Get the current external-codec output state. | |
| int | ksceCodecSetOutputRoute (SceUInt32 output_mask) |
| Set the external-codec output route. | |
| int | ksceCodecSetVolume (SceUInt32 volume_level) |
| Set the external-codec playback volume. | |
| int | ksceCodecSetAudioInputMode (SceCodecAudioInputMode mode) |
| Select the external-codec audio-input configuration used by SceAudioIn. | |
| int | ksceCodecSetAudioOutMode (SceCodecAudioOutMode mode) |
| Select the external-codec audio-output mode used by SceAudio. | |
| int | ksceCodecGetMicrophoneDetectStatus (void) |
| Get the headset-microphone detection state. | |
| int | ksceCodecSetMicrophoneDetectPower (SceBool enable) |
| Enable or disable the codec circuitry used for headset-microphone detection. | |
Exports for Kernel.
Include the header file in your project:
Link the library to the executable:
On handheld FW 3.60 systems, this library controls the external WM audio codec. On Vita TV, no codec driver is installed: these functions return 0 and do not write to output pointers.
| enum SceCodecOutputRoute |
Complete output-route configurations used by SceAVConfig on FW 3.60.
Each value specifies a complete output-route configuration, not an individual output flag. The WM driver independently checks mask bits 0x0100, 0x0400, and 0x1000; all other bits are ignored. Other combinations of the three bits are accepted but are not used by FW 3.60 SceAVConfig.
| enum SceCodecAudioOutMode |
External-codec audio-output profiles used by SceAudio.
The FW 3.60 WM driver examines only bits 8 through 15. If that byte is neither 0x01 nor 0x02, the current profile is left unchanged.
| Enumerator | |
|---|---|
| SCE_CODEC_AUDIO_OUT_MODE_COMPRESSED | Compressed SceAudio output profile. |
| SCE_CODEC_AUDIO_OUT_MODE_NORMAL | Normal SceAudio output profile. |
External-codec audio-input profiles used by SceAudioIn.
| int ksceCodecReadRegister | ( | SceUInt32 | reg | ) |
Read a raw register from the external audio codec.
The FW 3.60 WM driver sends the low 16 bits of the address as a big-endian word to I2C bus 0, device address 0x34. This function does not lock the codec mutex. Do not call it concurrently with another codec operation.
| [in] | reg | - Register address; only the low 16 bits are used. |
Write a raw register in the external audio codec.
The FW 3.60 WM driver sends the address and value as big-endian 16-bit words to I2C bus 0, device address 0x34. It waits for a preceding special register write to complete and retries a failed transfer up to three times. This function does not lock the codec mutex. Do not call it concurrently with another codec operation.
| [in] | reg | - Register address; only the low 16 bits are used. |
| [in] | value | - Register value; only the low 16 bits are used. |
Get the current external-codec output state.
| [out] | speaker_gain_db | - Receives the cached speaker gain in dB, or -121 while the speaker route is inactive on FW 3.60. May be NULL. |
| [out] | headphone_gain_db | - Receives the cached headphone gain in dB. May be NULL. |
| int ksceCodecSetOutputRoute | ( | SceUInt32 | output_mask | ) |
Set the external-codec output route.
The new mask replaces the route configuration; it is not ORed with the current mask. The FW 3.60 WM driver independently enables or disables the paths selected by bits 0x0100, 0x0400, and 0x1000 and ignores all other bits. Known complete route configurations are listed in SceCodecOutputRoute.
| [in] | output_mask | - New output-route mask. |
| int ksceCodecSetVolume | ( | SceUInt32 | volume_level | ) |
Set the external-codec playback volume.
| [in] | volume_level | - Volume level from 0 through 30. Level 0 is silence on FW 3.60. |
| int ksceCodecSetAudioInputMode | ( | SceCodecAudioInputMode | mode | ) |
Select the external-codec audio-input configuration used by SceAudioIn.
FW 3.60 SceAVConfig selects the built-in-microphone profile at handheld initialization and changes to the headset-microphone profile when a wired headset microphone is selected. The WM driver also implements mode 2, but no first-party FW 3.60 caller was found that selects it. Other signed values return 0x80261000.
| [in] | mode | - Audio-input profile. |
| int ksceCodecSetAudioOutMode | ( | SceCodecAudioOutMode | mode | ) |
Select the external-codec audio-output mode used by SceAudio.
If the speaker path is active, changing profiles temporarily disables that path, reconfigures the codec, and restores it. On the FW 3.60 WM driver a compressed-profile request made while the speaker path is inactive is not saved.
| [in] | mode | - One of SceCodecAudioOutMode. |
| int ksceCodecGetMicrophoneDetectStatus | ( | void | ) |
Get the headset-microphone detection state.
The FW 3.60 WM driver returns codec register 0x30 bit 7. After microphone detection power is enabled, SceHpremote interprets 0 as microphone present and every nonzero result as microphone absent.
| int ksceCodecSetMicrophoneDetectPower | ( | SceBool | enable | ) |
Enable or disable the codec circuitry used for headset-microphone detection.
| [in] | enable | - A nonzero value enables detection power; zero disables it. |