MIDI output messages are sent twice for effect buttons

Bug #1945572 reported by Christian
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mixxx
New
Undecided
Unassigned

Bug Description

Problem:
MIDI output messages are sent twice to each connected MIDI controller for certain effect related controls.

Steps to reproduce the problem:
1. Load the attached example mapping
2. Open the log in the developer tools
3. Toggle parameter button 1 of effect 1 in effect unit 1

Actual behavior: The log shows that 2 messages are sent.
Expected behavior: The log shows that 1 message is sent.

Controls that are affected:
- Effect enable buttons, e.g. [EffectRack1_EffectUnit1_Effect1],enabled
- Effect parameter buttons, e.g. [EffectRack1_EffectUnit1_Effect1],button_parameter1
- Effect assignment buttons, e.g. [EffectRack1_EffectUnit1],group_[Channel1]_enable

Controls that are not affected:
- Effect pots, e.g. [EffectRack1_EffectUnit1_Effect1],parameter1
- Effect focus button, [EffectRack1_EffectUnit1],focused_effect

Environment:
- 2.3-beta-4293-g2945f43418 / Windows x64
- 2.3 / Linux x86_64 (Ubuntu)

Additional info:
The JS Component function `output()` is called twice. Since this call is made from C, the issue is probably not caused by javascript code.

Revision history for this message
Christian (ubuntu-linux-user) wrote :
Revision history for this message
Christian (ubuntu-linux-user) wrote :

ControlObjectScript::slotValueChanged() is called twice for every effect button change.

Revision history for this message
ronso0 (ronso0) wrote :

> Effect enable buttons, e.g. [EffectRack1_EffectUnit1_Effect1],enabled

maybe because they can be latched by quick press as well as enabled temporarily as long as the button is pressed? This applies to both enable and disable btw.
Maybe that applies to the other buttons, too. Didn't test.

Revision history for this message
Christian (ubuntu-linux-user) wrote :

Both messages are emitted immediately on press, i.e. the behavior is the same for short press and long press.

Revision history for this message
Christian (ubuntu-linux-user) wrote (last edit ):

ControlObjectScript::addScriptConnection creates 2 connections:

- connect(m_pControl.data(), &ControlDoublePrivate::valueChanged, this, &ControlObjectScript::slotValueChanged, Qt::QueuedConnection);

- connect(this, &ControlObjectScript::trigger, this &ControlObjectScript::slotValueChanged, Qt::QueuedConnection);

The first of them causes 1 of the 2 output messages.

The EffectButtonParameterSlot constructor creates 1 connection:

- connect(m_pControlValue, &ControlObject::valueChanged, this, &EffectButtonParameterSlot::slotValueChanged);

This connection causes the other output message.

Revision history for this message
Christian (ubuntu-linux-user) wrote :

Call stack:

Debug [Main]: EffectButtonParameterSlot::slotValueChanged()
Debug [Main]: EffectParameter::setValue()
Debug [Main]: EffectParameter::updateEngineState()
Debug [Main]: EffectParameter::valueChanged()
Debug [Controller]: ControlObjectScript::slotValueChanged()
Debug [Controller]: ControllerEngine: executeCallback()
Debug [Controller]: output: 1

Debug [Controller]: ControlObjectScript::slotValueChanged()
Debug [Controller]: ControllerEngine: executeCallback()
Debug [Controller]: output: 1

Revision history for this message
Christian (ubuntu-linux-user) wrote :

Looks to me as if &ControlDoublePrivate::valueChanged causes the duplicate MIDI message.

The problem only occurs on buttons, not on knobs. Thus I compared the implementations of effect button and effect knob, but didn't find anything useful.

That's all I can provide here. I hope that someone with better knowledge about the system has an idea.

Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/10545

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.