Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: JACK 1.9.11_64, if installed on the system, causes Mixxx 2.2.4 64-bit to crash on startup. #623

Closed
siana opened this issue Aug 11, 2020 · 31 comments

Comments

@siana
Copy link

siana commented Aug 11, 2020

Running on Windows 10 64-bit 20.04
repro:
Install latest Jack 64-bit release for Windows
Install latest Mixxx 64-bit release for Windows
Observe: Mixxx crashes on startup.
Uninstall JACK
Observe: Mixxx no longer crashes on startup.
The crash occurs during PortAudio initialisation in Mixxx, presumably while loading the ASIO driver provided by JACK. It doesn't matter whether JACK server is running or not.

A similar looking issue has occurred in FlexASIO version 1.4. It was remedied in version 1.5. PortAudio was chain loaded by FlexASIO, but because the DLL basename matched an already loaded module, but was not compatible, FlexASIO would crash. Is it plausible that the mechanism is similar at all? Corresponding issue dechamps/FlexASIO#47

Potentially related issues:
rodrigodzf/Jack-Audio-For-Unity#15
#393
#275
#332
#380
#351
jamulussoftware/jamulus#93

It is actually completely untenable that a software causes a multitude of other applications to break so rampantly and with no connection obvious to the user. In my opinion, release should be nuked or only distributed with a visible warning.

@falkTX
Copy link
Member

falkTX commented Aug 11, 2020

I did not notice this was so serious, thanks for bring that up (again).
So JackRouter (the ASIO bridge) is a problem on Windows, I guess for the upcoming binary releases it will be better to not install/ship-with it.

I just removed the (old) macos and windows links from the jackaudio.org download page, so, thanks.

Updated binaries are coming later, I am on the final steps for setting up the CI/CD.

@siana
Copy link
Author

siana commented Aug 12, 2020

Let me know if i can help with anything at all! I'm thinking a NSIS installer can be built on Linux (though i never tried) so would NSIS script be a relevant task?

JackRouter is useful. I'll try to build the master and see whether the issue has potentially been resolved or whether i can fix it.

@falkTX
Copy link
Member

falkTX commented Aug 12, 2020

I have used InnoSetup for another project, which seems very simple and easy to follow, it does pretty much all that is needed without complications.
So I think I will go with those.

Regarding JackRouter, help is appreciated for sure. I dont even know how to build it, but @sletz will have some ideas :)

@gnif
Copy link

gnif commented Aug 19, 2020

NSIS is very simple, open-source, and builds on Linux. please use NSIS 👍

Here is an example we are using for the LookingGlass project which is used by a CI builder on a Linux system cross compiling for Windows.
https://github.com/gnif/LookingGlass/blob/master/host/platform/Windows/installer.nsi

@kmatheussen
Copy link
Contributor

Maybe I've misunderstand what's happening, but I thought you had to register the JackRouter ASIO driver for it to work? Maybe mixx doesn't crash if you run the following command?

regsvr32 /U "C:\Program Files (x86)\Jack v1.9.8\64bits\JackRouter.dll"

@falkTX
Copy link
Member

falkTX commented Sep 13, 2020

New builds now available. See https://github.com/jackaudio/jack2-releases/releases

Tested a bit with Carla in a VM, that works well.
image

Bitwig also works, Ardour has a few issues. Zrythm developer will be doing testing today.

@falkTX
Copy link
Member

falkTX commented Sep 13, 2020

@siana if you could please uninstall the previous jack version and install the one from https://github.com/jackaudio/jack2-releases/releases, that would be very appreciated.

qjackctl needs some tweaks so that it works better in windows, but at least we have things running now.

@kmatheussen
Copy link
Contributor

I've just gone through a long debug session with a guy where portaudio crashed. It would probably be good to ensure this patch is attached (or at least somehow manage to compile portaudio with NDEBUG):

--- a/src/hostapi/wdmks/pa_win_wdmks.c~    2020-09-12 03:23:02.000000000 +0200
+++ b/src/hostapi/wdmks/pa_win_wdmks.c    2020-09-13 12:03:40.279668210 +0200
@@ -1058,6 +1058,5 @@
     }

     PA_DEBUG(("FindStartConnectionFrom: returning NULL\n"));
-    assert(FALSE);
     return 0;
 }

Also see my report to the portaudio list:
https://listserv.cuit.columbia.edu/scripts/wa.exe?A2=PORTAUDIO;7120129e.2009B&S=a

@kmatheussen
Copy link
Contributor

Good work by the way. Finally.

@kmatheussen
Copy link
Contributor

s/attached/applied/

@falkTX
Copy link
Member

falkTX commented Sep 13, 2020

-DNDEBUG is set for these builds, so assertions like that are not triggered.
see https://github.com/DISTRHO/PawPaw/blob/master/setup/env.sh#L47

@kmatheussen
Copy link
Contributor

Good. Have you tested it? Does it still work if you insert "assert(0)" into the top of that function?

@falkTX
Copy link
Member

falkTX commented Sep 13, 2020

I did not test it, I do not know when that function is triggered. But the rule of assert being removed for builds with NDEBUG set tells me that it is not something to worry about.

@kmatheussen
Copy link
Contributor

Because I tried to add -DNDEBUG to CFLAGS, and it didn't work. I had to remove the assert() line.

@kmatheussen
Copy link
Contributor

That function should be triggered every time jack starts up if you compile portaudio with wdmks included in the "--with-winapi=" list. It is also triggered in qjackctl when you press the "Interface" combo box in Setup.

@falkTX
Copy link
Member

falkTX commented Sep 13, 2020

Tried where and how? you need to have some compiler optimizations enabled too I think.
also depends if the project accepts C/XXFLAGS.

Anyway, I saw no crashes regarding that.
This qjackctl is not able to show the list of audio devices on windows, was that working at some point?

@kmatheussen
Copy link
Contributor

Test it like this:

[kjetil@ttlush portaudio]$ diff -u src/hostapi/wdmks/pa_win_wdmks.c~ src/hostapi/wdmks/pa_win_wdmks.c
--- src/hostapi/wdmks/pa_win_wdmks.c~	2020-09-12 03:23:02.000000000 +0200
+++ src/hostapi/wdmks/pa_win_wdmks.c	2020-09-13 18:00:34.705336074 +0200
@@ -1047,6 +1047,9 @@
     unsigned i;
     const KSTOPOLOGY_CONNECTION* connections = (const KSTOPOLOGY_CONNECTION*)(filter->connections + 1);
     PA_DEBUG(("FindStartConnectionFrom: Startpin %u, Checking %u connections...\n", startPin, filter->connections->Count));
+
+    assert(0);
+    
     for (i = 0; i < filter->connections->Count; ++i)
     {
         const KSTOPOLOGY_CONNECTION* pConn = connections + i;

Anyway, I saw no crashes regarding that.

I don't see any crashes either (when using an unpatched portaudio library), but for one Radium user it crashes every time. Removing that assert call fixed it. Adding NDEBUG didn't make a difference, don't know why, didn't really investigate either, but I reported it to the portaudio list.

This qjackctl is not able to show the list of audio devices on windows, was that working at some point?

Yes, it's always been working as far as I know.

@falkTX
Copy link
Member

falkTX commented Sep 13, 2020

This qjackctl is not able to show the list of audio devices on windows, was that working at some point?

Yes, it's always been working as far as I know.

well, it does not on the current qjackctl build. let me check if portaudio got disabled somehow.

@kmatheussen
Copy link
Contributor

Also, this crash is not a single user problem. There are several hits when googling the crash. Both users of Python and Ardour have experienced crash because of that assertion in portaudio. It happens when probing soundcard interfaces.

@kmatheussen
Copy link
Contributor

Here's my build of qjackctl:
http://users.notam02.no/~kjetism/qjackctl.exe
It should display all interfaces.

@falkTX
Copy link
Member

falkTX commented Sep 13, 2020

Found the issue, there is a typo in configure.ac, leading to portaudio being disabled in the build.

I tried adding some prints around the function that you want to test the assertion on, but it seems it is never triggered. I guess this build does not have the wdmks driver..?
ASIO, DirectSound, MME and WASAPI are there, should be enough of audio frameworks no? (and then people complain linux audio has too many of them lol)

Going to add -X winmme by default too, so we get the MIDI bridge.

@kmatheussen
Copy link
Contributor

wdmks is supposed to be a very efficient driver type, but I don't really know. I just use ASIO and WASPI. Could be people who rely on it though, I don't know.

@kmatheussen
Copy link
Contributor

Yes, I guess the portaudio build doesn't have wdmks driver. Again, don't know if it's needed.

@3Rton
Copy link

3Rton commented Oct 1, 2020

I did not notice this was so serious, thanks for bring that up (again).
So JackRouter (the ASIO bridge) is a problem on Windows, I guess for the upcoming binary releases it will be better to not install/ship-with it.

I just removed the (old) macos and windows links from the jackaudio.org download page, so, thanks.

Updated binaries are coming later, I am on the final steps for setting up the CI/CD.

How is one supposed to install jack on win10 and use it now without the router? The installer from jack2 releases doesn't come with the router and I have no clue how to set up audio now. (Most guides including the one on Jacks website start with setting up the router via command line)
Opening the GUI tool I can get the server to start with following Interface options: default and ASIO UMC 404
However in neither I seem to be able to do anything. Is there anyone who has written a guide for installing on windows 10 post jackrouter removal and the 32-bit and 64-bit folders not being included in the installer anymore??

@falkTX
Copy link
Member

falkTX commented Oct 1, 2020

You can use JACK by itself, with JACK-aware applications.

The list of that is not extensive for Windows, but we got at least:

  • Ardour / Mixbus
  • Bitwig Studio
  • Carla (Plugin Host) [so basically any lv2, vst2, vst3 plugin as jack client is possible]
  • PureData
  • Radium
  • Zrythm

@3Rton
Copy link

3Rton commented Oct 1, 2020

Haa, I was going to use JACK to route audio for OBS recording but I guess with the jackrouter gone for now that isn't possible use case anymore. Is it still in the plans to include the router one day on windows side?

As for the general setup Audacity is listed in the Jack aware apps page in the main website but it links to dead link for how to set it up. LMMS is also listed. But LMMS side native jack seems to only work on Linux (in their audio settings documentation Jack is listed as linux only while SDL and PortAudio are listed for Win) Though even then I think I'm doing something wrong. When I select my ASIO UMC 404 as my interface and start the server I get 4 system inputs and outputs but they don't seem to actually be anything but placeholders without being connected to any of my actual devices.
I don't suppose it will be on the priority list in near future either if the maintainer changed relatively recently but having some kind of updated windows set up guide would be nice. Trying to set this up has been pretty frustrating experience, even if it is mostly my own fault.

@falkTX
Copy link
Member

falkTX commented Oct 1, 2020

noted. there are some resources out there already regarding setting up jack on windows, but a bit too spread out.
But the release is needed first, so everyone sees that jack is still being worked on and has plans for the future, this should help a few more applications giving support for it.
In the case of Audacity and LMMS, it should be pretty simple for them to enable jack support on windows.

two good entry points for reading already:
https://libremusicproduction.com/articles/demystifying-jack-%E2%80%93-beginners-guide-getting-started-jack
https://ccrma.stanford.edu/docs/common/JACK.html

@kmatheussen
Copy link
Contributor

kmatheussen commented Oct 7, 2020 via email

@falkTX
Copy link
Member

falkTX commented Oct 16, 2020

1.9.15 release no longer includes jack-router, so this issue can no longer happen (for new installs).

thanks a lot for the report, it was the kicker to get jack-router out of jack2 codebase, we needed that.

@falkTX falkTX closed this as completed Oct 16, 2020
@marijncin
Copy link

Let me know if i can help with anything at all! I'm thinking a NSIS installer can be built on Linux (though i never tried) so would NSIS script be a relevant task?

JackRouter is useful. I'll try to build the master and see whether the issue has potentially been resolved or whether i can fix it.

Hi, I am facing the exact same problem, but with MaxMSP.
Did you manage to get a working version of jackRouter that does nog crash other applications?

Greetings, Marijn

@dyfer
Copy link

dyfer commented Mar 8, 2021

@marijncin the 1.9.17 release includes JackRouter and AFAIU has this problem resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants