Browse Source

Merge 53a6f526b9 into 2187c061bf

pull/325/merge
neyuru GitHub 1 year ago
parent
commit
77e8c87cac
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 50 deletions
  1. +1
    -34
      data/cadence-pulse2jack
  2. +25
    -16
      src/cadence.py

+ 1
- 34
data/cadence-pulse2jack View File

@@ -9,39 +9,6 @@ if [ ! -d ~/.pulse ]; then
mkdir -p ~/.pulse
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
sed -i '/autospawn =/d' ~/.pulse/client.conf
echo "autospawn = no" >> ~/.pulse/client.conf
fi
fi

if [ ! -f ~/.pulse/daemon.conf ]; then
echo "default-sample-format = float32le" > ~/.pulse/daemon.conf
echo "realtime-scheduling = yes" >> ~/.pulse/daemon.conf
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
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
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
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
sed -i '/exit-idle-time =/d' ~/.pulse/daemon.conf
echo "exit-idle-time = -1" >> ~/.pulse/daemon.conf
fi
fi

# ----------------------------------------------

PLAY_ONLY="no"
@@ -118,7 +85,7 @@ if (IsPulseAudioRunning); then
}
else
{
if (`pulseaudio --daemonize --high-priority --realtime --exit-idle-time=-1 --file=$FILE -n`); then
if (`pulseaudio --daemonize=no --log-target=journal`); then
echo "Initiated PulseAudio successfully!"
else
echo "Failed to initialize PulseAudio!"


+ 25
- 16
src/cadence.py View File

@@ -470,6 +470,7 @@ class CadenceSystemCheck_kernel(CadenceSystemCheck):
self.name = self.tr("Current kernel")

uname3 = os.uname()[2]
uname4 = getoutput("uname -a").strip().split()

versionInt = []
versionStr = uname3.split("-",1)[0]
@@ -484,28 +485,36 @@ class CadenceSystemCheck_kernel(CadenceSystemCheck):

self.result = versionStr + " "

if "-" not in uname3:
self.icon = self.ICON_WARN
self.result += self.tr("Vanilla")
self.moreInfo = None
if "PREEMPT" in uname4 or "PREEMPT_RT" in uname4:
self.icon = self.ICON_OK

else:
if uname3.endswith("-pae"):
kernelType = uname3.split("-")[-2].lower()
self.result += kernelType.title() + " (PAE)"
if "PREEMPT" in uname4:
self.moreInfo = self.tr("Be sure to properly configure your kernel.")
self.result += self.tr("PREEMPT")
else:
kernelType = uname3.split("-")[-1].lower()
self.result += kernelType.title()

if kernelType in ("rt", "realtime") or (kernelType == "lowlatency" and versionInt >= [2, 6, 39]):
self.icon = self.ICON_OK
self.moreInfo = None
elif versionInt >= [2, 6, 39]:
self.result += self.tr("PREEMPT_RT")

else:
if versionInt >= [2, 6, 11]:
#Linux kernel versions 2.6.11 and up can be patched for PREEMPT_RT and
#versions 2.6.13 and up can be configured for CONFIG_PREEMPT
# sources
# https://wiki.linuxfoundation.org/realtime/preempt_rt_versions
# https://cateee.net/lkddb/web-lkddb/PREEMPT.html
self.icon = self.ICON_WARN
self.moreInfo = None
self.moreInfo = self.tr("RT may be available if compiling this version w/CONFIG_PREEMPT or patching this kernel w/CONFIG_PREEMPT_RT.")

if "-" not in uname3:
if uname3.endswith("-pae"):
kernelType = uname3.split("-")[-2].lower()
self.result += kernelType.title() + self.tr(" Vanilla (PAE)")
else:
kernelType = uname3.split("-")[-1].lower()
self.result += kernelType.title() + self.tr(" Vanilla")
else:
self.icon = self.ICON_ERROR
self.moreInfo = None
self.moreInfo = self.tr("No realtime options for this version of kernel.")

def initSystemChecks():
if LINUX:


Loading…
Cancel
Save