mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
With this patch, messages can be sent to the cards to enable/disable jack detection for the whole card or single ports, manually set a port state and to retrieve the current state of jack detection and port availability.
74 lines
2.4 KiB
Text
74 lines
2.4 KiB
Text
Message API reference
|
|
|
|
The message API allows any object within pulseaudio to register a message
|
|
handler. A message handler is a function that can be called by clients using
|
|
PA_COMMAND_SEND_OBJECT_MESSAGE. A message consists at least of an object path
|
|
and a message command, both specified as strings. Additional parameters can
|
|
be specified using a single string in JSON format, but are not mandatory.
|
|
|
|
The message handler returns an error number as defined in def.h and also returns
|
|
a string in the "response" variable. Non-empty response will be in JSON format.
|
|
|
|
The reference further down lists available messages, their parameters
|
|
and return values.
|
|
|
|
Reference:
|
|
|
|
Object path: /core
|
|
Message: list-handlers
|
|
Parameters: None
|
|
Return value: JSON array of handler description objects
|
|
[{"name":"Handler name","description":"Description"} ...]
|
|
|
|
Object path: /card/bluez_card.XX_XX_XX_XX_XX_XX/bluez
|
|
Message: list-codecs
|
|
Parameters: None
|
|
Return value: JSON array of codec description objects
|
|
[{"name":"codec1","description":"Codec 1"} ...]
|
|
|
|
Object path: /card/bluez_card.XX_XX_XX_XX_XX_XX/bluez
|
|
Message: get-codec
|
|
Parameters: None
|
|
Return value: "codec name"
|
|
|
|
Object path: /card/bluez_card.XX_XX_XX_XX_XX_XX/bluez
|
|
Message: switch-codec
|
|
Parameters: "codec name"
|
|
Return value: none
|
|
|
|
Description: Set if card profile selection should be sticky instead of being automated
|
|
Object path: /card/<card_name>
|
|
Message: set-profile-sticky
|
|
Parameters: JSON "true" or "false"
|
|
Return value: none
|
|
|
|
Description: Get if card profile selection should be sticky instead of being automated
|
|
Object path: /card/<card_name>
|
|
Message: get-profile-sticky
|
|
Parameters: None
|
|
Return value: JSON "true" or "false"
|
|
|
|
Object path: /cards/<card_name>
|
|
Message: set-jack-detection
|
|
Parameters: {"port_name|all":true|false}
|
|
Return value: None
|
|
|
|
Object path: /cards/<card_name>
|
|
Message: get-jack-detection
|
|
Parameters: "port_name|all"
|
|
Return value: {"port_name":true|false}
|
|
If "all" is specified, the returned object looks different:
|
|
{"Card name":"card_name", "Detection states":{"port_name":true|false, ...}}
|
|
|
|
Object path: /cards/<card_name>
|
|
Message: set-port-state
|
|
Parameters: {"port_name|all":0|1|2}
|
|
Return value: None
|
|
0=unknown, 1=no, 2=yes
|
|
|
|
Object path: /cards/<card_name>
|
|
Message: get-port-state
|
|
Parameters: "port_name|all"
|
|
Return value: {"port_name":0|1|2}
|
|
If "all" is specified, the returned object looks different:
|
|
{"Card name":"card_name", "Port states":{"port_name":0|1|2, ...}}
|