NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.19k stars 14.2k forks source link

Krita: No LADSPA plugins were found! #306410

Closed callyral closed 4 months ago

callyral commented 6 months ago

Describe the bug

Krita crashes when selecting an audio file for an animation. It's something to do with LADSPA plugins and MLT.

Relevant part of the error output (running Krita with terminal, mp3 file):

No LADSPA plugins were found!

Check your LADSPA_PATH environment variable.
SAFE ASSERT (krita): "qEnvironmentVariableIsSet("MLT_REPOSITORY")" in file /build/krita-5.2.2/libs/ui/KisPlaybackEngineMLT.cpp, line 363
SAFE ASSERT (krita): "qEnvironmentVariableIsSet("MLT_PROFILES_PATH")" in file /build/krita-5.2.2/libs/ui/KisPlaybackEngineMLT.cpp, line 364
SAFE ASSERT (krita): "qEnvironmentVariableIsSet("MLT_PRESETS_PATH")" in file /build/krita-5.2.2/libs/ui/KisPlaybackEngineMLT.cpp, line 365

Steps To Reproduce

Steps to reproduce the behavior:

  1. Install Krita
  2. Run krita using the terminal (so you can see the console output)
  3. Create a new image (Control+N)
  4. Choose the animation workspace after image creation
  5. Choose an audio file (I tested MP3, OPUS and WAV too)
  6. After the 5th step, Krita will freeze for a second and crash.

Expected behavior

To be able to use audio in Krita by installing a krita-ladspa package, or having it come with the krita package.

Additional context

I don't think this issue's a Krita bug, as I'm fairly sure this doesn't happen on other Linux distributions.

Notify maintainers

Mantainers of the krita package: @abbradar @sifmelcara @nek0

Metadata

 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.27, NixOS, 24.05 (Uakari), 24.05.20240416.66adc1e`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.2`
 - channels(root): `"home-manager, nixos"`
 - nixpkgs: `/nix/store/6bf943g0mlhymyffs9dflzgc78r93s60-source`

Add a :+1: reaction to issues you find important.

callyral commented 5 months ago

Could this be solved by installing a package, or is it an issue with how Krita is compiled?

sifmelcara commented 5 months ago

Probably not a krita issue as the "No LADSPA plugins were found!" message is not originated from krita codebase, I will try take a look at this

sifmelcara commented 4 months ago

I don't think this issue's a Krita bug, as I'm fairly sure this doesn't happen on other Linux distributions.

Do you know which distribution build krita from source and have audio working? It looks like Arch Linux also have this issue https://krita-artists.org/t/krita-audio-crash-falling-back-to-audio-less-playback/80583

There seems to be 2 issues

  1. mlt framework assumes ladspa will be available under /usr/local/lib/ladspa:/usr/lib/ladspa:/usr/lib64/ladspa https://github.com/mltframework/mlt/blob/49fcfd398dae1407cab62c04d4d9e8b950c6712d/src/modules/jackrack/plugin_mgr.c#L247 when env variable is not set, nix should probably patch this, otherwise all downstream dependency will need extra env var
  2. Krita audio still doesn't work after setting proper MLT_*. As Arch Linux also have this issue, maybe it is a krita bug

Relevant appimage hack in krita codebase: https://github.com/KDE/krita/blob/bd48a0a2c871802cc6bbd7abf991e7d592708031/krita/main.cc#L341-L351

callyral commented 4 months ago

I recall trying the appimage and the audio worked, but I don't remember how I got the appimage to run properly.

I think this is probably a compilation related issue, but I'm not experienced in compiling software so I'm not sure.


I think LADSPA_PATH also has to be set, but I don't know what to set it to.

sifmelcara commented 4 months ago

but I don't remember how I got the appimage to run properly.

https://nixos.wiki/wiki/Appimage should work

callyral commented 4 months ago

I think it probably needs extra files/packages, as just doing appimage-run (in nix-shell -p appimage-run) gives errors such as: Fontconfig error: Cannot load default config file: No such file: (null)

edit: I got it to run by unsetting QT_PLUGIN_PATH, but no fonts appear

Again, using the appimage would be more of a workaround to the problem rather than a solution

sifmelcara commented 4 months ago

edit: I got it to run by unsetting QT_PLUGIN_PATH, but no fonts appear

That's strange, appimage-run works for me. maybe you simply need to install more font packages?

Again, using the appimage would be more of a workaround to the problem rather than a solution

I agree, it would be nice if this can be fixed. Upstream krita maintainer only officially support appimage release but it might worth a shot to file ticket there. They might be able to help someone who build krita from source on a more standard distro like Arch and can't get LADSPA to work

callyral commented 4 months ago

maybe you simply need to install more font packages?

After searching online about fontconfig, I got the appimage to work properly by setting FONTCONFIG_PATH to /etc/fonts.

Still, even in the appimage it looks like something is broken now, so I'm no longer sure if it's a Krita bug, a bug related to the way compilation is done in nixpkgs, or a bug related to filesystem paths.

Here's the error (in the appimage) when selecting an MP3 file (it still happens when you filter for MP3s):

krita.lib.widgetutils: KoFileDialog: No default suffix for 'All supported formats'
mlt_repository_init: no plugins found in "/builds/dkazakov/krita-deps-management/ext_mlt/_install/lib/mlt-7"

Then, Krita 5.2.3 (appimage) crashes.

Compare this to the full error in the Nix (which is version 5.2.2, I don't know if the version's relevant):

krita.lib.widgetutils: KoFileDialog: No default suffix for 'All supported formats' # <- this also happens
No LADSPA plugins were found! # <- this does not happen in the appimage

Check your LADSPA_PATH environment variable. # <- neither does this
# these do not appear in the appimage's console output ↓
SAFE ASSERT (krita): "qEnvironmentVariableIsSet("MLT_REPOSITORY")" in file /build/krita-5.2.2/libs/ui/KisPlaybackEngineMLT.cpp, line 363
SAFE ASSERT (krita): "qEnvironmentVariableIsSet("MLT_PROFILES_PATH")" in file /build/krita-5.2.2/libs/ui/KisPlaybackEngineMLT.cpp, line 364
SAFE ASSERT (krita): "qEnvironmentVariableIsSet("MLT_PRESETS_PATH")" in file /build/krita-5.2.2/libs/ui/KisPlaybackEngineMLT.cpp, line 365
Warning: Invalid MLT producer for file:  file->absoluteFilePath() = "/home/cally/file.wav"  Falling back to audio-less playback.
ASSERT (krita): "producer->is_valid()" in file /build/krita-5.2.2/libs/ui/KisPlaybackEngineMLT.cpp, line 372
fish: Job 1, 'krita' terminated by signal SIGABRT (Abort)

Here is Krita's compilation documentation which is probably relevant. It recommends Docker, I don't know how Krita is compiled in nixpkgs though.

callyral commented 4 months ago

Audio is now working after Krita 5.2.3 update (unstable) today, at least with mp3 files as I haven't tested wav yet.

I think #323481 probably fixed it. If it stops working again, then this issue should probably be reopened. I realised Krita updated in the repos and immediately went to test audio on it, I wasn't expecting it to work.