com.webos.service.audio

API Summary

Controls the audio policy of a webOS system. Implements audio routing (sending audio streams to the proper destinations) and setting volumes in different scenarios..

Its functionality is categorized into the following modules:

  • Master: Controls the master volume of audio output devices.
  • UMI: Handles connections and manages volume for audio resources, when playing audio from applications like YouTube.
  • System: Controls audio policy for DTMF (touch tones), alarm, calendar, and effects.
  • Media: Controls audio policy for media playback.
  • Ringtone: Controls audio policy for ringtones.
  • Alert: Controls audio policy for alerts.

In addition, there is a soundSettings category, to manage sound settings such as setting the output device for the audio.

Note: [ Applicable for Master, UMI, and SoundSettings ] The audio service calls the audiooutput service to communicate with the audio hardware layer.

Overview of the API

-NA-

Methods

media/setVolume

Description

Sets the volume level of the current or the specified scenario.

Parameters

Name

Required

Type

Description

volumeRequiredNumber

Indicates the volume level to be set.

sessionIdOptionalNumber

Indicates the display/session to which the operation is applicable.

Possible values are:

  • 0
  • 1

Note: If not provided, the operation is applied to session 0.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details.

Error Codes Reference

Error Code

Error Text

Error Description

1Could not validate json message against schema

Wrong JSON message format

2"Missing 'volume' integer parameter."

Mandatory Parameter  Volume  has to be specified

3"failed to set parameter (invalid scenario name?)"

Volume for the scenario could not be set. Check for the validity of scenario

3Invalid 'volume' integer parameter value or file not found.

Volume value is not valid. It should be  between 0 and 100.

Example

# luna-send -f -n 1 luna://com.webos.service.audio/media/setVolume '{"volume":10}'

Response:

{
    "returnValue": true
}

# luna-send -f -n 1 luna://com.webos.service.audio/media/setVolume '{"volume":50, "sessionId":0}'

Response:

{   
   "returnValue": true
}

# luna-send -f -n 1 luna://com.webos.service.audio/media/setVolume '{"volume":50, "sessionId":1}'

Response:

{   
   "returnValue": true
}

systemsounds/playFeedback

Description

Plays the various system alert sounds based on the name passed to it.

Parameters

Name

Required

Type

Description

nameOptionalString

Name of the system sound.

sinkOptionalString

Sink to use to play sound (default: pfeedback).

playOptionalBoolean
  • To preload and play the file, set play to true.
  • To preload but not to play the file, set play to false.
  • The default value of play is true.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean
  • If the method succeeds, returnValue will contain true.
  • If the method fails, returnValue will contain false.

Example

# luna-send -n 1 -f luna://com.webos.service.audio/systemsounds/playFeedback '{
   "name":"voicestart",
   "sink":"pfeedback",
   "play":true
}'

Response:

{
    "returnValue": true
}

# luna-send -n 1 -f luna://com.webos.service.audio/systemsounds/playFeedback '{
   "name":"voicestart",
   "sink":"pfeedback",
   "play":false
}'

Response:

{
    "returnValue": true
}

# luna-send -n 1 -f luna://com.webos.service.audio/systemsounds/playFeedback '{"name": "voicestart", "play":false}'

Response:

{
    "returnValue": true
}

# luna-send -n 1 -f luna://com.webos.service.audio/systemsounds/playFeedback '{"name": "voicestart"}'

Response:

{
    "returnValue": true
}

# luna-send -n 1 -f luna://com.webos.service.audio/systemsounds/playFeedback '{}'

Response:

{
    "errorCode": 2,
    "returnValue": false,
    "errorText": "Missing 'name' string parameter."
}

# luna-send -n 1 -f luna://com.webos.service.audio/systemsounds/playFeedback '{"namex": "voicestart"}'

Response:

{
    "errorCode": 1,
    "returnValue": false,
    "errorText": "Could not validate json message against schema"
}

# luna-send -n 1 -f luna://com.webos.service.audio/systemsounds/playFeedback '{"name": "shutter"}'

Response:

{
    "returnValue": true
}

# luna-send -n 1 -f luna://com.webos.service.audio/systemsounds/playFeedback '{"name": "shutter_test"}'

Response:

{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "Invalid 'name' string parameter value or file not found."
}

udev/event

Description

Gives the audiod information regarding the USB Mic/Headset Connected/Disconnected events based on the udev rules.

It also provides the sound card number and device number information.

Parameters

Name

Required

Type

Description

eventRequiredString

The event to be passed to audiod by the udev rule when USB soundcard is detected.It is a simple string defined by audiod.
For example supported events are headset-removed, headset-inserted, headset-mic-inserted, usb-mic-inserted,
usb-mic-removed, usb-headset-inserted, usb-headset-removed.

soundcard_noOptionalNumber

sound card number as of now is being extracted from the device path where USB sound card is detected by udev.

device_noOptionalNumber

device number as of now is being extracted from the device path where USB sound card is detected by udev.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

If the method succeeds, returnValue will contain true.
If the method fails, returnValue will contain false. 
The method may fail because of one the error conditions described in the Error Codes Reference of this API.

errorCodeOptionalNumber

errorCode contains the error code if the method fails. The method will return errorCode only if it fails.

errorTextOptionalString

errorText contains the error text if the method fails. The method will return errorText only if it fails.

Example

# luna-send -n 1 luna://com.webos.service.audio/udev/event '{
   "event":"usb-mic-inserted",
   "soundcard_no":"1",
   "device_no":"0"
}'

# luna-send -n 1 luna://com.webos.service.audio/udev/event '{"event":"headset-inserted"}'

Response:

{
   "returnValue":true
}

# luna-send -n 1 luna://com.webos.service.audio/udev/event '{"event":"headset-removed"}'

Response:

{
   "returnValue":true
}

UMI/connect

Description

Establishes connection for the audio resource.

Parameters

Name

Required

Type

Description

outputModeRequiredString

Indicates the audio output device.

Possible values are:

  • alsa
audioTypeRequiredString

Indicates the type of the audio stream.

Possible values for Open are:

  • umimedia
sinkRequiredString

Indicates the audio sink.

Possible values are:

  • ALSA
sourceRequiredString

Indicates the audio source.

Possible values are:

  • AMIXER
sourcePortRequiredNumber

Audio source port. Possible values are 0 ~1 for ADEC source and 0~7 for AMIXER source

contextOptionalString

Indicates the audio pipeline ID.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

sourceRequiredString

Indicates the audio source.

Possible values are:

  • AMIXER
sinkRequiredString

Indicates the audio sink.

Possible values are:

  • ALSA

Example

# luna-send -f -n 1 luna://com.webos.service.audio/UMI/connect '{
   "outputMode":"alsa",
   "audioType":"umimedia",
   "sink":"ALSA",
   "source":"AMIXER",
   "sourcePort":0
}'

Response:

{
    "source": "AMIXER",
    "sink": "ALSA",
    "returnValue": true
}

# luna-send -f -n 1 luna://com.webos.service.audio/UMI/connect '{
   "outputMode":"alsa",
   "audioType":"umimedia",
   "sink":"ALSA",
   "source":"AMIXERTEST",
   "sourcePort":0
}'

Response:

{
    "errorCode": 4,
    "returnValue": false,
    "errorText": "Invalid parameters"
}

# luna-send -f -n 1 luna://com.webos.service.audio/UMI/connect '{
   "outputMode":"alsa",
   "audioType":"radio",
   "sink":"ALSA",
   "source":"AMIXER",
   "sourcePort":0
}'

Response:

{
    "source": "AMIXER",
    "sink": "ALSA",
    "returnValue": true
}

UMI/disconnect

Description

Disconnects the connection. 

Parameters

Name

Required

Type

Description

sinkRequiredString

Indicates the audio sink.

Possible values are:

  • ALSA
sourceRequiredString

Indicates the audio source.

Possible values are:

  • AMIXER
sourcePortRequiredNumber

Audio source port. Possible values are 0 ~1 for ADEC source and 0~7 for AMIXER source

audioTypeRequiredString

Indicates the audio stream type.

Possible values for Open are:

  • umimedia
contextOptionalString

Indicates the audio pipeline ID.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

sourceRequiredString

Indicates the audio source.

Possible values are:

  • AMIXER
sinkRequiredString

Indicates the audio sink.

Possible values are:

  • ALSA

Example

# luna-send -f -n 1 luna://com.webos.service.audio/UMI/disconnect '{
   "sink":"ALSA",
   "source":"AMIXER",
   "sourcePort":0,
   "audioType":"umimedia"
}'

Response:

{
    "source": "AMIXER",
    "sink": "ALSA",
    "returnValue": true
}

UMI/getStatus

Description

Shows the connection status of audio resources. 

Parameters

None

Call Returns

Name

Required

Type

Description

audioRequiredObject array: audio

Audio connection details.

returnValueRequiredBoolean

 Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

Example

# luna-send -f -n 1 luna://com.webos.service.audio/UMI/getStatus '{}'

Response:

{
    "audio": [
        {
            "source": "AMIXER",
            "sink": "ALSA",
            "muted": false,
            "outputMode": "alsa"
        }
    ],
    "returnValue": true
}

UMI/mute

Description

Mutes or unmutes the input volume of the requested connection.

Note: This method is added for future-use. It does not have any impact on the audio setting.

Parameters

Name

Required

Type

Description

sinkRequiredString

Audio sink.

Possible values are:

  • ALSA
sourceRequiredString

Audio source.

Possible values are:

  • AMIXER
sourcePortRequiredNumber

Audio source port

muteRequiredBoolean

Indicates if the input volume is to be muted. Possible values are: 

  • true - If the input volume is to be muted.
  • false - If the input volume is not to be muted. 

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details. 
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

Example

# luna-send -n 1 -f luna://com.webos.service.audio/UMI/mute '{
   "sink":"ALSA",
   "source":"AMIXER",
   "sourcePort":0,
   "mute":true
}'

Response:

{
    "returnValue": true
}

# luna-send -n 1 -f luna://com.webos.service.audio/UMI/mute '{
   "sink":"ALSA",
   "source":"AMIXER",
   "sourcePort":0,
   "mute":false
}'

Response:

{
    "returnValue": true
}

# luna-send -n 1 -f luna://com.webos.service.audio/UMI/mute '{
   "sink":"ALSA",
   "source":"AMIXER",
   "sourcePort":0,
   "mute":1
}'

Response:

{
    "errorCode": 1,
    "returnValue": false,
    "errorText": "Could not validate json message against schema"
}

master/getVolume

Description

Gives the current master volume of the audio output device. 

Parameters

Name

Required

Type

Description

subscribeOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

volumeStatusOptionalObject array: VolumeStatus

Indicates the status of volume for different audio output devices.

callerIdOptionalString

Indicates the luna service name of the calling application.

Example

# luna-send -n i -f luna://com.webos.service.audio/master/getVolume '{
   "subscribe":true
}'

Response:

{
   "volumeStatus":{
      "sessionId":0,
      "muted":false,
      "volume":100,
      "soundOutput":"alsa"
   },
   "returnValue":true,
   "callerId":"com.webos.lunasend-2027"
}

After change volume for session 1:

{
   "volumeStatus":{
      "sessionId":1,
      "muted":false,
      "volume":50,
      "soundOutput":"alsa"
   },
   "returnValue":true,
   "callerId":"com.webos.lunasend-2057"
}

master/setVolume

Description

Sets the master volume of the audio output device.

Parameters

Name

Required

Type

Description

sessionIdOptionalNumber

Indicates the display/session applicable to the operation.

Possible values are:

  • 0
  • 1

Note: If not provided, the operation is applied to session 0.

soundOutputRequiredString

Indicates the target sound output device.

Possible value: "alsa"

volumeRequiredNumber

Indicates the volume level to be set.

Possible range: 0-100 

Call Returns

Name

Required

Type

Description

volumeRequiredNumber

Indicates the current volume level.

Possible range: 0-100

soundOutputRequiredString

Indicates the target sound output device.

Possible value: "alsa"

returnValueRequiredBoolean

Indicates the status of operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorTextOptionalString

Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

errorCodeOptionalNumber

The error code for the failed operation.

Example

# luna-send -f -n 1 luna://com.webos.service.audio/master/setVolume '{
   "soundOutput":"alsa",
   "volume":57,
   "sessionId":0
}'

Response:

{
    "volume": 57,
    "returnValue": true,
    "soundOutput": "alsa"
}

# luna-send -f -n 1 luna://com.webos.service.audio/master/setVolume '{
   "soundOutput":"alsa",
   "volume":50,
   "sessionId":1
}'

Response:

{
    "volume": 50,
    "returnValue": true,
    "soundOutput": "alsa"
}

master/volumeUp

Description

Increases the master volume of the device. 

Parameters

Name

Required

Type

Description

sessionIdOptionalNumber

Indicates the display/session applicable to the operation.

Possible values are:

  • 0
  • 1

Note: If not provided, the operation is applied to session 0.

soundOutputRequiredString

Indicates the audio output device.

Possible value:

  • "alsa"

Call Returns

Name

Required

Type

Description

volumeRequiredNumber

Indicates the current level of volume.

Possible range: 0-100

returnValueRequiredBoolean

Indicates the status of operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

soundOutputRequiredString

Indicates the audio output device.

Possible value: "alsa" 

Example

# luna-send -f -n 1 luna://com.webos.service.audio/master/volumeUp '{
   "soundOutput":"alsa",
   "sessionId":0
}'

Response:

{
    "volume": 12,
    "returnValue": true,
    "soundOutput": "alsa"
}

# luna-send -f -n 1 luna://com.webos.service.audio/master/volumeUp '{
   "soundOutput":"alsa",
   "sessionId":1
}'

Response:

{
    "volume": 20
    "returnValue": true,
    "soundOutput": "alsa"
}

master/volumeDown

Description

Reduces the master volume of the device. 

Parameters

Name

Required

Type

Description

soundOutputRequiredString

Indicates the audio output device.

Possible value: "alsa"

sessionIdOptionalNumber

Indicates the display/session applicable to the operation.

Possible values are:

  • 0
  • 1

Note: If not provided, the operation is applied to session 0.

Call Returns

Name

Required

Type

Description

volumeRequiredNumber

Indicates the current level of volume.

Possible range: 0-100

returnValueRequiredBoolean

Indicates the status of operation.

Possible values are: 

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

soundOutputRequiredString

Indicates the audio sound output device.

Possible value: "alsa"

Example

# luna-send -f -n 1 luna://com.webos.service.audio/master/volumeDown '{
   "soundOutput":"alsa",
   "sessionId":0
}'

Response:

{
    "volume": 11,
    "returnValue": true,
    "soundOutput": "alsa"
}

# luna-send -f -n 1 luna://com.webos.service.audio/master/volumeDown '{
   "soundOutput":"alsa",
   "sessionId":1
}'

Response:

{
    "volume": 49,
    "returnValue": true,
    "soundOutput": "alsa"
}

master/muteVolume

Description

Mutes or unmutes the master volume of the audio output device. 

Parameters

Name

Required

Type

Description

muteRequiredBoolean

Indicates if the master volume is to be muted.

Possible values are: 

  • true: Master volume to be muted.
  • false: Master volume not to be muted.
sessionIdOptionalNumber

Indicates the display/session applicable to the operation.

Possible values are:

  • 0
  • 1

Note: If not provided, the operation is applied to the audio device connected to both the displays/sessions.

soundOutputRequiredString

Indicates the audio output device.

Possible values:

  • "alsa"

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation. 

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

muteRequiredBoolean

Indicates if the master volume is on mute or not.

Possible values are:

  • true: Master volume is on mute. 
  • false: Master volume is not on mute.
soundOutputRequiredString

Indicates the audio output device.

Possible value: "alsa"

return1905OptionalStringDescription here

Example

# luna-send -f -n 1 luna://com.webos.service.audio/master/muteVolume '{
   "soundOutput":"alsa",
   "mute":true,
   "sessionId":0
}'

Response:

{
    "mute": true,
    "returnValue": true,
    "soundOutput": "alsa"
}

# luna-send -f -n 1 luna://com.webos.service.audio/master/muteVolume '{
   "soundOutput":"alsa",
   "mute":false,
   "sessionId":0
}'

Response:

{
    "mute": false,
    "returnValue": true,
    "soundOutput": "alsa"
}

# luna-send -f -n 1 luna://com.webos.service.audio/master/muteVolume '{
   "soundOutput":"alsa",
   "mute":true,
   "sessionId":1
}'

Response:

{
    "mute": true,
    "returnValue": true,
    "soundOutput": "alsa"
}

# luna-send -f -n 1 luna://com.webos.service.audio/master/muteVolume '{
   "soundOutput":"alsa",
   "mute":false,
   "sessionId":1
}'

Response:

{
    "mute": false,
    "returnValue": true,
    "soundOutput": "alsa"
}

soundSettings/setSoundOut

Description

Sets the audio output device. 

Parameters

Name

Required

Type

Description

soundOutRequiredString

Indicates the audio output device.

Possible values are:

  • alsa

Call Returns

Name

Required

Type

Description

soundOutRequiredString

Indicates the audio output device.

Possible values are:

  • alsa
returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

Example

# luna-send -n 1 -f luna://com.webos.service.audio/soundSettings/setSoundOut '{
   "soundOut":"alsa"
}'

Response:

{
    "soundOut": "alsa",
    "returnValue": true
}

playSound

Description

Plays PCM audio files through PulseAudio sound server.

Parameters

Name

Required

Type

Description

fileNameRequiredString

Indicates the absolute path of the PCM file to be played.

sinkRequiredString

Indicates the virtual PulseAudio sink used by the application.

Possible virtual sinks are:

  • default1
  • default2
  • tts1
  • tts2
formatRequiredString

Indicates the sample format to be set.

Possible formats are:

  • PA_SAMPLE_S16LE
  • PA_SAMPLE_S24LE
  • PA_SAMPLE_S32LE
sampleRateRequiredNumber

Indicates the sample rate to be set.

Possible rates are:

  • 44100
  • 48000
  • 32000
  • 22500
channelsRequiredNumber

Indicates the number of audio channels to be used while playing the file.

Possible values are:

  • 1 (mono)
  • 2 (stereo)
  • 3
  • 4
  • 5
  • 6

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorTextOptionalString

Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

errorCodeOptionalNumber

The error code for the failed operation.

Example

# luna-send -n 1 luna://com.webos.service.audio/playSound '{  
   "fileName":"/usr/share/audiod/systemsounds/voicestart-ondemand.pcm",
   "sink":"default1",
   "sampleRate":48000,
   "format":"PA_SAMPLE_S16LE",
   "channels":2
}'

Response:

{  
   "returnValue":true
}

setInputVolume

Description

Sets the input volume for audio streams.

Parameters

Name

Required

Type

Description

streamTypeRequiredString

Indicates the stream name of the input volume to be applied.

Possible values for Open are:

  • palerts
  • pfeedback
  • pringtones
  • pmedia
  • pdefaultapp
  • peffects
  • pvoicerecognition
  • ptts
  • default1
  • default2
  • tts1
  • tts2
volumeRequiredNumber

Indicates the volume to be applied.

Possible range: 0-100

rampOptionalBoolean

Indicates if the volume is to be applied in steps.

Possible values are:

  • true: Volume is applied in steps.
  • false: Volume is not applied in steps.

Default: false

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
volumeOptionalNumber

Returns the value of applied volume in case of success.

Possible range: 0-100

streamTypeOptionalString

Returns the stream name of the volume applied.

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

Example

# luna-send -n 1 luna://com.webos.service.audio/setInputVolume '{
   "streamType":"default1",
   "volume":50
}'

Response:

{
   "volume":50,
   "returnValue":true,
   "streamType":"default1"
}

getInputVolume

Description

Gets the input volume for audio streams.

Parameters

Name

Required

Type

Description

subscribeOptionalBoolean

Indicates if subscribed to get the notifications.

Possible values are:

  • true: Subscribed to get notifications.
  • false: Not subscribed.

Default: false

streamTypeRequiredString

Indicates the stream name of the input volume to be received.

Possible values for Open are:

  • palerts
  • pfeedback
  • pringtones
  • pmedia
  • pdefaultapp
  • peffects
  • pvoicerecognition
  • ptts
  • default1
  • default2
  • tts1
  • tts2
     

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedOptionalBoolean

Indicates if the input volume is subscribed to get the notifications.

Possible values are:

  • true: Subscribed to get notifications.
  • false: Not subscribed.
streamTypeOptionalString

Indicates the stream name of the input volume to be applied. Check "Parameters" section for list of possible values.

volumeOptionalNumber

Returns the value of applied volume in case of success.

Possible range: 0-100

errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

Subscription Returns

Name

Required

Type

Description

subscribedRequiredBoolean

Indicates if the input volume is subscribed to get the notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.

Note: Always returns true.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.

Note: Always returns value as true.

streamTypeRequiredString

Indicates the stream name of the input volume to be applied. Check "Parameters" section for list of possible values.

volumeRequiredNumber

Returns the value of applied volume in case of success.

Possible range: 0-100

Example

# luna-send -n i -f luna://com.webos.service.audio/getInputVolume '{
   "streamType":"default1",
   "subscribe":true
}'

Response:

{
   "subscribed":true,
   "volume":50,
   "streamType":"default1",
   "returnValue":true
}

Subscription response:

{
   "subscribed":true,
   "volume":100,
   "streamType":"default1",
   "returnValue":true
}

getStreamStatus

Description

Gets the status and information of the active stream.

Parameters

Name

Required

Type

Description

subscribeOptionalBoolean

Indicates if subscribed to get the notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed .

Default: false

streamTypeOptionalString

Indicates the type of the stream.

Note: If not specified, all active stream details are provided.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedOptionalBoolean

Indicates if subscribed to get the notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

streamObjectOptionalObject array: streamObject

Indicates the list of active connections.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedRequiredBoolean

Indicates if subscribed to get the notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.

Note: Always returns true

streamObjectRequiredObject array: streamObject

Indicates the list of active connections.

Example

# luna-send -n i -f luna://com.webos.service.audio/getStreamStatus '{
   "streamType":"default1",
   "subscribe":true
}'

Response:

{
   "streamObject":[
      {
         "policyStatus":false,
         "source":"source",
         "inputVolume":100,
         "muteStatus":false,
         "sink":"sink",
         "streamType":"default1",
         "activeStatus":false
      }
   ],
   "subscribed":true,
   "returnValue":true
}

Subscription response:

{
   "streamObject":[
      {
         "policyStatus":false,
         "source":"source",
         "inputVolume":100,
         "muteStatus":false,
         "sink":"sink",
         "streamType":"default2",
         "activeStatus":true
      }
   ],
   "subscribed":true,
   "returnValue":true
}

Objects

audio

Object returned by the UMI/getStatus.

Name

Required

Type

Description

sourceRequiredString

Indicates the audio source.

Possible values are:

  • AMIXER
sinkRequiredString

Indicates the audio sink.

Possible values are:

  • ALSA
mutedRequiredBoolean

Indicates if the audio is muted.

Possible values are:

  • true: If the audio is muted.
  • false: If the audio is not muted.
outputModeRequiredString

Indicates the audio output device.

Possible values are:

  • ALSA

VolumeStatus

Provides the volume details of the target sound output device.

Name

Required

Type

Description

mutedRequiredBoolean

Indicates if the audio is on mute or not.

Possible values are:

  • true: Audio is on mute.
  • false: Audio is not on mute.
volumeRequiredNumber

Indicates the current volume level.

Note: Returns a value only if the audio is not on mute.

soundOutputRequiredString

Indicates the target sound output device.

Possible value: alsa

sessionIdRequiredNumber

Indicates the volume status of the targeted display/session.

Possible values are:

  • 0
  • 1

streamObject

Contains the list of active connections.

Name

Required

Type

Description

activeStatusRequiredBoolean

Indicates whether the stream is active.

Possible values are:

  • true: Stream is active.
  • false: Streams is not active.
inputVolumeRequiredNumber

Indicates the input volume of the stream.

Possible range: 0~100

muteStatusRequiredBoolean

Indicates if the audio is muted.

Possible values are:

  • true: The volume is muted.
  • false: The volume is not muted.
policyStatusRequiredBoolean

Indicates if the policy for the streams is in progress.

Possible values are:

  • true: The policy is in progress.
  • false: The policy is not in progress.
sinkOptionalString

Indicates the audio sink ( MAIN, SUB and ALSA).

sourceOptionalString

Indicates the audio source ( ADEC, AMIXER).

streamTypeRequiredString

Indicates the active stream names

Possible values for Open are:

  • palerts
  • pfeedback
  • pringtones
  • pmedia
  • pdefaultapp
  • peffects
  • pvoicerecognition
  • ptts
  • default1
  • default2
  • tts1
  • tts2

API Error Codes Reference

Error Code

Error Text

Error Description

200Audio not connected

Audio not connected

17Audiod internal error

AUDIOD_ERRORCODE_FAILED_MIXER_CALL

19Audiod internal error

AUDIOD_ERRORCODE_INVALID_AUDIO_TYPE

18Audiod internal error

AUDIOD_ERRORCODE_INVALID_ENVELOPE_INSTANCE

16Audiod internal error

AUDIOD_ERRORCODE_INVALID_MIXER_INSTANCE

21Invalid parameters

AUDIOD_ERRORCODE_INVALID_PARAMS

23Invalid schema

AUDIOD_ERRORCODE_INVALID_SCHEMA

3Invalid volume control

AUDIOD_ERRORCODE_NOT_SUPPORT_VOLUME_CHANGE

3Volume limit reached

AUDIOD_ERRORCODE_NOT_SUPPORT_VOLUME_CHANGE

22Not supported

AUDIOD_ERRORCODE_NOT_SUPPORTED

22Driver error

AUDIOD_ERRORCODE_NOT_SUPPORTED

22Audio not connected

AUDIOD_ERRORCODE_NOT_SUPPORTED

22Soundout type not supported

AUDIOD_ERRORCODE_NOT_SUPPORTED

22Connection not supported

AUDIOD_ERRORCODE_NOT_SUPPORTED

20Unknown error

AUDIOD_ERRORCODE_UNKNOWN_ERROR

1Could not validate json message against schema

Invalid number of input parameters against defined schema of the method

204Volume control is not supported

Volume control is not supported

1Not a valid json message

Wrong JSON message format

Contents