mixxxdj / mixxx

Mixxx is Free DJ software that gives you everything you need to perform live mixes.
http://mixxx.org
Other
4.52k stars 1.28k forks source link

Mixxx crashes after reloading controller script #10474

Open mixxxbot opened 2 years ago

mixxxbot commented 2 years ago

Reported by: tristan-young Date: 2021-07-18T03:18:13Z Status: New Importance: Undecided Launchpad Issue: lp1936735 Tags: controllers, crash Attachments: [Mixxx call stack 1.txt](https://bugs.launchpad.net/bugs/1936735/+attachment/5511669/+files/Mixxx call stack 1.txt)


Hello.

I've been working on a Pioneer DDJ-SX3 controller script, based on a different similar script.

I'm running Mixxx official release v2.3.0.8292 64bit on Windows 10 v10.0.19043 Build 19043

When I save my changes to the script, Mixxx reloads the script.

When reloading, sometimes things will go well, and sometimes they don't. It appears the Pioneer DDJ-SX3 doesn't receive its keep-alive message on-time, and exits Serato mode. When it does this, I hear the Windows 10 USB device disconnect notification sound. Mixxx has crashed by this point.

I am not using the DDJ-SX3 as a soundcard; all my Mixxx audio settings route through my Focusrite Saffire Pro 40 for now.

My repository for the script is located here:     https://github.com/TristanYoung/mixxx

My call trace is attached to this report.

mixxxbot commented 2 years ago

Commented by: tristan-young Date: 2021-07-18T03:18:13Z

mixxxbot commented 2 years ago

Commented by: tristan-young Date: 2021-07-18T03:25:24Z Attachments: [Mixxx call stack 1.txt](https://bugs.launchpad.net/mixxx/+bug/1936735/+attachment/5511669/+files/Mixxx call stack 1.txt)

mixxxbot commented 2 years ago

Commented by: Be-ing Date: 2021-07-18T03:50:00Z


Interesting... it looks like PortMidi is trying to dereference a pointer to an address which is no longer valid. I suppose the DDJ-SX3 (or the driver?) is resetting the USB connection or something. Unfortunately PortMidi does not support hotplug although we have been talking about implementing hotplug support in Mixxx for a long time.

I just forked the unmaintained PortMidi library to our GitHub organization and rewrote the build system yesterday: https://github.com/mixxxdj/portmidi Feel free to dig in and get to the root of this.

mixxxbot commented 2 years ago

Commented by: tristan-young Date: 2021-07-18T04:17:35Z


Thank you for taking the time to look.

I wish I knew more about programming. I can't really offer much help.

Hotplugging definitely seems like a good idea, especially considering the round of random disconnect issues that used to plague the USB on my motherboard (which have since been fixed with a BIOS update).

I'm going to try to keep the controller alive by firing off one more keep-alive upon script termination - assuming of course that the shutdown function is called before the script is reloaded.

What's weird is I found another script that someone had started that doesn't exhibit this behaviour - the controller is able to remain in Serato every time the script reloads. It doesn't appear to be anything special, so perhaps it's due to the time it takes to reload, and compile the script.