I am trying to launch a custom script with “the button” feature, but I am having some problems. I think that there are related to the user or the shell options…
This is the situation:
I have a custom script, like this:
whoami > /tmp/log
sooperlooper >> /tmp/log 2>&1
I have configure /etc/pisound.conf in order to launch my script when I CLICK_1
Then, I launch tail -f /tmp/log and read the logs. This is the log:
exec of JACK server (command = “#!/bin/sh”) failed: no such file or directory
cannot connect to jack
cannot initialize sooperlooper.
I am not sure what is the problem, but su patch && whoami == root it is strange for me.
I supose that root is not be able to launch sooperlooper or root has not launched a shell and then can exec /bin/sh…
Any idea about how to launch a custom button script as a normal user?
(When I launch my custom script from my patch user shell it works correctly).
Hey, could you paste the contents of these files:
It looks like it’s an environment variable issue - the jack service should already be running, so executing another jack client should not attempt to start a new server, and jack clients know not to do that by seeing the
JACK_PROMISCUOUS_SERVER=jack environment variable.
Yes, the Jack server is running.
If I launch the script from shell, sooperlooper works.
if then, I launch it from button sooperlooper does not work.
If i launch it from console again, sooperlooper works.
Description=Pisound button daemon autostart
exec is used to ‘morph’ the shell interpreter process into jackd process, saving some system resources.
exec /usr/bin/jackd -t 2000 -R -P 75 -d alsa -d hw:pisound -r 48000 -p 128 -n 2 -X seq -s -S
I think that, probably, you are in right. There are some problems with my env vars. So, in order to test it I have add this code line to the BUTTON_1 custom script:
printenv >> /tmp/log
When I press the pisound button I see this information in my /tmp/log file:
the JACK_PROMISCUOUS_SERVER var is not present.
What is the output of:
apt show pisound-btn
Try editing the pisound-btn.service to match the contents here: https://github.com/BlokasLabs/pisound/blob/master/pisound-btn/debian/usr/lib/systemd/system/pisound-btn.service and run:
sudo systemctl daemon-reload
sudo systemctl restart pisound-btn
apt show pisound-btn
Maintainer: Blokas Labs firstname.lastname@example.org
Pre-Depends: hostapd (>= 1:2.3), dnsmasq (>= 2.72)
Depends: libc6 (>= 2.19), libgcc1 (>= 1:4.9.2-10), python (>= 2.7), python-urwid (>= 1.1), git (>= 1:2.1.4), libglib2.0-bin (>= 2.33.12)
Download-Size: 17,0 kB
APT-Sources: http://blokas.io/apt rpi/main armhf Packages
Description: Pisound Button daemon.
See https://blokas.io/pisound for more information.
patch@patchbox:~ $ pisound-btn --version
Version 1.07, Blokas Labs https://blokas.io/pisound
Changing the pisound-btn.service file has works!