falkTX / Cadence

Collection of tools useful for audio production
GNU General Public License v2.0
370 stars 81 forks source link

Cadence doesn't autostart Jack on logon despite the checkbox being checked to do so - Arch Linux 64 bit #91

Open deadbeatguitarist opened 9 years ago

deadbeatguitarist commented 9 years ago

I can start Cadence manually however if I checkbox the autostart option on Jack and the Pulse audio bridge and log out and back in in either KDE or MATE - (haven't tried others as well) it won't autostart Jack.

ViktorNova commented 9 years ago

I can second this issue, except I am using the snd_aloop bridge on i3 desktop. Odd, because I swear it was working for awhile

falkTX commented 9 years ago

It happens to me randomly as well. It used to work fine...

Not sure how to fix this though. The jack auto-start is already delayed to happen during application autostart (via /etc/xdg/autostart), so by this point the desktop is already loaded.

ViktorNova commented 9 years ago

Interesting, I was wondering what method it used to autostart. I just looked in ~/.config/autostart/ and /etc/xdg/autostart/, and neither has any Cadence or Jack related .desktop files even though auto-start is checked in Cadence. Should there be?

I'm on my Manjaro system at work, I'll check my Debian machine when I get home and report back

mxmilkiib commented 9 years ago

I'm getting this consistently on Arch 64-bit. Adding "jack_control start &" back to my .xinitrc fixes the first half but the problem remains for the PA bridge. Is there anything I could further report to assist?

falkTX commented 9 years ago

Sure, see if this works instead:

cadence-session-start --system-start

That's the initial command used to start jack & bridges.

prikhi commented 9 years ago

cadence-session-start --system-start works great in my AwesomeWM config file

falkTX commented 9 years ago

This might now be fixed with the latest commit, please update and let me know if it works.

rghvdberg commented 9 years ago

ubuntu 14.04.2

cadence / jack doesn't autostart for me neither cadence-session-start works ok

cadence-session-start --system-start cadence-aloop-daemon started, using alsa_in/out and 2 channels Initiated PulseAudio successfully! JACK Started Successfully

cadence packages installed :

dpkg --list | grep cadence ii cadence 1:0.8.1+git20150418.2 all JACK audio toolbox ii cadence-data 1:0.8.1+git20150418.2 all JACK audio toolbox (data files) ii cadence-tools 1:0.8.1+git20150418.2 amd64 JACK audio toolbox (small tools) ii cadence-unity-support 1:0.8.1+git20150418.2 all JACK audio toolbox (Unity support)

troathscream commented 9 years ago

Same here on Ubuntu Studio 14.04.2 with the KXstudio Repo's enabled. I also have the problem that claudia keeps crashing cadence/jack and the bridges when making a studio.

prikhi commented 9 years ago

I built & installed from master on Arch Linux using the Awesome window manager & LightDM display manager.

On login, Claudia was started & sitting in my task bar but I had to manually start Cadence & then the JACK server to get my default studio loaded.

prikhi commented 9 years ago

Actually sorry, Claudia starting was caused by a line in my window manager config.

falkTX commented 9 years ago

AwesomeWM doesn't support X11 rules (ie, reading the files in /etc/X11/xinit/xinitrc.d/). We'll need something that works for those non-compliant desktops but that doesn't conflict with what is already in place.

@troathscream which desktop are you using? And do you have all the latest updates?

troathscream commented 9 years ago

I am using the standard WM of ubuntu studio 14.04 XFCE, yes i have run all updates.

troathscream commented 9 years ago

PS it is ubuntu studio 14.04 64 Bit

falkTX commented 9 years ago

do a purge of cadence just in case:

sudo apt-get purge cadence
sudo apt-get install cadence
troathscream commented 9 years ago

i tried purging and reinstalling cadence, but no luck. It now starts at boot but doesn't autostart the jack server and still doesn't open my claudia/ladish studio.

falkTX commented 9 years ago

you can add:

cadence-session-start --system-start

as a startup script (somewhere in your Desktop settings).

prikhi commented 9 years ago

We'll need something that works for those non-compliant desktops but that doesn't conflict with what is already in place.

I think it's fine to just use /etc/X11/xinit/xinitrc.d/. I did a little digging & the recommended way to handle this with non-compliant WMs is to add something like this to your ~/.xinitrc(I actually already had this in mine):

# Source system config
if [ -d /etc/X11/xinit/xinitrc.d ]; then
  for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
  done
  unset f
fi

Then I just had to mark the files as executable:

chmod +x /etc/X11/xinit/xinitrc.d/*cadence*

Should this be added to the docs somewhere?

falkTX commented 9 years ago

that's something you need to add to the respective non-compliant WMs. please fill a bug report against the WM you use that doesn't support this.

also, you don't need to make them executable. the files are not executed, they are "sourced". ie, '. /some/file.sh' vs '/some/file.sh' your '[ -x "$f" ]' test should be '[ -f "$f" ]'

prikhi commented 9 years ago

that's something you need to add to the respective non-compliant WMs. please fill a bug report against the WM you use that doesn't support this.

Just checking, wasn't sure if there was some tucked away spot in the docs for edge cases like this

also, you don't need to make them executable. the files are not executed, they are "sourced".

Ah ok, I just grabbed that from the code from the Arch Wiki: https://wiki.archlinux.org/index.php/Xinitrc#Configuration Everything else in xinitrc.d was marked executable so I was led to believe that was legitimate.

brunoruviaro commented 9 years ago

Running into the same problem here. Ubuntu 14.04 64 bit with KXStudio repositories & all recent updates made. Cadence starts OK if done manually from GUI or command line (cadence-session-start --system-start). Upon rebooting the computer (or complete shut down & turn back on), Jack does not autostart even though "auto start" checkboxes for Jack, MIDI, and PA were previously selected in Cadence. Currently installed versions (cadence, cadence-data, cadence-tools) is 2:0.8.1+git20150820. I have also tried the purge and re-install. Let me know if there is any further testing I can do to help find the solution...

juliandroid commented 7 years ago

I have the same issue. In Arch Linux, /etc/X11/xinit/xinitrc looks partially like this:

# start some nice programs

if [ -d /etc/X11/xinit/xinitrc.d ] ; then
 for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
  [ -x "$f" ] && . "$f"
 done
 unset f
fi

The generated files has to be executable, otherwise there are not started/loaded: 70cadence-plugin-paths 99cadence-session-start

The other files in the same directory looks like this:

-rwxr-xr-x 1 root root 318 May 5 00:59 40-libcanberra-gtk-module.sh -rwxr-xr-x 1 root root 198 Jan 29 00:32 50-systemd-user.sh

ericfont commented 7 years ago

I'm on Arch Linux Mate x86-64, and I believe I have had the same or similar problem. I had Cadence added to my Mate autostart. However, Cadence would fail to start jack because 'default' was already being utilized. I could however start jack via the "Force Restart" button fine. I believe that mate desktop was the culprit which had taken over my audio device, preventing a non-force start of jack.

So my solution was to start non-gui cadence via .xinitrc before starting the mate desktop:

cadence-session-start --system-start
exec mate-session

I found that did cause the desktop session to take a longer time to start, however, presumably because jack is getting setup. Anyway, just letting people know how it I got it working.

juliandroid commented 7 years ago

As I've said above, looking at the xinitrc, having cadence scripts with execute bit set is a must (i.e. will not run), so my fix is setting those scripts with +x and those are now working under Arch linux.

falkTX commented 7 years ago

If it's just the executable bit, then I guess I can just change it now. Please test.

YodaEmbedding commented 6 years ago

The executable bit doesn't seem to be set on a recently installed copy of cadence:

Executable bit unset

falkTX commented 6 years ago

You seem to have an old version. Current makefile installs a single file to xinit, see https://github.com/falkTX/Cadence/blob/e91750e39acb119cf97f8105a7acc28a8901a4e2/Makefile#L167

it even tries to remove files you have installed there, no longer in use, see https://github.com/falkTX/Cadence/blob/e91750e39acb119cf97f8105a7acc28a8901a4e2/Makefile#L189

YodaEmbedding commented 6 years ago

Ah, I installed from AUR. It seems to reference SourceForge binaries from 2013.

mxmilkiib commented 6 years ago

@SicariusNoctis; to be sure, cadence-git is also in the AUR.

redtide commented 5 years ago

Cadence 0.9.0 is now in the community repository.

I don't understand why sometimes I get sound and sometimes not but I notice that on /etc/X11/xinit/xinitrc the line that starts scripts is

...
for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
...

so are only .sh files to be executed? All files inside the initrc.d directory are in the form of NN-some-name.sh, so should it be named 61-cadence-session-inject.sh instead?

xxRockOnxx commented 4 years ago

Cadence 0.9.0 is now in the community repository.

I don't understand why sometimes I get sound and sometimes not but I notice that on /etc/X11/xinit/xinitrc the line that starts scripts is

...
for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
...

so are only .sh files to be executed? All files inside the initrc.d directory are in the form of NN-some-name.sh, so should it be named 61-cadence-session-inject.sh instead?

I'm on Arch and have installed Cadence 0.9.1-2 and this still seems to be an issue.

Marzal commented 4 years ago

ArchLinux KDE Cadence 0.9.1-2 No problem with autostart.

I don't have any /etc/X11/xinit/xinitrc file (no xorg-xinit package installed). What I have is the /usr/share/sddm/scripts/Xsession file that sources every file in xinitrc.d

# run all system xinitrc shell scripts.
if [ -d /etc/X11/xinit/xinitrc.d ]; then
  for i in /etc/X11/xinit/xinitrc.d/* ; do
  if [ -x "$i" ]; then
    . "$i"
  fi
  done
fi

The variables are exported but I think that STARTUP is never executed (at least I can't find any file in my system using that) STARTUP="$INSTALL_PREFIX/bin/cadence-session-start --system-start-by-x11-startup $STARTUP"

But /etc/xdg/autostart/cadence-session-start.desktop launch cadence-session-start --maybe-system-start so everything works ok.

YodaEmbedding commented 4 years ago

I think for Arch and other systemd based distros, it would make sense to have a systemd startup service take care of running pulseaudio and jack in the correct order. Currently, I am just hackily starting things 20 seconds after startup to make sure things are loaded properly. Systemd provides more control by starting services in some deterministic order.

TheBeachLab commented 4 years ago

I think for Arch and other systemd based distros, it would make sense to have a systemd startup service take care of running pulseaudio and jack in the correct order. Currently, I am just hackily starting things 20 seconds after startup to make sure things are loaded properly. Systemd provides more control by starting services in some deterministic order.

Master Yoda, could you please share your approach?

TheBeachLab commented 4 years ago

The variables are exported but I think that STARTUP is never executed (at least I can't find any file in my system using that) STARTUP="$INSTALL_PREFIX/bin/cadence-session-start --system-start-by-x11-startup $STARTUP"

I am relatively new to Linux but I think there's a mistake in this line. It looks like @falkTX is calling $STARTUP from inside STARTUP itself. This solved the problem in Arch Linux with i3 wm:

STARTUP="$INSTALL_PREFIX/bin/cadence-session-start --system-start-by-x11-startup"
$STARTUP

Now the behaviour is correct as expected

Marzal commented 4 years ago

I thought it was appending that content to the variable STARTUP, leaving up to Xsession / xinit to execute it.

http://xpt.sourceforge.net/techdocs/nix/x/general/xwin03-WinManagerdesktopsChoosing/ar01s04.html

https://goral.net.pl/post/xsession/

https://lists.debian.org/debian-user/2017/02/msg00827.html

TheBeachLab commented 4 years ago

Thanks @Marzal , I get it now. My wm seems not to use this variable, that's why it didn't autostart if not called explicitly

redtide commented 4 years ago

I think for Arch and other systemd based distros, it would make sense to have a systemd startup service take care of running pulseaudio and jack in the correct order. Currently, I am just hackily starting things 20 seconds after startup to make sure things are loaded properly. Systemd provides more control by starting services in some deterministic order.

That's what I ended up doing on my own application, for JACK at least (I'm not using PA).

tatrapikao commented 3 years ago

Hmm - On Xubuntu 20.10 "cadence-session-start --maybe-system-start" in autostart will never succeed. But when i start cadence manually without starting Jack i can run "cadence-session-start --maybe-system-start" and it will succeed starting Jack and bridging pulse. Something like "cadence && sleep 3 && cadence-session-start --maybe-system-start" works sometimes but never from autostart. On a different System also with Xubuntu 20.10 most of the time autostart works fine out of the box (not always though).

lgmventura commented 3 years ago

I had this problem when I first installed Jack. After reinstalling my Ubuntu and everything except the home folder, this problem was gone. Now, this problem is suddenly back. I'm currently using Ubuntu 20.04.

0d-billie commented 3 years ago

FWIW I was having this issue, and amending the file at /etc/X11/xinit/xinitrc.d/61cadence-session-inject to read

STARTUP="$INSTALL_PREFIX/bin/cadence-session-start --system-start-by-x11-startup" 
$STARTUP

did the trick in getting jackd to autostart correctly. However, I was coming across a separate issue whereby Firefox and Reaper could play audio, but Spotify and GuitarPro (closed-source applications, granted) could not. Changing the STARTUP variable to read STARTUP="$INSTALL_PREFIX/bin/cadence-session-start -s" solved that issue as well.

GabubuAvailable commented 2 years ago

Heyo o/ I tried the "cadence-session-start --system-start" command too but I receive this error: I use Arch Linux with the latest version of Cadence from the community repository output

UPDATE: Now i receive this: 2022-03-12_23-56