fulup-bzh / AlsaJsonGateway

HTTP REST/JSON Gateway to ALSA mixer service for HTML5 UI
53 stars 5 forks source link

key named "value" for mixer controls is type of Array #15

Closed lazzarello closed 4 years ago

lazzarello commented 4 years ago

An example control from my mixer looks like

{
  "numid": 9,
  "name": "Line 03 (Headphones 1 L) Playback Volume",
  "iface": "MIXER",
  "actif": true,
  "value": [
    127
  ],
  "ctrl": {
    "type": "INTEGER",
    "count": 1,
    "min": 0,
    "max": 127,
    "step": 1
  },
  "acl": {
    "read": true,
    "write": true,
    "inact": false,
    "volat": false,
    "lock": false
  },
  "tlv": {
    "dbminmax": {
      "min": "-127.00dB",
      "max": "0.00dB"
    }
  }
}

It seems odd that the numerical value of the control is an Array rather than an Integer. Are there single mixer controls that have more than one value?

fulup-bzh commented 4 years ago

The value is an integer because you may get multiple values. In you sample CTRL the count is '1', would count be '2' for a right/left control then you would have two values in your array.

This being said when you set a control, you may provide an array or an integer. In this case the integer value is duplicated of 'count' value as if you had provided an array with equal values.

lazzarello commented 4 years ago

Thanks, that makes sense. I don't think the Scarlett model I have exposes controls with many values but I'd imagine there are some out there.