Skip to content
This repository was archived by the owner on Aug 21, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions data/cadence
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/bin/bash
#!/bin/sh

# Check if already running

PROCS=`ps -f -u $USER | grep /share/cadence/src/cadence.py | grep python`
PROCS=$(ps -f -u $USER | grep /share/cadence/src/cadence.py | grep python)

if [ x"$PROCS" != x"" ]; then

# One instance only
PROC=`echo "$PROCS" | head -n 1`
PROC=$(echo "$PROCS" | head -n 1)

# Get PID
PID=`echo "$PROC" | awk '{printf$2}'`
PID=$(echo "$PROC" | awk '{printf$2}')

# Last check, just to make sure
if [ x"$PID" != x"" ]; then
Expand Down
2 changes: 1 addition & 1 deletion data/cadence-aloop-daemon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh

if [ -f /usr/bin/python3 ]; then
PYTHON=/usr/bin/python3
Expand Down
2 changes: 1 addition & 1 deletion data/cadence-jacksettings
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh

if [ -f /usr/bin/python3 ]; then
PYTHON=/usr/bin/python3
Expand Down
2 changes: 1 addition & 1 deletion data/cadence-logs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh

if [ -f /usr/bin/python3 ]; then
PYTHON=/usr/bin/python3
Expand Down
22 changes: 11 additions & 11 deletions data/cadence-pulse2jack
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
# Script to bridge/start pulseaudio into JACK mode

INSTALL_PREFIX="X-PREFIX-X"
Expand All @@ -12,7 +12,7 @@ fi
if [ ! -f ~/.pulse/client.conf ]; then
echo "autospawn = no" > ~/.pulse/client.conf
else
if (! cat ~/.pulse/client.conf | grep "autospawn = no" > /dev/null); then
if ! grep "autospawn = no" < ~/.pulse/client.conf > /dev/null; then
sed -i '/autospawn =/d' ~/.pulse/client.conf
echo "autospawn = no" >> ~/.pulse/client.conf
fi
Expand All @@ -24,19 +24,19 @@ if [ ! -f ~/.pulse/daemon.conf ]; then
echo "rlimit-rttime = -1" >> ~/.pulse/daemon.conf
echo "exit-idle-time = -1" >> ~/.pulse/daemon.conf
else
if (! cat ~/.pulse/daemon.conf | grep "default-sample-format = float32le" > /dev/null); then
if ! grep "default-sample-format = float32le" < ~/.pulse/daemon.conf > /dev/null; then
sed -i '/default-sample-format = /d' ~/.pulse/daemon.conf
echo "default-sample-format = float32le" >> ~/.pulse/daemon.conf
fi
if (! cat ~/.pulse/daemon.conf | grep "realtime-scheduling = yes" > /dev/null); then
if ! grep "realtime-scheduling = yes" < ~/.pulse/daemon.conf > /dev/null; then
sed -i '/realtime-scheduling = /d' ~/.pulse/daemon.conf
echo "realtime-scheduling = yes" >> ~/.pulse/daemon.conf
fi
if (! cat ~/.pulse/daemon.conf | grep "rlimit-rttime = -1" > /dev/null); then
if ! grep "rlimit-rttime = -1" < ~/.pulse/daemon.conf > /dev/null; then
sed -i '/rlimit-rttime =/d' ~/.pulse/daemon.conf
echo "rlimit-rttime = -1" >> ~/.pulse/daemon.conf
fi
if (! cat ~/.pulse/daemon.conf | grep "exit-idle-time = -1" > /dev/null); then
if ! grep "exit-idle-time = -1" < ~/.pulse/daemon.conf > /dev/null; then
sed -i '/exit-idle-time =/d' ~/.pulse/daemon.conf
echo "exit-idle-time = -1" >> ~/.pulse/daemon.conf
fi
Expand Down Expand Up @@ -80,8 +80,8 @@ esac

IsPulseAudioRunning()
{
PROCESS=`ps -u $USER | grep pulseaudio`
if [ "$PROCESS" == "" ]; then
PROCESS=$(ps -u $USER | grep pulseaudio)
if [ "$PROCESS" = "" ]; then
false
else
true
Expand All @@ -90,15 +90,15 @@ IsPulseAudioRunning()

if (IsPulseAudioRunning); then
{
if (`jack_lsp | grep "PulseAudio JACK Sink:" > /dev/null`); then
if jack_lsp | grep "PulseAudio JACK Sink:" > /dev/null; then
{
echo "PulseAudio is already running and bridged to JACK"
}
else
{
echo "PulseAudio is already running, bridge it..."

if [ "$PLAY_ONLY" == "yes" ]; then
if [ "$PLAY_ONLY" = "yes" ]; then
{
pactl load-module module-jack-sink > /dev/null
pacmd set-default-source jack_in > /dev/null
Expand All @@ -118,7 +118,7 @@ if (IsPulseAudioRunning); then
}
else
{
if (`pulseaudio --daemonize --high-priority --realtime --exit-idle-time=-1 --file=$FILE -n`); then
if pulseaudio --daemonize --high-priority --realtime --exit-idle-time=-1 --file=$FILE -n > /dev/null 2>&1; then
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why disabling the output here?

echo "Initiated PulseAudio successfully!"
else
echo "Failed to initialize PulseAudio!"
Expand Down
18 changes: 9 additions & 9 deletions data/cadence-pulse2loopback
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
# Script to bridge/start pulseaudio into loopback mode

INSTALL_PREFIX="X-PREFIX-X"
Expand All @@ -12,7 +12,7 @@ fi
if [ ! -f ~/.pulse/client.conf ]; then
echo "autospawn = no" > ~/.pulse/client.conf
else
if (! cat ~/.pulse/client.conf | grep "autospawn = no" > /dev/null); then
if ! grep "autospawn = no" < ~/.pulse/client.conf > /dev/null; then
sed -i '/autospawn =/d' ~/.pulse/client.conf
echo "autospawn = no" >> ~/.pulse/client.conf
fi
Expand All @@ -24,19 +24,19 @@ if [ ! -f ~/.pulse/daemon.conf ]; then
echo "rlimit-rttime = -1" >> ~/.pulse/daemon.conf
echo "exit-idle-time = -1" >> ~/.pulse/daemon.conf
else
if (! cat ~/.pulse/daemon.conf | grep "default-sample-format = float32le" > /dev/null); then
if ! grep "default-sample-format = float32le" < ~/.pulse/daemon.conf > /dev/null; then
sed -i '/default-sample-format = /d' ~/.pulse/daemon.conf
echo "default-sample-format = float32le" >> ~/.pulse/daemon.conf
fi
if (! cat ~/.pulse/daemon.conf | grep "realtime-scheduling = yes" > /dev/null); then
if ! grep "realtime-scheduling = yes" < ~/.pulse/daemon.conf > /dev/null; then
sed -i '/realtime-scheduling = /d' ~/.pulse/daemon.conf
echo "realtime-scheduling = yes" >> ~/.pulse/daemon.conf
fi
if (! cat ~/.pulse/daemon.conf | grep "rlimit-rttime = -1" > /dev/null); then
if ! grep "rlimit-rttime = -1" < ~/.pulse/daemon.conf > /dev/null; then
sed -i '/rlimit-rttime =/d' ~/.pulse/daemon.conf
echo "rlimit-rttime = -1" >> ~/.pulse/daemon.conf
fi
if (! cat ~/.pulse/daemon.conf | grep "exit-idle-time = -1" > /dev/null); then
if ! grep "exit-idle-time = -1" < ~/.pulse/daemon.conf > /dev/null; then
sed -i '/exit-idle-time =/d' ~/.pulse/daemon.conf
echo "exit-idle-time = -1" >> ~/.pulse/daemon.conf
fi
Expand Down Expand Up @@ -77,8 +77,8 @@ esac

IsPulseAudioRunning()
{
PROCESS=`ps -u $USER | grep pulseaudio`
if [ "$PROCESS" == "" ]; then
PROCESS=$(ps -u $USER | grep pulseaudio)
if [ "$PROCESS" = "" ]; then
false
else
true
Expand All @@ -98,7 +98,7 @@ if (IsPulseAudioRunning); then
}
else
{
if (`pulseaudio --daemonize --high-priority --realtime --exit-idle-time=-1 --file=$FILE -n`); then
if pulseaudio --daemonize --high-priority --realtime --exit-idle-time=-1 --file=$FILE -n > /dev/null 2>&1; then
echo "Initiated PulseAudio successfully!"
else
echo "Failed to initialize PulseAudio!"
Expand Down
2 changes: 1 addition & 1 deletion data/cadence-render
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh

if [ -f /usr/bin/python3 ]; then
PYTHON=/usr/bin/python3
Expand Down
6 changes: 3 additions & 3 deletions data/cadence-session-start
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh

if [ -f /usr/bin/python3 ]; then
PYTHON=/usr/bin/python3
Expand All @@ -8,7 +8,7 @@ fi

INSTALL_PREFIX="X-PREFIX-X"

if [ "$1"x == "--system-start-by-x11-startup"x ]; then
if [ "$1"x = "--system-start-by-x11-startup"x ]; then
# called via $STARTUP in 21cadence-session-inject
$PYTHON $INSTALL_PREFIX/share/cadence/src/cadence_session_start.py --system-start &
shift
Expand All @@ -17,7 +17,7 @@ if [ "$1"x == "--system-start-by-x11-startup"x ]; then
else
exec x-session-manager
fi
elif [ "$1"x == "--maybe-system-start"x ]; then
elif [ "$1"x = "--maybe-system-start"x ]; then
# called via autostart cadence-session-start.desktop
# this will check if jack is already running before trying to restart things
exec $PYTHON $INSTALL_PREFIX/share/cadence/src/cadence_session_start.py --system-start-desktop
Expand Down