Note
This API has been available since API level 11.
This API has been available since API level 11.
Connects the audio source to the audio output device and also controls the volume on the audio device. It provides HAL abstraction for the back-end, which means that the 'audiooutput' service works with HAL or ALSA or other hardware abstraction layer.
The 'audiooutput' service is a context-less (stateless) implementation of audio handling. Since the 'audio' service manages audio policies, the 'audiooutput' service will not hold any context information.
Note:
NA
API level 11
Connects the audio source to the audio sink.
Name | Required | Type | Description |
---|---|---|---|
source | Required | String | Indicates the audio source. Possible values are:
|
sink | Required | String | Indicates the audio sink. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number (int8_t) | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details. |
source | Optional | String | Indicates the audio source. |
sink | Optional | String | Indicates the audio sink. |
Example scenario
# luna-send -n 1 luna://com.webos.service.audiooutput/audio/connect '{
"source":"AMIXER",
"sink":"ALSA"
}'
Response:
{
"source":"AMIXER",
"sink":"ALSA",
"returnValue":true
}
API level 11
Disconnects from the audio sink.
Note: No changes if there is no connection.
Name | Required | Type | Description |
---|---|---|---|
source | Required | String | Indicates the audio source. Possible values are:
|
sink | Required | String | Indicates the audio sink. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number (int8_t) | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details. |
source | Optional | String | Indicates the audio source. |
sink | Optional | String | Indicates the audio sink. |
Example scenario
# luna-send -n 1 luna://com.webos.service.audiooutput/audio/disconnect '{"source":"AMIXER","sink":"ALSA"}'
Response:
{
"source":"AMIXER",
"sink":"ALSA",
"returnValue":true
}
API level 11
Lists the information of all the connected audio source and sinks.
None
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number (int8_t) | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details. |
audio | Optional | Object array: audio | Contains the connections between source and sink. Note: For definition of the object, click the link from the "Type" column. |
Example: When no source and sink are connected
# luna-send -n 1 -f luna://com.webos.service.audiooutput/audio/getStatus '{}'
Response:
{
"audio": [ ],
"returnValue": true
}
Example: When only source and sink are connected
# luna-send -n 1 -f luna://com.webos.service.audiooutput/audio/getStatus '{}'
Response:
{
"audio":[
{
"source":"AMIXER",
"sink":"ALSA",
"muted":false,
"outputMode":"null"
}
],
"returnValue":true
}
Example: When source, sink, and soundOut are connected
# luna-send -n 1 -f luna://com.webos.service.audiooutput/audio/getStatus '{}'
Response:
{
"audio":[
{
"source":"AMIXER",
"sink":"ALSA",
"muted":false,
"outputMode":"ALSA"
}
],
"returnValue":true
}
API level 11
Mutes or unmutes the connected audio source.
Name | Required | Type | Description |
---|---|---|---|
source | Required | String | Indicates the audio source. Possible values are:
|
sink | Required | String | Indicates the audio sink. Possible values are:
|
mute | Required | Boolean | Indicates if the audio source is to be muted. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number (int8_t) | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details. |
source | Optional | String | Indicates the audio source. |
sink | Optional | String | Indicates the audio sink. |
mute | Optional | Boolean | Indicates if the audio source is muted. Possible values are:
|
Example scenario
# luna-send -n 1 -f luna://com.webos.service.audiooutput/audio/mute '{
"sink":"ALSA",
"source":"AMIXER",
"mute":true
}'
Response:
{
"source":"AMIXER",
"sink":"ALSA",
"mute":true,
"returnValue":true
}
API level 11
Sets the audio output device to which the audio must be routed.
Name | Required | Type | Description |
---|---|---|---|
soundOut | Required | String | Indicates the audio output device. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | String | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number (int8_t) | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details. |
soundOut | Optional | String | Indicates the audio output device. |
Example scenario
# luna-send -n 1 luna://com.webos.service.audiooutput/audio/setSoundOut '{"soundOut":"ALSA"}'
Response:
{
"soundOut":"ALSA",
"returnValue":true
}
API level 11
Linearly decreases, the master volume of the audio output device.
Name | Required | Type | Description |
---|---|---|---|
soundOutput | Required | String | Indicates the audio output device. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number (int8_t) | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details. |
soundOutput | Optional | String | Indicates the audio output device. |
volume | Optional | Number (int8_t) | Indicates the volume level after it is decreased. Possible range: 0 ~ 100 |
Example scenario
# luna-send -n 1 luna://com.webos.service.audiooutput/audio/volume/down '{"soundOutput":"alsa"}'
Response:
{
"soundOutput":"alsa",
"volume":9,
"returnValue":true
}
API level 11
Lists the information of all available audio output devices.
None
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number (int8_t) | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details. |
volumeStatus | Optional | Object array: volumeStatus | Contains the information of the audio output devices. |
Example scenario
# luna-send -n 1 luna://com.webos.service.audiooutput/audio/volume/getStatus '{}'
Response:
{
"returnValue":true,
"volumeStatus":[
{
"muted":false,
"volume":10,
"soundOutput":"ALSA"
}
]
}
API level 11
Mutes the audio output device.
Name | Required | Type | Description |
---|---|---|---|
soundOutput | Required | String | Indicates the audio output device. Possible values are:
|
mute | Required | Boolean | Indicates if the audio output device is to be muted. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number (int8_t) | The error code for the failed operation |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details. |
soundOutput | Optional | String | Indicates the audio output device. |
mute | Optional | Boolean | Indicates if the audio output device is muted. |
Example scenario
# luna-send -n 1 luna://com.webos.service.audiooutput/audio/volume/muteSoundOut '{"soundOutput":"ALSA","mute":false}'
Response:
{
"returnValue":true,
"soundOutput":"ALSA",
"mute":true
}
API level 11
Sets the volume of the audio output device, to a specific numerical value.
Name | Required | Type | Description |
---|---|---|---|
soundOutput | Required | String | Indicates the audio output device. Possible values are:
|
volume | Required | Number (int8_t) | Indicates the volume level to be set. Possible range: 0 - 100 |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number (int8_t) | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details. |
soundOutput | Optional | String | Indicates the audio output device. |
volume | Optional | Number (int8_t) | Indicates the volume level to be set. Possible range: 0 - 100 |
Example scenario
# luna-send -n 1 luna://com.webos.service.audiooutput/audio/volume/set '{"soundOutput":"ALSA","volume":10}'
Response:
{
"soundOutput":"ALSA",
"volume":10,
"returnValue":true
}
API level 11
Linearly increases, the master volume of the audio output device.
Name | Required | Type | Description |
---|---|---|---|
soundOutput | Required | String | Indicates the audio output device. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number (int8_t) | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details. |
soundOutput | Optional | String | Indicates the audio output device. |
volume | Optional | Number (int8_t) | Indicates the volume level after it is increased. Possible range: 0 ~ 100 |
Example scenario
# luna-send -n 1 luna://com.webos.service.audiooutput/audio/volume/up '{"soundOutput":"ALSA"}'
Response:
{
"soundOutput":"ALSA",
"volume":11,
"returnValue":true
}
Contains information of the connections between source and sink.
Note: If no Source/Sink are connected, it returns an empty array.
Name | Required | Type | Description |
---|---|---|---|
source | Optional | String | Indicates the audio source. Note: Returns empty string if no source and sink are connected. Possible values are:
|
sink | Optional | String | Indicates the audio sink. Note: Returns empty string if no source and sink are connected. Possible values are:
|
muted | Optional | Boolean | Indicates if the audio is muted. Possible values are:
|
outputMode | Optional | String | Indicates the audio output device. Note: Returns "null" string if no output device is set. Possible values are:
|
Contains the information of the audio output devices.
Name | Required | Type | Description |
---|---|---|---|
muted | Required | Boolean | Indicates if the audio output device is muted. Possible values are:
|
volume | Required | Number (int8_t) | Indicates the volume level of the audio output device. Possible volume range: 0 - 100 |
soundOutput | Required | String | Indicates the audio output device. Possible values are:
|
Error Code | Error Text | Error Description |
---|---|---|
1 | Unknown error | General Service error: API_ERROR_UNKNOWN 1 "Unknown error" |
3 | Failed to validate against schema | General Service error: API_ERROR_SCHEMA_VALIDATION 3 "Failed to validate against schema" |
4 | Invalid Parameters | General Service error: API_ERROR_INVALID_PARAMETERS 4 "invalid input Parameters" |
10 | Not implemented | General Service error: API_ERROR_NOT_IMPLEMENTED 10 "Functionality not implemented |
20 | Driver error while executing the command | Driver error: API_ERROR_HAL_ERROR 20 "Driver error while executing the command" |
200 | Audio not connected | Audio error: API_ERROR_AUDIO_NOT_CONNECTED 200 "Audio not connected" |
201 | soundOutput not implemented | Audio error: API_ERROR_INVALID_SPKTYPE 201, "soundOutput not implemented” |
202 | Volume already at max/min/Volume out of range | Audio error: API_ERROR_VOLUME_LIMIT 202, “Volume already at max/min”/"Volume out of range" |
203 | Connection not possible | Audio error: API_ERROR_CONNECTION_NOT_POSSIBLE 203 "Connection not possible" |
204 | Volume control is not supported | Volume control error: API_ERROR_INVALID_VOLUME_CONTROL 204," Volume control is not supported" |
Contents