falkTX / Carla

Audio plugin host
https://kx.studio/carla
1.55k stars 144 forks source link

Carla seemingly no longer functions with --no-gui #1828

Open milochristiansen opened 8 months ago

milochristiansen commented 8 months ago

Since a recent update (I am currently on Manjaro using Carla 2.5.7), my previous audio setup has been totally broken due to Carla not functioning properly. I have been using the following custom systemd service:

[Unit]
Description=Carla Headless
Requires=pipewire.service wireplumber.service
After=wireplumber.service pipewire.service

[Service]
ExecStart=/usr/bin/carla --no-gui /home/milo/Default.carxp

[Install]
WantedBy=default.target

This simply starts Carla headless with a previous configuration, and has served me well for months.

However, recently my audio simply doesn't work. There are no errors or log messages, systemd reports the service is up and healthy, but no audio until I start Carla manually.

Today, I attempted to start Carla manually with the exact command the service uses, and got this:

# ~/ > carla --no-gui /home/milo/Default.carxp
libjack.so.0 loaded successfully!
[carla] Carla assertion failure: "newFrames > 0" in file CarlaEngineInternal.cpp, line 260
[carla] Carla assertion failure: "newFrames > 0" in file CarlaEngineInternal.cpp, line 260
[carla] Will use LV2 X11 UI for 'LSP Parametric Equalizer x16 Stereo'
[carla] Previously saved client 'Scarlett Solo (3rd Gen.) Direct Scarlett Solo USB' not found
[carla] Previously saved client 'LSP Parametric Equalizer x16 Stereo' not found

Carla could not be killed without resorting to -9, and there was no audio.

Executing the same command without --no-gui worked flawlessly:

# ~/ > carla /home/milo/Default.carxp
Carla 2.5.7 started, status:
  Python version: 3.11.5
  Qt version:     5.15.8
  PyQt version:   5.15.9
  Binary dir:     /usr/lib/carla
  Resources dir:  /usr/share/carla/resources
Frontend pixel ratio is 1.0
libjack.so.0 loaded successfully!
[carla] Carla assertion failure: "newFrames > 0" in file CarlaEngineInternal.cpp, line 260
falkTX commented 8 months ago

the assertion seems suspicious, so we can investigate what is going on there. It points to https://github.com/falkTX/Carla/blob/hotfix-2.5/source/backend/engine/CarlaEngineInternal.cpp#L260 which comes from https://github.com/falkTX/Carla/blob/hotfix-2.5/source/backend/engine/CarlaEngineJack.cpp#L3125

which is a regular callback from JACK regarding tempo changes.

so assuming this assert is relevant, either:

  1. some new tool you installed or updated now sends invalid tempo information
  2. JACK stuff has changed

I tend to assume pipewire related changes cause these things to happen, and it is often true. Unless you can reproduce the issue with jack2 (or jack1 if you prefer that), the issue is not on Carla side and to be considered invalid.

milochristiansen commented 8 months ago

Nothing has changed in the audio pipeline since the last time it worked prior to the Carla update that caused the failure to start properly with --no-gui. There was a pipewire update prior to that, but audio continued to work after that update until Carla also updated.

Also, keep in mind that the assertion fail is in both working and non-working examples, so it is unlikely to be the actual issue.

systemofapwne commented 8 months ago

I can confirm this issue: Same OS, same Carla version. Happened after full-system upgrade recently. Starting with GUI always works but headless fails repetitively (but not always! Sometimes, running carla headless works). The assertion however is always present in (headless or GUI) and even when carla at some point works in headless.

Here you see, how I started carla several times and sometimes (like 1 of every 5 or more tries) it actually starts properly. Also nevermind the SIGKILL. That was me using killall -9 carla for debugging purposes.

klaus@aurora ~ $ carla --no-gui ~/git/linux/audio/aurora.carxp
libjack.so.0 loaded successfully!
[carla] Carla assertion failure: "newFrames > 0" in file CarlaEngineInternal.cpp, line 260
[carla] Will use UI-Bridge for 'Gate', binary: "/usr/lib/carla/carla-bridge-lv2-gtk2"
[carla] Will use UI-Bridge for 'Equalizer', binary: "/usr/lib/carla/carla-bridge-lv2-gtk2"
[carla] Will use UI-Bridge for 'Compressor', binary: "/usr/lib/carla/carla-bridge-lv2-gtk2"
[carla] Carla assertion failure: "newFrames > 0" in file CarlaEngineInternal.cpp, line 260
[carla] lv2_rdf_new("https://github.com/lucianodato/noise-repellent#new") - got unknown port designation 'http://lv2plug.in/ns/lv2core#threshold'
[carla] lv2_rdf_new("https://github.com/lucianodato/noise-repellent#new") - got unknown port designation 'http://lv2plug.in/ns/lv2core#gain'
Saved Noise Repellent Profile Size <1105>
fish: Job 1, 'carla --no-gui ~/git/linux/audi…' terminated by signal SIGKILL (Erzwungene Beendigung)
klaus@aurora ~ [SIGKILL] $ carla --no-gui ~/git/linux/audio/aurora.carxp
libjack.so.0 loaded successfully!
[carla] Carla assertion failure: "newFrames > 0" in file CarlaEngineInternal.cpp, line 260
[carla] Will use UI-Bridge for 'Gate', binary: "/usr/lib/carla/carla-bridge-lv2-gtk2"
[carla] Will use UI-Bridge for 'Equalizer', binary: "/usr/lib/carla/carla-bridge-lv2-gtk2"
[carla] Will use UI-Bridge for 'Compressor', binary: "/usr/lib/carla/carla-bridge-lv2-gtk2"
[carla] Carla assertion failure: "newFrames > 0" in file CarlaEngineInternal.cpp, line 260
[carla] lv2_rdf_new("https://github.com/lucianodato/noise-repellent#new") - got unknown port designation 'http://lv2plug.in/ns/lv2core#threshold'
[carla] lv2_rdf_new("https://github.com/lucianodato/noise-repellent#new") - got unknown port designation 'http://lv2plug.in/ns/lv2core#gain'
Saved Noise Repellent Profile Size <1105>
[carla] Previously saved client 'Gate' not found
[carla] Previously saved client 'Equalizer' not found
[carla] Previously saved client 'Compressor' not found
[carla] Previously saved client 'Mic Gain' not found
[carla] Previously saved client 'Noise repellent' not found
[carla] Previously saved client 'Mic Gain (2)' not found
Carla ready!
fish: Job 1, 'carla --no-gui ~/git/linux/audi…' terminated by signal SIGKILL (Erzwungene Beendigung)
klaus@aurora ~ [SIGKILL] $ carla --no-gui ~/git/linux/audio/aurora.carxp
libjack.so.0 loaded successfully!
[carla] Will use UI-Bridge for 'Gate', binary: "/usr/lib/carla/carla-bridge-lv2-gtk2"
[carla] Carla assertion failure: "newFrames > 0" in file CarlaEngineInternal.cpp, line 260
[carla] Will use UI-Bridge for 'Equalizer', binary: "/usr/lib/carla/carla-bridge-lv2-gtk2"
[carla] Will use UI-Bridge for 'Compressor', binary: "/usr/lib/carla/carla-bridge-lv2-gtk2"
[carla] lv2_rdf_new("https://github.com/lucianodato/noise-repellent#new") - got unknown port designation 'http://lv2plug.in/ns/lv2core#threshold'
[carla] lv2_rdf_new("https://github.com/lucianodato/noise-repellent#new") - got unknown port designation 'http://lv2plug.in/ns/lv2core#gain'
Saved Noise Repellent Profile Size <1105>
fish: Job 1, 'carla --no-gui ~/git/linux/audi…' terminated by signal SIGKILL (Erzwungene Beendigung)
falkTX commented 8 months ago

maybe it depends on the project? there could be memory corruption issues with a certain plugin in there.

systemofapwne commented 8 months ago

I think, you might be up on something here. I just created an empty project, that seems to always start. Let me strip down my main audio project to tackle down the root cause.

systemofapwne commented 8 months ago

I was sort of able to, well, narrow it down: Once a plugin is loaded, carla fails in no-gui mode.

I created an empty project:

Attached: My zipped empty.carxp file empty.zip

systemofapwne commented 7 months ago

After recently upgrading my rolling release distro, carla seems to function again as before. I did not update carla though. I honestly do not know, what the cause was, but at least for me, everything seems to work as before. I guess, it had to do with some external dependencies.

systemofapwne commented 7 months ago

@milochristiansen Did the issue disappear for you too after updating your manjaro to the recent state?

milochristiansen commented 7 months ago

Dunno, I have been manually starting Carla and I'm probably not going back to headless since the remote control application is flaky and even when it does work it doesn't allow you to save changes.

systemofapwne commented 7 months ago

Dunno, I have been manually starting Carla and I'm probably not going back to headless since the remote control application is flaky and even when it does work it doesn't allow you to save changes.

Can you give it at least a try and close this issue, if --no-gui is fixed for you with the recent Manjaro update(s)? Because for me, it definitely is.

milochristiansen commented 7 months ago

image

Closing the running Carla instance and running headless results in no sound, killing the headless instance and starting it normally however:

image

Works great. Last system update was yesterday.

systemofapwne commented 7 months ago

Ok, so the issue persisist for you. That is quite frustrating. However it seems, that carla now gets up to the "Carly ready!" state.

For me, when running headless, it was not even reaching this state and hang. After latest system update, it got to that state and worked.