Open bcaccia opened 5 years ago
I just started stumbling through this stuff because I wanted flexible audio routing. I have a really messed up setup that barely works right now; does this help?: https://github.com/jackaudio/jackaudio.github.com/wiki/WalkThrough_User_PulseOnJack
For starters I just manually ran the script and it created some monitor devices or something.
Thanks. I've gone through those setup procedures successfully before in Debian and Ubuntu based distros. Unfortunately I'm unable to get a working Jack2 audio setup in Nix.
@deliciouslytyped Do you happen to have a working config file that you can share for your Nix setup? It's not out of the question that I'm configuring something incorrectly.
Right now I have an ad-hoc configuration I got roughly running about half an hour ago and probably like 100 tabs on JACK and related stuff open :P
I had to do some of the stuff here https://askubuntu.com/questions/224151/jack-server-could-not-be-started-when-using-qjackctl/232163 , mainly I tried the pasuspend thing (now I dont seem to need it??? - maybe the same JACK server has been running the whole time, IDK) and the other entry that mentions using fuser, but I really have no idea whats going on. Oh yeah, I had to set it to use the PCM device in qjackctl.
I installed pulseaudiofull and added myself to the jackaudio and audio groups, I don't know if the latter even does anything, and I enabled all the dbus stuff in qjackctl.
Basically I threw things and google at it till it kind of worked...
Any luck? Do you use IRC?
Unfortunately, no luck.
My user is part of the jackaudio, audio, and realtime groups.
pulseaudio --kill
jack_control start
I don't use IRC normally but am able to connect to an IRC server. I previously asked the question in the #nix_os irc channel but nobody seemed to have an answer. Open to suggestions.
The dbus problem with cadence involves https://github.com/NixOS/nixpkgs/issues/55574#issuecomment-570929790 I'm quite sure, but qjackctl works for me. I have the intention to try to work on this stuff a bit, but not really the space to commit to it...
You shouldn't need the pajackconnect script just to get jack supporting applications to use jack. once you have jack running I think they should just work. My problem was that I couldn't get pulse to work in that case without additional work. The reason is that one or the other needs actual control of the audio devs.
Look into trying to run qjackctl with pasuspender, and setting the hardware device to the PCH or whichever device in qjackctl, those were things I had to do I think.
Tried the suggested steps:
In qjackctl:
Jack is running but programs like VCV and Reaper are not seeing it.
So this isn't very helpful but then you need to figure out why they aren't seeing it. Is the jack server running? Can the applications connect to the jack server? Are they compiled with jack support? (VCV worked out of the box for me so presumably you don't need to mess with that.)
To answer the above questions:
Is the jack server running?
Yes. This is confirmed by both the messages output in the QJackctl Message window as well as by running ps aux | grep jackd
.
It is also worth noting that when I start jack via QJackctl, Pulse audio does in fact suspend. I can tell because if I open a video in my web browser there is no audio playback.
Can the applications connect to the jack server? No. No applications are able to connect to the jack server. I've tried Reaper, VCV Rack, and the Helm synthesizer. No Jack audio devices appear present.
Are they compiled with jack support? I am installing the following packages directly in my Nix config, all are compiled with Jack support.
# Music
unstable.reaper helm zynaddsubfx unstable.vcv-rack unstable.sunvox qjackctl libjack2 jack2
Other troubleshooting steps
jack_metro -b 200
. There was no audio output.jack_lsp -c
shows valid capture and playback portsThis doesn't appear to be an issue with my actual Nix config. Although I haven't seen yours, presumably we have the same packages being installed, users are part of the same audio groups as suggested in the wiki, etc. I've also disabled Musnix just to make sure that wasn't a factor.
I think this strictly has to do with post installation procedures.
@deliciouslytyped Would you be able to provide screenshots of what your QJackctl configuration settings are? Maybe we have something setup different there?
So I just restarted my machine for the first time since I got the ad-hoc jack setup working and things are broken again. :) The system level jack setup seems to be different than what I had going though. For example I was deliberately running in non-realtime mode. I'll report back if I have any findings.
So, I disabled (Edit: correction: stopped) the system level jack and jack-session service and the user level pulseaudio service (you have to stop the pulseaudio.socket service to stop it from constantly getting reactivated), I just used qjackctl to start the jack service, and pulseaudio --start to start pulseaudio.
There may be some other things that need to be done, because I also ran the usual pactl commands earlier.
So basically I started everything "manually" in the context of my user and hoped it would work, and it did. So it's still not running in realtime mode if you need that.
At some point I'll maybe set aside time and try to figure out what is actually going on here, until then...
I've finally been able to start Jack audio and get a program to see a valid jack output device by executing the following steps:
Upgraded my Nix install from 19.03 to 19.09 (may not be necessary, but it is an action that was taken)
In my nix config set libjack2 jack2 qjackctl
to use the unstable versions:
unstable.libjack2 unstable.jack2 unstable.qjackctl
Rebuild my nix config and reboot
After rebooting, launched qjackctl and entered in the following Options:
Setup -> Settings -> Options -> Execute script after Startup: check
pactl load-module module-jack-sink channels=2; pactl load-module module-jack-source channels=2; pacmd set-default-sink jack_out
Setup -> Settings -> Options -> Execute script on Shutdown: check
pactl unload-module `pactl list|grep -A 3 jack-source|tail -1|awk '{ print $NF }'`;pactl unload-module `pactl list|grep -A 3 jack-sink|tail -1|awk '{ print $NF }'`
At this point, VCV Rack works with Jack just fine. However Reaper and Helm do not show valid Jack output devices. I'm not sure if it has anything to do with the way those packages were built.
for reaper, it had no jack support, so #81282
I ran into some problems again, I'm not sure if I have some misconfigured services or what.
I was getting errors for module loading like
pactl load-module module-jack-sink channels=2
causing this in pulse:
Apr 22 22:41:54 nixos pulseaudio[31229]: W: [pulseaudio] module-jack-sink.c: JACK error >Cannot read socket fd = 55 err = No such file or directory< │
│Apr 22 22:41:54 nixos pulseaudio[31229]: W: [pulseaudio] module-jack-sink.c: JACK error >CheckRes error< │
│Apr 22 22:41:54 nixos pulseaudio[31229]: W: [pulseaudio] module-jack-sink.c: JACK error >Could not read result type = 22< │
│Apr 22 22:41:54 nixos pulseaudio[31229]: W: [pulseaudio] module-jack-sink.c: JACK error >Client name = PulseAudio JACK Sink conflits with another running client< │
│Apr 22 22:41:54 nixos pulseaudio[31229]: W: [pulseaudio] module-jack-sink.c: JACK error >Cannot connect to the server< │
│Apr 22 22:41:54 nixos pulseaudio[31229]: W: [pulseaudio] module-jack-sink.c: JACK error >JackShmReadWritePtr1::~JackShmReadWritePtr1 - Init not done for -1, skipping unlock< │
│Apr 22 22:41:54 nixos pulseaudio[31229]: W: [pulseaudio] module-jack-sink.c: JACK error >JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock< │
│Apr 22 22:41:54 nixos pulseaudio[31229]: E: [pulseaudio] module-jack-sink.c: jack_client_open() failed. │
│Apr 22 22:41:54 nixos pulseaudio[31229]: E: [pulseaudio] module.c: Failed to load module "module-jack-sink" (argument: "channels=2"): initialization failed. │
│Apr 22 22:41:54 nixos pulseaudio[31229]: W: [pulseaudio] module-jack-source.c: JACK error >Cannot read socket fd = 55 err = No such file or directory< │
│Apr 22 22:41:54 nixos pulseaudio[31229]: W: [pulseaudio] module-jack-source.c: JACK error >CheckRes error< │
│Apr 22 22:41:54 nixos pulseaudio[31229]: W: [pulseaudio] module-jack-source.c: JACK error >Could not read result type = 22< │
│Apr 22 22:41:54 nixos pulseaudio[31229]: W: [pulseaudio] module-jack-source.c: JACK error >Client name = PulseAudio JACK Source conflits with another running client< │
│Apr 22 22:41:54 nixos pulseaudio[31229]: W: [pulseaudio] module-jack-source.c: JACK error >Cannot connect to the server< │
│Apr 22 22:41:54 nixos pulseaudio[31229]: W: [pulseaudio] module-jack-source.c: JACK error >JackShmReadWritePtr1::~JackShmReadWritePtr1 - Init not done for -1, skipping unlock< │
│Apr 22 22:41:54 nixos pulseaudio[31229]: W: [pulseaudio] module-jack-source.c: JACK error >JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock<
and this in jackd:
Unknown request 1936487760
Unknown request 1685406053
Unknown request 1243639657
Unknown request 541803329
Unknown request 1802398035
Unknown request 0
Unknown request 0
Unknown request 0
Unknown request 0
Unknown request 0
Unknown request 0
Unknown request 0
Unknown request 0
Unknown request 0
Unknown request 0
Unknown request 0
Unknown request 2048
Unknown request 0
Unknown request 0
Unknown request 0
Unknown request 256
Cannot read socket fd = 12 err = Success
Running everything manually, from a nix-shell seems to work;
nix-shell -I nixpkgs=channel:nixos-unstable -p pulseaudioFull libjack2 jack2 -v
pulseaudio -vvvv --daemonize=no
jackd -r -p2048 -dalsa -dhw:PCH -r48000 -p1024 -n2
Edit: Uhhh....but with this setup somehow the only outputs things see are the JACK output. So I think this ends up routing pulse through JACK (or not?)... And mumble doesn't see pulse (jack support is compiled in), so things still end up broken. I don't know how these things interface with eachother. Edit2: looks like that had something to do with ~/.config/pulse Edit3: I didn't check which version to pin to or what the root cause is, but you need to be on a (at the time of this post) unstable channel for this to work
I marked this as stale due to inactivity. → More info
Is the services.jackd
module broken? It doesn't work for me at all. Seems like the best thing is to just install jack2 and use dbus.
I marked this as stale due to inactivity. → More info
Umm. Can we unstale this?
I marked this as stale due to inactivity. → More info
Describe the bug Due to the outdated Jack setup page on the Nix wiki and the fact that my similar audio setup in Ubuntu functions, I'm assuming this is an issue with the Jack or QjackCtl Nix packages.
When running jack audio via QJackCtl, the
jackdbus
server is running but no Jack audio devices are available as outputs in any audio software.This was reproduced on:
No audio outputs in VCV Rack:
No Audio outputs in Reaper:
I've ensured that system outputs were created in the QjackCtl patchbay:
Here is the contents of the QjackCtl Messages window showing relevant errors when one of the above audio apps is started:
To Reproduce
configuration.nix
Additionally, add the following packages:
qjackctl libjack2 jack2 unstable.vcv-rack unstable.reaper
And add your user to theaudio
group.Expected behavior User should be able to select JACK audio output devices in an audio app.
Screenshots
Additional context Here is the output of
cat /proc/asound/cards
Output of
ps -A | ack "jackd"
output:2324 ? 00:00:04 jackdbus
Disabling
pulseaudio
completely and just running the non dbus version of jack results in the same error messages seen in the original bug description.Below is the full content of my
configuration.nix
fileMetadata