MIDI devices are closed before the shutdown script is run

Bug #676086 reported by Sean M. Pappalardo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Low
Unassigned
1.9
Fix Released
Low
Unassigned

Bug Description

For PortMIDI devices at least, the MidiDevice is close()d before the MidiScriptEngine is shut down, preventing any shutdown script code from sending anything to the device. This happens when disabling the device in the prefs or closing Mixxx.

Not sure when this happened but it's been in trunk since at least r2544. Will try to track it down.

Tags: midi
Revision history for this message
Albert Santoni (gamegod) wrote : Re: [Bug 676086] [NEW] MIDI devices are closed before the shutdown script is run

I added a sendInhibit flag to fix a race condition on shutdown. The problem
might be caused by that.
On 2010-11-16 7:05 AM, "Sean M. Pappalardo" <email address hidden>
wrote:
> Public bug reported:
>
> For PortMIDI devices at least, the MidiDevice is close()d before the
> MidiScriptEngine is shut down, preventing any shutdown script code from
> sending anything to the device. This happens when disabling the device
> in the prefs or closing Mixxx.
>
> Not sure when this happened but it's been in trunk since at least r2544.
> Will try to track it down.
>
> ** Affects: mixxx
> Importance: Low
> Status: Confirmed
>
> ** Affects: mixxx/1.9
> Importance: Low
> Status: Confirmed
>
>
> ** Tags: midi
>
> ** Also affects: mixxx/1.9
> Importance: Undecided
> Status: New
>
> ** Changed in: mixxx/1.9
> Status: New => Confirmed
>
> ** Changed in: mixxx/1.9
> Importance: Undecided => Low
>
> ** Changed in: mixxx/1.9
> Milestone: None => 1.9.0
>
> --
> MIDI devices are closed before the shutdown script is run
> https://bugs.launchpad.net/bugs/676086
> You received this bug notification because you are a member of Mixxx
> Development Team, which is subscribed to Mixxx.

Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :

Interesting...FWIW, I now sometimes get deadlocks on shutdown in recent trunk. I thought I correctly handled deadlocking at shutdown before you added the sendInhibit by having the MidiDevice wait for the MSE's gracefulShutdown() to finish.

I'm convinced that all the locking we currently do was an incorrect way to solve the original problems. Since I've set it up awhile ago so that only the MSE thread will call MSE functions, (using signals to communicate between the MidiDevice and its MSE,) the safe* functions and much of the locks can be removed. (We can just ASSERT that each function is being called from the MSE thread if you like.)

Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :

I reverted the sendInhibit flag in r2592 of trunk which fixes this bug. (I was getting a deadlock on shutdown sometimes even when it was there.) We have too many mutexes in the MIDI subsystem and I plan to fix that before v1.10.

Changed in mixxx:
status: Confirmed → Fix Committed
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/5659

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.