wrodie / ha_behringer_mixer

Home Assistant integration for Behringer Digital Mixers eg (X32)
MIT License
13 stars 0 forks source link

Setting and toggling channel sends & main to a bus do not work (XR18) #38

Closed robsonfelix closed 6 months ago

robsonfelix commented 6 months ago

System Health details

System Information

version core-2024.1.3
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.11.6
os_name Linux
os_version 6.1.71-haos
arch x86_64
timezone America/Sao_Paulo
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 5000 Installed Version | 1.34.0 Stage | running Available Repositories | 1481 Downloaded Repositories | 27
Home Assistant Cloud logged_in | true -- | -- subscription_expiration | May 10, 2024 at 9:00 PM relayer_connected | true relayer_region | us-east-1 remote_enabled | true remote_connected | true alexa_enabled | true google_enabled | true remote_server | us-east-1-8.ui.nabu.casa certificate_status | ready instance_id | 6850c26402554a93ab61cb87d3a8f01e can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 11.4 -- | -- update_channel | stable supervisor_version | supervisor-2024.02.1 agent_version | 1.6.0 docker_version | 24.0.7 disk_total | 62.3 GB disk_used | 37.6 GB healthy | true supported | true board | ova supervisor_api | ok version_api | ok installed_addons | Terminal & SSH (9.9.0), File editor (5.8.0), Mosquitto broker (6.4.0), ESPHome (2023.12.9), AppDaemon (0.16.4), Grafana (9.1.3), Advanced SSH & Web Terminal (17.2.0), RPC Shutdown (2.4), openWakeWord (1.8.2)
Dashboards dashboards | 1 -- | -- resources | 19 views | 56 mode | storage
Recorder oldest_recorder_run | February 28, 2024 at 3:00 PM -- | -- current_recorder_run | March 8, 2024 at 8:30 PM estimated_db_size | 4282.43 MiB database_engine | sqlite database_version | 3.41.2
Sonoff version | 3.6.0 (8dd8af9) -- | -- cloud_online | 0 / 11 local_online | 10 / 10

Checklist

Describe the issue

I can change many things, but when actioning the toggle for ON/OFF on a specific channel to a bus, nothing happens. The same is true for changing value of that channel for a bus. Same for the ON/OFF for the main channel. I am using a XR18.

Reproduction steps

Just open the device in home assistant and try to change the values of any bus send of a channel.

I can set the values using your mixer.py program from your library by doing so:

await mixer.set_value("/main/st/mix/fader", 0.5)
await mixer.set_value("/main/st/mix/on", False)

But it does not work in the HA plugin.

As to the channel sends to bus, they don't even show up when running the mixer.py program.

Debug logs

T:\>python mixer.py
{
  "/status": "('10.0.1.172'",
  "StudioMixer",
  "XR18",
  "'1.20')",
  "/ch/16/mix_fader": 0.6197458505630493,
  "/ch/16/mix_fader_db": -5.2,
  "/ch/15/mix_fader": 0.6197458505630493,
  "/ch/15/mix_fader_db": -5.2,
  "/ch/14/mix_fader": 0.7028347849845886,
  "/ch/14/mix_fader_db": -1.9,
  "/ch/13/mix_fader": 0.7028347849845886,
  "/ch/13/mix_fader_db": -1.9,
  "/ch/12/mix_fader": 0.5845552086830139,
  "/ch/12/mix_fader_db": -6.6,
  "/ch/11/mix_fader": 0.6197458505630493,
  "/ch/11/mix_fader_db": -5.2,
  "/ch/10/mix_fader": 0.6852394938468933,
  "/ch/10/mix_fader_db": -2.6,
  "/ch/9/mix_fader": 0.4467253088951111,
  "/ch/9/mix_fader_db": -14.3,
  "/ch/8/mix_fader": 0.5122189521789551,
  "/ch/8/mix_fader_db": -9.5,
  "/ch/7/mix_fader": 0.4858260154724121,
  "/ch/7/mix_fader_db": -11.1,
  "/ch/6/mix_fader": 0.7996090054512024,
  "/ch/6/mix_fader_db": 2.0,
  "/ch/5/mix_fader": 0.7996090054512024,
  "/ch/5/mix_fader_db": 2.0,
  "/ch/4/mix_fader": 0.7996090054512024,
  "/ch/4/mix_fader_db": 2.0,
  "/ch/3/mix_fader": 0.7927663922309875,
  "/ch/3/mix_fader_db": 1.7,
  "/ch/2/mix_fader": 0.6999022364616394,
  "/ch/2/mix_fader_db": -2.0,
  "/ch/1/mix_fader": 0.6901270747184753,
  "/ch/1/mix_fader_db": -2.4,
  "/ch/16/mix_on": "True",
  "/ch/15/mix_on": "True",
  "/ch/14/mix_on": "True",
  "/ch/13/mix_on": "True",
  "/ch/12/mix_on": "True",
  "/ch/11/mix_on": "True",
  "/ch/10/mix_on": "True",
  "/ch/9/mix_on": "True",
  "/ch/8/mix_on": "True",
  "/ch/7/mix_on": "True",
  "/ch/6/mix_on": "True",
  "/ch/5/mix_on": "True",
  "/ch/4/mix_on": "True",
  "/ch/3/mix_on": "True",
  "/ch/2/mix_on": "True",
  "/ch/1/mix_on": "True",
  "/ch/16/config_name": "Mac R",
  "/ch/15/config_name": "Mac L",
  "/ch/14/config_name": "Karaoke R",
  "/ch/13/config_name": "Karaoke L",
  "/ch/12/config_name": "",
  "/ch/11/config_name": "",
  "/ch/10/config_name": "",
  "/ch/9/config_name": "",
  "/ch/8/config_name": "",
  "/ch/7/config_name": "",
  "/ch/6/config_name": "Teclado R",
  "/ch/5/config_name": "Teclado L",
  "/ch/4/config_name": "Mic 2",
  "/ch/3/config_name": "Mic 1",
  "/ch/2/config_name": "Violao 2",
  "/ch/1/config_name": "Violao 1",
  "/bus/6/mix_fader": 0.0,
  "/bus/6/mix_fader_db": -90.0,
  "/bus/5/mix_fader": 0.0,
  "/bus/5/mix_fader_db": -90.0,
  "/bus/4/mix_fader": 0.4995112419128418,
  "/bus/4/mix_fader_db": -10.0,
  "/bus/3/mix_fader": 0.4995112419128418,
  "/bus/3/mix_fader_db": -10.0,
  "/bus/2/mix_fader": 0.3998045027256012,
  "/bus/2/mix_fader_db": -18.0,
  "/bus/1/mix_fader": 1.0,
  "/bus/1/mix_fader_db": 10,
  "/bus/6/mix_on": "True",
  "/bus/5/mix_on": "True",
  "/bus/4/mix_on": "True",
  "/bus/3/mix_on": "True",
  "/bus/2/mix_on": "True",
  "/bus/1/mix_on": "True",
  "/bus/6/config_name": "DYLAN",
  "/bus/5/config_name": "DYLAN",
  "/bus/4/config_name": "TETO SALA",
  "/bus/3/config_name": "TETO SALA",
  "/bus/2/config_name": "",
  "/bus/1/config_name": "SHURE",
  "/dca/4/mix_fader": 0.662756621837616,
  "/dca/4/mix_fader_db": -3.5,
  "/dca/3/mix_fader": 0.7497556209564209,
  "/dca/3/mix_fader_db": -0.0,
  "/dca/2/mix_fader": 0.7497556209564209,
  "/dca/2/mix_fader_db": -0.0,
  "/dca/1/mix_fader": 0.7497556209564209,
  "/dca/1/mix_fader_db": -0.0,
  "/dca/4/mix_on": "True",
  "/dca/3/mix_on": "True",
  "/dca/2/mix_on": "True",
  "/dca/1/mix_on": "True",
  "/dca/4/config_name": "",
  "/dca/3/config_name": "",
  "/dca/2/config_name": "",
  "/dca/1/config_name": "",
  "/usb/state": "STOP",
  "/usb/file": "",
  "/usb/mounted": 0,
  "/main/st/mix/fader": 0.4995112419128418,
  "/main/st/mix/on": "True",
  "/main/st/config/name": "",
  "/scene/current": 1
}

Diagnostics dump

No response

robsonfelix commented 6 months ago

Here are my prefs on Audio/MIDI:

image

robsonfelix commented 6 months ago

This is what mixer.info returns:

{
  "channel": {
    "number": 16,
    "base_address": "ch"
  },
  "bus": {
    "number": 6,
    "base_address": "bus"
  },
  "matrix": {
    "number": 0,
    "base_address": "mtx"
  },
  "dca": {
    "number": 4,
    "base_address": "dca"
  },
  "fx": {
    "number": 4,
    "base_address": "fx"
  },
  "auxin": {
    "number": 0,
    "base_address": "auxin"
  },
  "auxrtn": {
    "number": 2,
    "base_address": "auxrtn"
  },
  "scenes": {
    "number": 100,
    "base_address": "scene"
  },
  "channel_sends": {
    "number": 0,
    "base_address": "chsend"
  },
  "bus_sends": {
    "number": 0,
    "base_address": "bussend"
  }
}
robsonfelix commented 6 months ago

Despite all of the above, I can see on the device in Home Assistant a channel X -> bus Y Fader and a channel X -> bus Y On for each channel and bus combination.

wrodie commented 6 months ago

I haven't been able to get access to an XR18 to test the channel sends. So I suspect that it is doing them slightly differently than the X32. I'll look into it.

robsonfelix commented 6 months ago

I can help on that provided you guide me through it. I am seasoned programmer, just not in Python. What can I do to help?

wrodie commented 6 months ago

I think I understand what the issue is. I've released a new version that I hope will fix the issue. However I haven't been able to test against an XR18 yet. Let me know if it works.

robsonfelix commented 6 months ago

the volume did work, but not the ON/OFF (mute)....

robsonfelix commented 6 months ago

Is there a way for the add-on to have a global parameter to convert from the float (0..1) to either float/integer (0..100) ? I had to create a helper for every single item and then create an automation for it to work. I only did it for the main out, but I have to do it now for every single bus and channel combination. Depending on the slider you use, this is what you have to do it for it to work.

wrodie commented 6 months ago

To the channel/mute problem. I've done some research and tested against an XR16. From what I can see and what I've seen from other comments online is that although the bus send mute is document in the API (and returns data), none of the XAIR mixers actually support it.
They have a channel mute, but no functionality to support muting only one bus send.

I'll look at removing that functionality from the integration as it can't work.

robsonfelix commented 6 months ago

I ran many tests with your code and what you said seems correct. There is the ON/OFF of a channel (across buses) but even the interface on X-Air does not support the muting of a channel to that particular bus. Perhaps what could be possible is to set volume to 0 when muted, as to "emulate" that feature of XR32 that others don't have.

Now, I re-tested changing volumes on buses greater than 1 and the test app does not seems to be catching any events... would you know why??

I used:

import asyncio
import logging
from behringer_mixer import mixer_api

def updates_function(data):
    print(f"The property {data.get('property')} has been set to {data.get('value')}")

async def main():
    mixer  = mixer_api.create("XR18", ip="x.x.x.x", logLevel=logging.WARNING)
    await mixer.start()
    await mixer.validate_connection()
    state = await mixer.reload()
    state = mixer.state()
    #print(state)
    info = mixer.info()
    print(info)
    asyncio.create_task(mixer.subscribe(updates_function))
    await asyncio.sleep(20)

if __name__ == "__main__":
    asyncio.run(main())
wrodie commented 6 months ago

I'd rather not imitate the functionality. While it would be possible, it wouldn't work quite as expected. When a mute happens it maintains the value of the fader. While in theory I could do this internally, if the mixer or HA then got restarted I would have to maintain some kind of persistent storage that I'd rather not do. Without doing this, 'unmuting' the channel would have to set it to some specific value, not the one that it was before being muted.

wrodie commented 6 months ago

In terms of "I re-tested changing volumes on buses greater than 1 and the test app does not seems to be catching any events."

I've tested with an XR16 (using your code) and changing bus volume and fader send to the bus for busses above 1 seems to work fine for me.

robsonfelix commented 6 months ago

Channel sends now work on version v0.1.9, but MAIN volume (fader) and ON/OFF toggle (mute) do not work for main.

wrodie commented 6 months ago

I think I have now resolved the issue with the mains in v0.1.10