Midi lights not set correctly when a setting is changed mid-processing by Mixxx engine

Bug #1188967 reported by Owen Williams
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Low
Unassigned

Bug Description

Sometimes we use logic like this:

slot_mycontrolobject_GotAChange() {
  if (badconditions) {
    mycontrolobject->set(revertchange);
  }
}

we do this for things like resetting the rate slider, or ignoring when
the user pushes the play button when no track is loaded, etc.

This used to work fine, but I'm having problems now that the message
queue is different. The midi lights get out of sync with the control
object. So if the above code happens, what I get out of midi is:

sendshortmessage(revertedchange);
sendshortmessage(originalincorrectvalue);

Based on stack traces I think this is because the call to ->set occurred
instantly, before the midi message corresponding to the original slot
call has been processed. The revert goes through, then the original call
continues and the midi controller is updated with the out-of-date value.

I have tried making the midi connection queued, but that didn't work.
What did end up working was firing a singleshot qtimer that resends out
the correct values on the next pass. That doesn't feel awesome and
looks hacky. Is there some other way of fixing this?

Steps to Reproduce:
1. connect a controller with lights
2. start mixxx
3. do not load a track in deck 1
4. push the play button

correct behavior:
* the play light on the controller does not illuminate

trunk behavior:
* it does

Tags: midi
Revision history for this message
Owen Williams (ywwg) wrote :

Possible fix: have the output handler check to make sure the Changed value it received is up to date.

Revision history for this message
jus (jus) wrote :

Is this still an issue?

tags: added: midi
Revision history for this message
Owen Williams (ywwg) wrote :

We've added a patch so this is fixed.

Changed in mixxx:
status: New → Fix Committed
jus (jus)
Changed in mixxx:
importance: Undecided → Low
milestone: none → 1.12.0
RJ Skerry-Ryan (rryan)
Changed in mixxx:
status: Fix Committed → Fix Released
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/7068

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.