vitasdk
Documentation of the vitasdk

Exports for Kernel. More...

Typedefs

typedef void(* SceAudioInPortCallback) (ScePID process_id)
 Callback called after an audio-input port is opened or released.
 

Functions

int ksceAudioInOpenPort (SceAudioInPortType port_type, int grain, int freq, SceAudioInParam param)
 Open an audio-input port for the calling process.
 
int ksceAudioInReleasePort (int port)
 Release an audio-input port owned by the calling process.
 
int ksceAudioInInput (int port, void *dest_ptr)
 Capture the configured number of mono signed 16-bit PCM samples.
 
SceBool ksceAudioInIsAnyPortOpen (void)
 Check whether any process owns an audio-input port.
 
SceBool ksceAudioInIsProcessPortOwner (ScePID process_id)
 Check whether a process owns an audio-input port.
 
int ksceAudioInSetAdoptForPid (ScePID process_id, int unused1, int unused2, int transition_delay)
 Select the process whose audio-input port is adopted.
 
int ksceAudioInSetPortOpenCallback (SceAudioInPortCallback callback)
 Register or clear the port-open callback.
 
int ksceAudioInSetPortReleaseCallback (SceAudioInPortCallback callback)
 Register or clear the port-release callback.
 
int ksceAudioInSelectInput (SceAudioInInputMode input_mode)
 Select the input route.
 
int ksceAudioInSubmitBluetoothPcm (const SceInt16 *samples, SceSize sample_count)
 Submit Bluetooth microphone PCM to AudioIn.
 

Detailed Description

Exports for Kernel.


Using this library in your project

Include the header file in your project:


Link the library to the executable:

SceAudioInForDriver_stub



Typedef Documentation

◆ SceAudioInPortCallback

typedef void(* SceAudioInPortCallback) (ScePID process_id)

Callback called after an audio-input port is opened or released.

Parameters
[in]process_id- Owner PID for an opened port, or former owner PID for a released port.

Function Documentation

◆ ksceAudioInOpenPort()

int ksceAudioInOpenPort ( SceAudioInPortType  port_type,
int  grain,
int  freq,
SceAudioInParam  param 
)

Open an audio-input port for the calling process.

Parameters
[in]port_type- Capture profile. See sceAudioInOpenPort.
[in]grain- Number of mono samples returned by each input call.
[in]freq- Sample frequency in Hz.
[in]param- Must be SCE_AUDIO_IN_PARAM_FORMAT_S16_MONO on FW 3.60.
Returns
A port handle on success, or a negative error code. Most validation failures use SceAudioInErrorCode.

◆ ksceAudioInReleasePort()

int ksceAudioInReleasePort ( int  port)

Release an audio-input port owned by the calling process.

Parameters
[in]port- Port handle returned by ksceAudioInOpenPort.
Returns
0 on success, or a negative error code.

◆ ksceAudioInInput()

int ksceAudioInInput ( int  port,
void *  dest_ptr 
)

Capture the configured number of mono signed 16-bit PCM samples.

Parameters
[in]port- Port handle returned by ksceAudioInOpenPort.
[out]dest_ptr- Kernel buffer for the captured samples. Its size must be at least grain * sizeof(SceInt16) bytes.
Returns
0 on success, or a negative error code.

◆ ksceAudioInIsAnyPortOpen()

SceBool ksceAudioInIsAnyPortOpen ( void  )

Check whether any process owns an audio-input port.

Returns
SCE_TRUE when at least one port is open, otherwise SCE_FALSE.

◆ ksceAudioInIsProcessPortOwner()

SceBool ksceAudioInIsProcessPortOwner ( ScePID  process_id)

Check whether a process owns an audio-input port.

Parameters
[in]process_id- Valid nonzero process ID. Passing 0 also matches an unused FW 3.60 port slot.
Returns
SCE_TRUE when the process owns a port, otherwise SCE_FALSE.

◆ ksceAudioInSetAdoptForPid()

int ksceAudioInSetAdoptForPid ( ScePID  process_id,
int  unused1,
int  unused2,
int  transition_delay 
)

Select the process whose audio-input port is adopted.

On FW 3.60 unused1 and unused2 are ignored. A nonzero transition_delay temporarily suppresses the selected process's input. The input worker subtracts 16 from this value per processing cycle. If the value reaches exactly zero while route-change reports remain, the worker holds it at 16 until both reports have been returned by input calls. Values that are not positive multiples of 16 can cross below zero and end suppression without that hold. AppMgr always passes zero on FW 3.60.

Parameters
[in]process_id- Process to adopt.
[in]unused1- Ignored on FW 3.60.
[in]unused2- Ignored on FW 3.60.
[in]transition_delay- Input-suppression countdown, or 0.
Returns
0.

◆ ksceAudioInSetPortOpenCallback()

int ksceAudioInSetPortOpenCallback ( SceAudioInPortCallback  callback)

Register or clear the port-open callback.

The callback runs synchronously after a port opens successfully and receives its owner PID. AudioIn releases its internal mutex before invoking it and returns the new handle after the callback completes.

Parameters
[in]callback- Callback, or NULL to clear it.
Returns
0.

◆ ksceAudioInSetPortReleaseCallback()

int ksceAudioInSetPortReleaseCallback ( SceAudioInPortCallback  callback)

Register or clear the port-release callback.

The callback runs synchronously when a port is released, including during process exit or kill cleanup, and receives its former owner PID. It runs while AudioIn holds its internal mutex. The callback must not call an AudioIn operation that locks the same mutex, such as opening, releasing, or reading a port.

Parameters
[in]callback- Callback, or NULL to clear it.
Returns
0.

◆ ksceAudioInSelectInput()

int ksceAudioInSelectInput ( SceAudioInInputMode  input_mode)

Select the input route.

The request is applied asynchronously by the input worker. FW 3.60 does not reject values outside SceAudioInInputMode: the worker records the requested value as the current route but does not explicitly select an input source for it.

Parameters
[in]input_mode- Input route.
Returns
0 when the route is already selected, otherwise the result of the FW 3.60 input-worker notification.

◆ ksceAudioInSubmitBluetoothPcm()

int ksceAudioInSubmitBluetoothPcm ( const SceInt16 *  samples,
SceSize  sample_count 
)

Submit Bluetooth microphone PCM to AudioIn.

AVConfig uses this function after receiving Bluetooth audio. The samples are used only while Bluetooth input is active. FW 3.60 stores them in a 360-sample ring buffer and advances the expected producer position by 120 samples per submission. It inserts silence when the producer is more than 120 samples behind and trims input when the producer is more than 120 samples ahead. The worker upsamples the submitted stream by two using midpoint interpolation.

Parameters
[in]samples- Kernel-resident mono signed 16-bit PCM samples. This may be NULL only when sample_count is zero.
[in]sample_count- Number of 16-bit samples, not bytes.
Returns
The input-worker notification result on success, -1 when the Bluetooth input is not active, or a negative mutex error.