NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.34k stars 14.3k forks source link

cardinal: Communication error with the JACK server #220890

Open ThibaultLemaire opened 1 year ago

ThibaultLemaire commented 1 year ago

Describe the bug

Regression in Cardinal 22.12: Cardinal does not start. (At least with Pipewire's JACK compatibility)

~ 
❯ Cardinal
libjack.so.0 loaded successfully!
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Failed to create the JACK client, reason was:
Communication error with the JACK server.

Steps To Reproduce

  1. Run Cardinal

Expected behavior

Cardinal successfully connects to the JACK server and starts, opening its window.

Additional context

Cardinal 22.11 in my nix store from my previous generation still starts correctly.

Notify maintainers

@magnetophon

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.15-xanmod1, NixOS, 23.05 (Stoat), 23.05pre461539.c90c4025bb6`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.13.3`
 - channels(root): `"home-manager, nixos"`
 - channels(user): `""`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
magnetophon commented 1 year ago

If I remember correctly, it used to work with pipewire-jack, but not with real jack. I thought these lines fixed it: https://github.com/NixOS/nixpkgs/commit/1d9a8291340ae36491886927a1c79f6c0c1bd1d7#diff-d8a890eac9100028bbe21721a101847f80eec687010e3b662b67c3e6a9e0f18bR73 But it turns out they also broke pipewire-jack. (I get the same output as you on my system when I'm running pipewire-jack)

Not sure how to make both work.

ThibaultLemaire commented 1 year ago

Thanks, as a workaround, I can run the unwrapped version with

env (cat (which Cardinal) | grep exec | awk '{print $4}' | tr -d \")
forgondolin commented 1 year ago

Even using the 22.11 version I still get the same error: Failed to load JACK DLL, reason: libjack.so.0: cannot open shared object file: No such file or directory Failed to create the JACK client, reason was: Communication error with the JACK server.

Weird.. maybe I should stick with VCV

magnetophon commented 1 year ago

@forgondolin Are you using pipewire or real jack?

magnetophon commented 1 year ago

For me, Cardinal works with real jack but I get the same error with pipewire. The workaround by @ThibaultLemaire doesn't work for me, neither in zsh nor bash:

zsh: no matches found: (cat (which Cardinal) | grep exec | awk {print } | tr -d ")
bash: syntax error near unexpected token `cat'

This function works for me, both in bash and zsh:

function unwrap { "$(dirname $(realpath "$(which $1)"))/.$1-wrapped"; }

Use it by running: unwrap Cardinal.

magnetophon commented 1 year ago

Another workaround is to run the lv2 in jalv. Here is a fuzzy lv2 launcher I use:

flv2 () {
        lv2ls | fzf --query="$*" --no-sort --reverse --tiebreak=index --no-multi --preview "lv2info {}" --header "enter to run, alt-y to copy url" --bind "enter:execute:jalv.gtk {}" --bind 'alt-y:execute:echo {} | xclip'
}

Just run flv2 and a list of your installed plugins apears in fzf. You can now type parts of the name to narrow it down. Enter will run the plugin.

ThibaultLemaire commented 1 year ago

The workaround by @ThibaultLemaire doesn't work for me, neither in zsh nor bash:

That's because it's fish syntax. I annotated it correctly which is why syntax highlighting works, but unfortunately github doesn't display the source language of a snippet :shrug:

forgondolin commented 1 year ago

@forgondolin Are you using pipewire or real jack?

@magnetophon, I'm using pipewire, I dont have JACK configure right now

magnetophon commented 1 year ago

@forgondolin Does it work for you when you use the unwrapped version? see https://github.com/NixOS/nixpkgs/issues/220890#issuecomment-1503079909

forgondolin commented 1 year ago

@magnetophon, unfortunately, no

ThibaultLemaire commented 1 year ago

I read your first comment too quickly

https://github.com/NixOS/nixpkgs/issues/220890#issuecomment-1501346481

That is not the same issue, it looks like yours fails to load libjack.so. Have you enabled the services.pipewire.jack option?

forgondolin commented 1 year ago

@ThibaultLemaire It wasn't enabled at first, just did, tried Cardinal again and same error returned... Heres my sound config:

sound.enable = true;
  hardware.pulseaudio.enable = false;
  security.rtkit.enable = true;
  services.pipewire = {
    enable = true;
    alsa.enable = true;
    alsa.support32Bit = true;
    pulse.enable = true;
    # If you want to use JACK applications, uncomment this
    jack.enable = true;
}
magnetophon commented 1 year ago

Yes, I have enabled services.pipewire.jack, that is needed as well. The normal cardinal gives me the same error, but the unwrapped version doesn't. Have you tried it?

luzpaz commented 1 year ago

heads up: #263570

forgondolin commented 1 year ago

For me, Cardinal works with real jack but I get the same error with pipewire. The workaround by @ThibaultLemaire doesn't work for me, neither in zsh nor bash:

zsh: no matches found: (cat (which Cardinal) | grep exec | awk {print } | tr -d ")
bash: syntax error near unexpected token `cat'

This function works for me, both in bash and zsh:

function unwrap { "$(dirname $(realpath "$(which $1)"))/.$1-wrapped"; }

Use it by running: unwrap Cardinal.

Now with Cardinal 23.10, this works fine for me

wolfsprite commented 7 months ago

Just ran into this same issue and the solution given above solved for me as well.

function unwrap { "$(dirname $(realpath "$(which $1)"))/.$1-wrapped"; }

unwrap Cardinal

I was also in a nix-shell, and did not have to make any changes to default configuration.

Also confirmed that Save->Export patches functions properly, after noticing an issue referenced above where it appeared not to be working.

proglottis commented 2 weeks ago

After looking at how the reaper package works I realized that instead of trying to use the unwrapped executable you can just replace libjack2 with pipewire.jack. I think this is a bit nicer:

    (cardinal.override {
      libjack2 = pipewire.jack;
    })