Skip to content

Latest commit

 

History

History
183 lines (144 loc) · 7.88 KB

dbus.md

File metadata and controls

183 lines (144 loc) · 7.88 KB

D-Bus messaging

The daemon interacts with the clients (CLI, UI, etc) via D-Bus.

  • Bus name: "name.giacomofurlan.ArctisManager.Next"

name.giacomofurlan.ArctisManager.Next.Settings

  • Interface Path: /name/giacomofurlan/ArctisManager/Next/Settings

Method: GetListOptions

  • Parameters: list_name (string)
  • Response format: JSON
  • Specs:

The response varies depending on the list, but it will always return a list of objects.

List name: pulse_audio_devices:

[{ "id": "string", "name": "string" }]

List name: pulse_audio_sources:

Physical microphone sources only — monitor sources (*.monitor) and daemon-managed virtual sources (Arctis_*) are excluded. Used by any client-side panel that lets the user pick a mic to feed into NC, VC, or the sidetone preview, instead of each panel opening its own PulseAudio connection.

[{ "id": "string", "name": "string", "is_default": true }]

Method: GetSettings

  • Parameters: (none)
  • Response format: JSON
  • Specs:

The response has three sections:

  • general: for general (cross-device) settings.
  • device: for device-specific settings. Will be an empty object if no device is connected.
  • settings_config: the definition for each setting, defining type, default_value and other arguments depending on the type. See YAML's device.settings.[section].[setting] types.

The clients shouldn't hard-core the settings, but read them and parse them depending on the settings_config section.

Any setting's entry may also carry available (boolean, defaults to true) and unavailable_reason (an i18n key, present only when available is false) when whether it can be used depends on something outside the daemon's own config — e.g. hide_physical_sink (General settings) is only available when WirePlumber is detected on the system. Clients should grey out / disable the control and show unavailable_reason as a tooltip when available is false, rather than hiding the setting outright.

{
    "general": {
        "toggle_setting": 0,
        "select_setting": null,
        "slider_setting": 10
    },
    "device": {
        "setting_a": 10,
        "setting_b": 0,
        "setting_c": 10
    },
    "settings_config": {
        "toggle_setting": {
            "type": "toggle",
            "default_value": false,
            "values": {
                "on": true,
                "off": false,
                "off_label": "off",
                "on_label": "on"
            }
        },
        "select_setting": {
            "type": "select",
            "default_value": null,
            "options_source": "pulse_audio_devices",
            "options_mapping": {
                "value": "id",
                "label": "description"
            }
        },
        "slider_setting": {
            "type": "slider",
            "default_value": 10,
            "min": 1,
            "max": 10,
            "step": 1,
            "min_label": "mic_muted",
            "max_label": "perc_100"
        },
        "setting_a": ...,
        "setting_b": ...,
        "setting_c": ...
    }
}

Method: SetSettings

  • Parameters: setting: string, value: string (JSON format)
  • Response format: JSON
  • Specs:

Writes the setting. Searches the setting first in the general settings and then, if not found, in the device's.

Returns boolean (true: setting saved, false: setting not found / not saved)

name.giacomofurlan.ArctisManager.Next.Status

  • Interface Path: /name/giacomofurlan/ArctisManager/Next/Status

Method: GetStatus

  • Parameters: (none)
  • Response format: JSON
  • Specs:

Returns an object with the series of configured status values, categorized per the device's representation block in daemon/device-configs/*.yaml. Each field's raw value is looked up from that same device's sync_events/sync_read definitions, with display_type (and, for a handful of well-known fields, role — see below) applied as declared there.

Some products enumerate as several devices at once (the Arctis GameBuds dongle and its charging case). The categories of every initialised device are merged into the one object: the primary device comes first, then the others in hidraw path order, and when two devices define a category with the same name the first one wins and the other is dropped whole. The primary device is the initialised one that is not marked device.companion: true in its config (see DEVICE_DSL.md), with the lowest hidraw path as the last tie-break. The same device receives SetSetting, TriggerAction, the EQ methods and is the one reported by GetCurrentDevice / GetSettings.

If no device is connected, an empty object will return.

Each setting has two required attributes, plus one optional one:

  • value: the (parsed, but not translated) value
  • type: "label" in case of string, or the display type declared as display_type on the field in daemon/device-configs/*.yaml (falls back to the raw Rust type, e.g. uint8, when the field declares none)
  • role (optional): a stable, device-agnostic identity for a handful of well-known concepts whose raw field name varies a lot per device family — currently battery_headset, battery_dock, battery_left, battery_right, battery_case, battery_case_left, battery_case_right, chatmix_game, chatmix_chat. battery_left/battery_right are the earbuds' batteries as reported by the dongle, while battery_case_left/battery_case_right are the same earbuds as measured by the charging case (battery_case is the case's own battery). A role must name a single field across the whole merged output: clients keep one value per role, so two devices must not tag fields with the same role. Present only on fields the device config explicitly tags; a client that wants "the headset battery" regardless of which device is connected should scan for role == "battery_headset" rather than hardcoding a field name like headset_battery_charge — that name is specific to one device family among several.
{
    "headset": {
        "headset_power_status": {
            "value": "online",
            "type": "label"
        },
        "headset_batt_level": {
            "value": 87,
            "type": "percentage",
            "role": "battery_headset"
        },
        "noise_cancelling": {
            "value": "off",
            "type": "label"
        },
        "transparent_noise_cancelling_level": {
            "value": 100,
            "type": "percentage"
        },
        "auto_off_time_minutes": {
            "value": 30,
            "type": "int_int_mapping"
        }
    },
    ...
}

name.giacomofurlan.ArctisManager.Next.Config

  • Interface Path: /name/giacomofurlan/ArctisManager/Next/Config

Method: ReloadConfigs

  • Parameters: (none)
  • Response format: JSON
  • Specs:

Reload the configuration files, useful to test new devices support during the development phase. Return boolean (success / failure).

Method: GetDiagnostics

  • Parameters: (none)
  • Response format: JSON
  • Specs:

Read-only report of the SteelSeries hidraw nodes the system exposes, for the troubleshooting page. It never opens a device node and says nothing about non-SteelSeries hardware. Shape:

{"version": 1, "devices": [{
  "node": "hidraw3", "vendor_id": "1038", "product_id": "2202",
  "manufacturer": "SteelSeries", "product": "Arctis ...", "interface": 5,
  "usb_audio": true, "audio_accessory": false,
  "status": "supported", "config_name": "Arctis ...", "report_descriptor": "06c0ff..."
}]}

status is supported (a device config lists this product ID), unsupported (an audio product with no config: the case for a new-device request) or ignored (SteelSeries but not an audio product, such as a keyboard or mouse, which the helper refuses to open). report_descriptor is the HID report descriptor as lowercase hex, or null when sysfs does not expose it.