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

Add Carla support for Windows #5713

Merged
merged 4 commits into from
Oct 29, 2020
Merged

Add Carla support for Windows #5713

merged 4 commits into from
Oct 29, 2020

Conversation

tresf
Copy link
Member

@tresf tresf commented Oct 15, 2020

Closes #4654

This PR should be safe for backport to 1.2.x if needed.

What the PR does:

  • Renames libcarla_native-plugin.dll to carla.dll to match that of the Windows release
  • Fixes a PATH conflict preventing Carla from finding PyQt

Steps to use Carla with LMMS:

  • Install a version of LMMS with Carla support (click here if the download bot below doesn't have one)
  • Download Carla for windows
  • Extract Carla to a permanent location
  • Add Carla.lv2 to your PATH environment variable (e.g. C:\Carla_2.2.0-win64\Carla.lv2)
  • Start LMMS

Known issues:

  • Removing a Carla track may cause LMMS to segfault
  • On slow machines, Carla may not load the first time and "Show GUI" may need to be clicked again

Screen Shot 2020-10-15 at 4 31 52 PM

@tresf tresf added the windows label Oct 15, 2020
@LmmsBot
Copy link

LmmsBot commented Oct 15, 2020

🤖 Hey, I'm @LmmsBot from github.com/lmms/bot and I made downloads for this pull request, click me to make them magically appear! 🎩

Linux

Windows

macOS

🤖
{"platform_name_to_artifacts": {"Linux": [{"artifact": {"title": {"title": "(AppImage)", "platform_name": "Linux"}, "link": {"link": "https://9490-15778896-gh.circle-artifacts.com/0/lmms-1.2.3-734%2Bgcf4fd59-linux-x86_64.AppImage"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/9490?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}], "Windows": [{"artifact": {"title": {"title": "32-bit", "platform_name": "Windows"}, "link": {"link": "https://9492-15778896-gh.circle-artifacts.com/0/lmms-1.2.3-734%2Bgcf4fd599b-mingw-win32.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/9492?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://9494-15778896-gh.circle-artifacts.com/0/lmms-1.2.3-734%2Bgcf4fd599b-mingw-win64.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/9494?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}, {"artifact": {"title": {"title": "32-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/96ce805xn32h0stw/artifacts/build/lmms-1.2.2-msvc2017-win32.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/35779079"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/k7a19v4o7a4bppov/artifacts/build/lmms-1.2.2-msvc2017-win64.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/35779079"}], "macOS": [{"artifact": {"title": {"title": "", "platform_name": "macOS"}, "link": {"link": "https://9493-15778896-gh.circle-artifacts.com/0/lmms-1.2.3-734%2Bgcf4fd599b-mac10.13.dmg"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/9493?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}]}, "commit_sha": "2f7b60806d4a0463ace04c2cddcf547ef35bd138"}

plugins/carlabase/carla.cpp Outdated Show resolved Hide resolved
@PhysSong
Copy link
Member

Removing a Carla track may cause LMMS to segfault

Reproduced with Carla 2.2 and MSVC build of LMMS. It seems like Carla crashed in CarlaEngine::ProtectedData::deletePluginsAsNeeded() which is indirectly called from CarlaInstrument::timerEvent(). Inspecting memory and registers suggests there might be some use after free conditions.
2.1.1 Also crashes in CarlaBackend::CarlaEngineNative::uiIdle(), but less frequently.

@PhysSong
Copy link
Member

I found that it's related to the (improperly implemented) InstrumentTrackWindow caching which causes a temporary CarlaInstrumentView to be instantiated after the existing one is deleted. That will be deleted after CarlaInstrument, and timer events may kick in between those two events. That results in CarlaInstrumentView::timerEvent() using a deleted handle.

@tresf
Copy link
Member Author

tresf commented Oct 20, 2020

I found that it's related to the (improperly implemented) InstrumentTrackWindow caching which causes a temporary CarlaInstrumentView to be instantiated after the existing one is deleted. That will be deleted after CarlaInstrument, and timer events may kick in between those two events. That results in CarlaInstrumentView::timerEvent() using a deleted handle.

@PhysSong would you like to wait to merge this PR until the bug is resolved, or merge and open a new issue?

@tresf
Copy link
Member Author

tresf commented Oct 29, 2020

@PhysSong would you like to wait to merge this PR until the bug is resolved, or merge and open a new issue?

Merging. I'll open a new issue for the crash.

@ghost
Copy link

ghost commented Jan 13, 2024

Apologies for this random comment on a now merged PR. If I can correctly recall, Carla's Installation path should be added in the System variables or User Variables?
u3mCv1m86p

@tresf
Copy link
Member Author

tresf commented Jan 14, 2024

Apologies for this random comment on a now merged PR. If I can correctly recall, Carla's Installation path should be added in the System variables or User Variables?

Windows adds both to the search PATH. Either will work.

@ghost
Copy link

ghost commented Jan 14, 2024

Apologies for this random comment on a now merged PR. If I can correctly recall, Carla's Installation path should be added in the System variables or User Variables?

Windows adds both to the search PATH. Either will work.

Gotcha, I put Carla's path under the System Variables and it worked fine. Its been a long while since I made any form of music that I have forgotten where to put the things.

Thank you so much.

@FadhilKwan
Copy link

Greetings everyone. I'm really sorry for asking this, but.... I've tried to make Carla work on LMMS in Windows, and still I couldn't get it to work (nothing showed up in my LMMS's 'Instrument' list).

From what I can understand from this thread, I just have to extract Carla to a filepath (as in any filepath), and add a filepath to that Carla's main folder (the folder with 4 versions of it; Vst, Lv2, etc.) into Windows' PATH, is that correct?
Or, is there any step that I'm missing or I did wrong, like using the wrong version of Carla and/or LMMS, or something else? Which if so, a proper step-by-step guide would be nice, if possible. (oh, and I'm using the newest nightly version as well.)

Again, I'm really sorry for the trouble, and thanks alot in advance~ ._.v

@tresf
Copy link
Member Author

tresf commented Feb 24, 2024

I think it broke per: #6726.

In short, this means you'd have to be on an unstable build for it to work (or on much older version of Carla).

@FadhilKwan
Copy link

Hmmmm, okay, I think I get the gist of it....? (and thanks alot for replying! :D)

So.... by unstable build, did you mean the most recent LMMS Nightly version (which I'm using rn; 1.3.0-alpha+g360254fd8), or is this one meant for Carla?

As for older version of Carla, unfortunately last time I checked Carla's releases on github, the oldest windows zip available are version 2.5.5., which I'm guessing is probably not old enough.
Oh, and I've tested that version just now (extracted the zip and adding its PATH into Environment Variables), it didn't work.... ._.;

@tresf
Copy link
Member Author

tresf commented Feb 24, 2024

As for older version of Carla, unfortunately last time I checked Carla's releases on github, the oldest windows zip available are version 2.5.5., which I'm guessing is probably not old enough.

That was my initial observation as well until I checked archive.org to dates closer to writing this feature... and it appears Carla for Windows goes back to at least version 2.0.0. It just so happens that you have to navigate back to find them.

@tresf
Copy link
Member Author

tresf commented Feb 24, 2024

So.... by unstable build, did you mean the most recent LMMS Nightly version (which I'm using rn; 1.3.0-alpha+g360254fd8), or is this one meant for Carla?

Yes, I think so (the nightly) since the "alpha" download listed on the downloads page would be too old for that patch to make it in.

@tresf
Copy link
Member Author

tresf commented Feb 24, 2024

Linking a relevant conversation from the last time I tried this... #5984 (comment)

@FadhilKwan
Copy link

and it appears Carla for Windows goes back to at least version 2.0.0. It just so happens that you have to navigate back to find them.

Yes, found it! Thanks for letting me know that one. 👍
Turns out not all older versions are gone from Carla's releases page (even the recent one). As you just mentioned, 2.0.0 and the likes of it still have their win zip files intact, and I got hold of some of them.
Unfortunately the initial simple PATH test on them didn't seem to do anything. I could try something else (including the SYMLINK thing you mentioned), but my best bet for now is probably to just wait for this issue to sort out eventually. At least I finally got some vsts that I can play with :).

Someone also mentioned something about using KushView's 'Element' as a workaround. But I'll just turn to LMMS forums for that one since that's where I got that info in the first place (also it doesn't quite fit in here I think....). I did make a post there, though still waiting for any responses.

Thank you so much for your assistance btw! Sure things didn't work out very well, but still really glad that I finally got some answers. Hopefully this issue can be resolved one day~ :D

@tresf
Copy link
Member Author

tresf commented Feb 25, 2024

and it appears Carla for Windows goes back to at least version 2.0.0. It just so happens that you have to navigate back to find them.

Yes, found it! Thanks for letting me know that one. 👍 Turns out not all older versions are gone from Carla's releases page (even the recent one). As you just mentioned, 2.0.0 and the likes of it still have their win zip files intact, and I got hold of some of them. Unfortunately the initial simple PATH test on them didn't seem to do anything. I could try something else (including the SYMLINK thing you mentioned), but my best bet for now is probably to just wait for this issue to sort out eventually. At least I finally got some vsts that I can play with :).

Someone also mentioned something about using KushView's 'Element' as a workaround. But I'll just turn to LMMS forums for that one since that's where I got that info in the first place (also it doesn't quite fit in here I think....). I did make a post there, though still waiting for any responses.

Thank you so much for your assistance btw! Sure things didn't work out very well, but still really glad that I finally got some answers. Hopefully this issue can be resolved one day~ :D

Hmm... weird. I would expect it to work just fine. I'll try in a VM real quick and see what happens.

@tresf
Copy link
Member Author

tresf commented Feb 25, 2024

Steps:

  1. Install LMMS nightly 64-bit from https://lmms.io/download
  2. Download and extract Carla 2.5.8 64-bit from https://kx.studio/Applications:Carla
    • Extracted to C:\Carla-2.5.8-win64
  3. Add an environmental variable to PATH for C:\Carla-2.5.8-win64\Carla
  4. Start LMMS
  5. Drag Carla into LMMS
  6. Click "Allow" on Firewall Prompt
  7. Carla is working
image

@FadhilKwan
Copy link

Oh wait, You managed to get it to work? That's awesome! :D
Okay I'm giving that one a shot as well.

One small question though, how do I do this part?

5. Drag Carla into LMMS

Because I tried to drag the Carla folder and the Carla.exe into LMMS's window. But it wont let me. It kept giving me the No sign (the 'No Entry' thing)

@tresf
Copy link
Member Author

tresf commented Feb 25, 2024

Oh wait, You managed to get it to work? That's awesome! :D Okay I'm giving that one a shot as well.

One small question though, how do I do this part?

  1. Drag Carla into LMMS

Because I tried to drag the Carla folder and the Carla.exe into LMMS's window. But it wont let me. It kept giving me the No sign (the 'No Entry' thing)

Sorry, open the plugins sidebar in LMMS, drag in the Carla Patchbay or Carla Plugin Host into an empty area in the LMMS Song Editor.

@FadhilKwan
Copy link

FadhilKwan commented Feb 26, 2024

Sorry, open the plugins sidebar in LMMS, drag in the Carla Patchbay or Carla Plugin Host into an empty area in the LMMS Song Editor.

Okay, got it. Sorry, I thought I had to add Carla like a some sort of wrapper or something. That was my fault for not taking a closer look at the pic.

I'm pretty sure I've tried that before and it didn't work. But just to not second guess myself, I decided to start over (uninstall LMMS) and follow your steps one-to-one.
And sure enough it still won't work. Strange.... ><;
(I tried running LMMS as an admin, and,,,,, it didn't do anything different either. Using different versions of Carla also didn't work)

But at the very least I know that it Should've worked in the first place. It's just that my PC somehow keeps running into a weird issue, yet I still can't figure out what is it or why.... (Idk, I've been reinstalling LMMS tens of times at this point, I'm pretty much losing my mind rn).

I also see that you're using Win11 on your VM. I'm using Windows 10, I wonder if that matters by any chance.....
welp, very unlikely, I think....

edit:
I could try reinstalling my Windows, but to me that seems like an extremely overwhelming task, considering that I have so much stuff in my PC right now. So I'd only consider it as a last ditch effort....

@tresf
Copy link
Member Author

tresf commented Feb 29, 2024

LMMS shouldn't really need to be "reinstalled". Besides the file associations (e.g. .mmpz) installing just copies the files to C:\Program Files\LMMS so reinstalling shouldn't really affect much. (There is a file .lmmsrc that can affect stuff, but that shouldn't have any impact on Carla specifically -- and it's not cleaned up on uninstall, so that would be a manual effort anyway)

  • I do not believe that reinstalling Windows will help.
  • The steps provided will also work on Windows 10

When you say "does not work", can you be more specific? For example, is Carla missing completely from the plugins section? If not, when you drag it in, what happens? You may have to click the "Show GUI" button for it to appear.

@FadhilKwan
Copy link

FadhilKwan commented Feb 29, 2024

LMMS shouldn't really need to be "reinstalled". Besides the file associations (e.g. .mmpz) installing just copies the files to C:\Program Files\LMMS so reinstalling shouldn't really affect much.

Yes, that is true. But the reason I had to is because I'm normally storing my LMMS in D: drive. And with how specific some of the steps and methods I found, I thought that was the major factor of the issue. So I just kept installing in C: and D: back and forth, trying to find out if that mattered or not. (and the same with Carla, copying the folder to C: or D: and assigning its PATH accordingly)
And from what I can tell, it didn't really affect anything, especially since I've tested the steps you showed as well.

  • The steps provided will also work on Windows 10

'aight, that's good to know. Seems there's still a chance~ :)

  • I do not believe that reinstalling Windows will help.

A part of me thinks the same too, but the fact that it worked instantly on a newly installed Windows, makes me wondering if there are some underlying issues that I just couldn't figure out at all, so it might be worth a try,
Although I'm not gonna do it anytime soon since I don't have the adequate amount of backup drive(s) yet. -_-;

When you say "does not work", can you be more specific? For example, is Carla missing completely from the plugins section? If not, when you drag it in, what happens? You may have to click the "Show GUI" button for it to appear.

Yea it's the former. Carla is just... not there, none of them. Couldn't be found in the plugins section at all...

So.... this .lmmsrc.xml file, does it affect the LMMS's ability to search for Carla, or is it solely done from within LMMS directly (with the help of PATH of course)?

edit:
btw in case this does work, it should work immediately, right? and I don't have to reboot my PC?

@tresf
Copy link
Member Author

tresf commented Feb 29, 2024

So.... this .lmmsrc.xml file, does it affect the LMMS's ability to search for Carla, or is it solely done from within LMMS directly (with the help of PATH of course)?

Currently Carla isn't a configured path. There is a good argument to change this, but for now, it's not affected by the settings file.

it should work immediately, right? and I don't have to reboot my PC?

Right, no reboot needed. You'll only need to restart LMMS if it's open. If you want, feel free to jump on Discord and PM me. Maybe there's something one of us is missing. https://lmms.io/chat. My name there is the same as it is here.

@FadhilKwan
Copy link

FadhilKwan commented Feb 29, 2024

I, Got, It!!! (And it was a doozy).
carlaworked

So after reading your explanations regarding the PATH shenans, I suspected that for some reason (that I cannot understand), my Windows just couldn't reach Carla's PATH from within the list, and it might need to be "spoonfed" this PATH variable manually.

So I looked up a way to make a batch file that does these, in order:

  1. create this PATH variable to Carla first, and
  2. run LMMS only after doing so.

I went ahead, searched some tutorials on adding PATH variables into .bat, reused my existing .bat file that has the program run command. And after I'm done, It looks like this:

cd "%~dp0\"

SETLOCAL 
IF EXIST "D:\Program Files\Carla-2.5.8-win64\Carla" SET "PATH=%PATH%;D:\Program Files\Carla-2.5.8-win64\Carla"

start "" "%~dp0\lmms_program\lmms.exe"

pause

(yes, I've installed my LMMS back into D: drive. I made 2 separate folders in this case, one for the program files itself; originally called 'LMMS', and another folder for working directory)

While it is not the most sophiticated code, it sure did the job extremely well. As I started LMMS, two Carla plugins popped up on the side bar, and I almost went nuts! xD

Upon further tests, everything seemed to work fine, mostly.
I can add them, opened the plugin, play with the piano thing (not the piano roll). BUT, loading any plugin in Carla freezes it..... (and I've double checked, the plugins can be loaded into Carla's standalone version)
Welp, seems that I'm not quite out of the water just yet. But that's one issue down at least :)

edit:
editing my .bat code a little bit as it is relevant for later.

@FadhilKwan
Copy link

FadhilKwan commented Feb 29, 2024

Update on the "plugin frezzes Carla" thing (in case this doesn't fit this thread, I'll stop asking about it afterwards).

I edited the .bat a little bit, adding a 'pause' at the end so it won't close immediately after executing the PATH stuff, and it might help me identify what's going on with Carla-LMMS.

And it seemed to work. I loaded a plugin after managed to pause my .bat. And I got this while it is loading the plugin:
carlanotworked

Though, I still don't understand if this actually tells anything, so please, I'd like to know if there's something that I can try for this one~

edit:
just found out, closing Carla-LMMS while it freezes makes the .bat print this red lines endlessly
carlanotworked2
....oops.... ._.;

@tresf
Copy link
Member Author

tresf commented Feb 29, 2024

create this PATH variable to Carla first, and

This suggests that you did not properly set PATH in the environmental settings from the previous steps. Did you click "OK" and close that dialog between tests?

With regards to Carla not working properly, that may be true. I haven't actually tested it recently... Let me see if I can get a VST2 working.

@tresf
Copy link
Member Author

tresf commented Feb 29, 2024

Tested a VST2, seems to work OK.

image

@FadhilKwan
Copy link

This suggests that you did not properly set PATH in the environmental settings from the previous steps. Did you click "OK" and close that dialog between tests?

Yeah, that's the thing. I've been doing that, and making sure to do so between tests. Set the PATH; click OK; then OK again to apply changes and close 'Environment Variables' window, and that should be enough.

I even tried that again just now, because I second guessed myself. Set Carla's PATH; click OK; close all dialog and windows leading to the Environment Variables properly (including 'Advanced System Settings' window). And it did nothing (I swear, my PC is really something else ><)

As for Carla's plugins, can confirm as well that VST2 still works. Does LV2 and VST3 also work?
(though I'm pretty sure VST3 doesn't. Those were the plugin that I tested first.... I'm sorry about that . .)

@tresf
Copy link
Member Author

tresf commented Feb 29, 2024

I'd expect both LV2 and VST3 to work. I can't say I've tested either though. 🍻

@tresf
Copy link
Member Author

tresf commented Feb 29, 2024

Set the PATH; click OK; then OK again

That's odd. By chance are you telling the computer to run LMMS as another user? When you set PATH are you doing it in the USER section or the SYSTEM section? (Both should work, just curious)

@FadhilKwan
Copy link

FadhilKwan commented Mar 1, 2024

That's odd. By chance are you telling the computer to run LMMS as another user? When you set PATH are you doing it in the USER section or the SYSTEM section? (Both should work, just curious)

Had to double-check that one as well. And yeah, adding it into USER variables didn't work either.....
edit: User wise, there's only one user, and it's the one I'm using right now.

I'd expect both LV2 and VST3 to work. I can't say I've tested either though. 🍻

I still have not gotten my hand on an LV2 plugin to test that yet, but on my end VST3 just freezes Carla (I tested that with Camomile and chowdsp's 'ChowMultiTool', as they're the only ones that I have rn)

@ghost
Copy link

ghost commented Mar 7, 2024

Based on what I am reading here. I can install LMMS freely somewhere else or am I understanding this completely wrong?

@tresf
Copy link
Member Author

tresf commented Mar 8, 2024

Based on what I am reading here. I can install LMMS freely somewhere else or am I understanding this completely wrong?

LMMS doesn't take up that much space, but yes, you may install it wherever you like.

@ghost
Copy link

ghost commented Mar 8, 2024

Based on what I am reading here. I can install LMMS freely somewhere else or am I understanding this completely wrong?

LMMS doesn't take up that much space, but yes, you may install it wherever you like.

I have tried this before, with plugins on the same page but somehow it did not pick up my plugins? I guess I was dumb not pointing LMMS to the same drive letter it is on?

@tresf
Copy link
Member Author

tresf commented Mar 12, 2024

Based on what I am reading here. I can install LMMS freely somewhere else or am I understanding this completely wrong?

LMMS doesn't take up that much space, but yes, you may install it wherever you like.

I have tried this before, with plugins on the same page but somehow it did not pick up my plugins? I guess I was dumb not pointing LMMS to the same drive letter it is on?

The plugins folders for LMMS can be adjusted to whichever drive letter you want after install. It's your choice and any configuration should work. Note that Carla on MacOS is a bit different and it is expected to be installed on the same drive as LMMS, but since this conversation is about Windows, I think you'll be fine regardless of where you choose to install.

@ghost
Copy link

ghost commented Mar 13, 2024

Based on what I am reading here. I can install LMMS freely somewhere else or am I understanding this completely wrong?

LMMS doesn't take up that much space, but yes, you may install it wherever you like.

I have tried this before, with plugins on the same page but somehow it did not pick up my plugins? I guess I was dumb not pointing LMMS to the same drive letter it is on?

The plugins folders for LMMS can be adjusted to whichever drive letter you want after install. It's your choice and any configuration should work. Note that Carla on MacOS is a bit different and it is expected to be installed on the same drive as LMMS, but since this conversation is about Windows, I think you'll be fine regardless of where you choose to install.

Awesome, allow me to try and if I run into any issues, I will open a seperate issue for it. Currently mainly using the Alpha 1 of 1.3.0 as I could not get Carla picked up in the latest Nightly.

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

Successfully merging this pull request may close these issues.

Add Carla support for windows
5 participants