Skip to content
This repository has been archived by the owner on Dec 25, 2024. It is now read-only.

Commit

Permalink
feat: realtime preparations for pipewire + realtime-setup and tests a…
Browse files Browse the repository at this point in the history
…nd fsync kernel
  • Loading branch information
tulilirockz committed Mar 8, 2024
1 parent 4c7879e commit 62ceb41
Show file tree
Hide file tree
Showing 40 changed files with 120 additions and 483 deletions.
24 changes: 8 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,14 @@ jobs:
fail-fast: false
matrix:
recipe:
- recipes/pw/recipe.yml
- recipes/pw/recipe-nvidia.yml
- recipes/pw/recipe-gnome.yml
- recipes/pw/recipe-gnome-nvidia.yml
- recipes/pw/hardened/recipe.yml
- recipes/pw/hardened/recipe-nvidia.yml
- recipes/pw/hardened/recipe-gnome.yml
- recipes/pw/hardened/recipe-gnome-nvidia.yml
- recipes/jack/recipe.yml
- recipes/jack/recipe-nvidia.yml
- recipes/jack/recipe-gnome.yml
- recipes/jack/recipe-gnome-nvidia.yml
- recipes/jack/hardened/recipe.yml
- recipes/jack/hardened/recipe-nvidia.yml
- recipes/jack/hardened/recipe-gnome.yml
- recipes/jack/hardened/recipe-gnome-nvidia.yml
- recipes/recipe.yml
- recipes/recipe-nvidia.yml
- recipes/recipe-gnome.yml
- recipes/recipe-gnome-nvidia.yml
- recipes/hardened/recipe.yml
- recipes/hardened/recipe-nvidia.yml
- recipes/hardened/recipe-gnome.yml
- recipes/hardened/recipe-gnome-nvidia.yml
steps:
- name: Maximize build space
uses: ublue-os/remove-unwanted-software@v6
Expand Down
11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Want a reproducible and atomic environment for all your content creation needs?

This image is distributed in two flavours: Plasma and Gnome, they have the same applications, but some minor differentes in theming, and some adapted aplications for better system integration (like `qpwgraph` <-> `helvum`). You can install this image by either installing the (current netinstall) ISO in [Releases](https://github.com/atomic-studio-org/Atomic-Studio/releases) or by rebasing your system to one of them.

You can use Jack-only images that do not have pipewire enabled by default and you can use hardened images that have less hardware compatibility but have much better security!
You can also use hardened images that have less hardware compatibility but have much better security!

### Rebasing

Expand All @@ -26,15 +26,8 @@ rpm-ostree rebase ostree-image-signed:docker://ghcr.io/atomic-studio-org/atomic-
# Latest Gnome version + Nvidia
rpm-ostree rebase ostree-image-signed:docker://ghcr.io/atomic-studio-org/atomic-studio-gnome-nvidia:latest

# Add -jack or -hardened or both on your images to get the jack-only, or hardened image versions.
# Add -hardened to get the hardened image versions. E.g.:
rpm-ostree rebase ostree-image-signed:docker://ghcr.io/atomic-studio-org/atomic-studio-hardened:latest
rpm-ostree rebase ostree-image-signed:docker://ghcr.io/atomic-studio-org/atomic-studio-jack-hardened:latest
rpm-ostree rebase ostree-image-signed:docker://ghcr.io/atomic-studio-org/atomic-studio-gnome-hardened:latest
rpm-ostree rebase ostree-image-signed:docker://ghcr.io/atomic-studio-org/atomic-studio-gnome-jack:latest
rpm-ostree rebase ostree-image-signed:docker://ghcr.io/atomic-studio-org/atomic-studio-gnome-jack-hardened:latest
rpm-ostree rebase ostree-image-signed:docker://ghcr.io/atomic-studio-org/atomic-studio-gnome-nvidia-hardened:latest
rpm-ostree rebase ostree-image-signed:docker://ghcr.io/atomic-studio-org/atomic-studio-gnome-nvidia-jack:latest
rpm-ostree rebase ostree-image-signed:docker://ghcr.io/atomic-studio-org/atomic-studio-gnome-nvidia-jack-hardened:latest
```

> Note: If these commands do not work first time, you are probably on a vanilla Fedora Atomic system, please run these but, instead of `ostree-image-signed:docker://`, use `ostree-unverified-registry:`, like the follwing command:
Expand Down
19 changes: 0 additions & 19 deletions config/common/audio/jack-packages.yml

This file was deleted.

8 changes: 0 additions & 8 deletions config/common/audio/jack-services.yml

This file was deleted.

18 changes: 0 additions & 18 deletions config/common/audio/pipewire-flatpaks.yml

This file was deleted.

7 changes: 0 additions & 7 deletions config/common/audio/pipewire-services.yml

This file was deleted.

2 changes: 2 additions & 0 deletions config/common/shared/flatpaks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ system:
- org.hydrogenmusic.Hydrogen
- com.mattjakeman.ExtensionManager
- io.missioncenter.MissionCenter
- it.mijorus.whisper
- io.github.dimtpap.coppwr
3 changes: 3 additions & 0 deletions config/common/shared/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ install:
- ffmpeg
- fish
- switcheroo-control
- realtime-setup
- realtime-tests
- pulseaudio-utils
2 changes: 1 addition & 1 deletion config/common/shared/scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ scripts:
- ptyxis.nu
- extra-packages.nu
- tuned.nu
#- rt-kernel.nu
- fsync-kernel.nu
5 changes: 5 additions & 0 deletions config/common/shared/services.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: systemd
system:
enabled:
- realtime-entsk
- realtime-setup
4 changes: 4 additions & 0 deletions config/files/shared/etc/security/limits.d/95-pipewire.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Default limits for users of pipewire
@pipewire - rtprio 95
@pipewire - nice -19
@pipewire - memlock 4194304
13 changes: 13 additions & 0 deletions config/files/shared/etc/sysconfig/rtkit
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
RTKIT_ARGS="--scheduling-policy=FIFO
--our-realtime-priority=89
--max-realtime-priority=88
--min-nice-level=-19
--rttime-usec-max=2000000
--users-max=100
--processes-per-user-max=1000
--threads-per-user-max=10000
--actions-burst-sec=10
--actions-per-burst-max=1000
--canary-cheep-msec=30000
--canary-watchdog-msec=60000
"
5 changes: 2 additions & 3 deletions config/files/shared/etc/sysctl.d/50-atomicstudio.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
vm.swappiness = 10
fs.inotify.max_user_watches = 524288
#if you are gonna use midi modify this in your custom overlay
#dev.hpet.max-user-freq=3072
fs.inotify.max_user_watches = 600000
dev.hpet.max-user-freq=3072
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[Service]
EnvironmentFile=/etc/sysconfig/rtkit
ExecStart=
ExecStart=/usr/libexec/rtkit-daemon $RTKIT_ARGS
17 changes: 0 additions & 17 deletions config/files/shared/lib/systemd/user/custom-jackd.service

This file was deleted.

105 changes: 0 additions & 105 deletions config/files/shared/libexec/atomic-studio-cli/jackd.nu

This file was deleted.

3 changes: 1 addition & 2 deletions config/files/shared/libexec/atomic-studio-cli/mod.nu
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
export use add.nu *
export use jackd.nu *
export use davinci.nu *
export use motd.nu *
export use reporter.nu *
export use speaker-test.nu *
export use update.nu *
export use pwjack.nu *
export use pw.nu *
45 changes: 45 additions & 0 deletions config/files/shared/libexec/atomic-studio-cli/pw.nu
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env -S nu

const TARGET_CONFIG_PATH = "/etc/profile.d/atomic-pwjack.sh"
const VALID_BFSIZES = [8,16,32,64,128,256,512,1024,2048,4096]

# Set specific buffersize for PIPEWIRE_QUANTUM variable (fixes ardour and carla crashes)
export def "main pw set quantum-buffersize" [--buffersize (-b): int] {
mut is_valid_thing: bool = false
mut iter = 0
let max_iter = ($VALID_BFSIZES | length)
loop {
if $iter == $max_iter {
break
}
if VALID_BFSIZES.$iter == $buffersize {
$is_valid_thing = true
}
}

if not is_valid_thing {
echo "Invalid Value"
exit 2
}

$"export PIPEWIRE_QUANTUM=\"($buffersize)/48000\"" | save -f /etc/profile.d/atomic-pwjack.sh
pw-metadata -n settings 0 clock.force-quantum $buffersize

echo "Log out and in for changes to take effect."
exit 0
}

# Enables realtime in linux kernel arguments
export def "main pw enable realtime" [] {
rpm-ostree kargs --append-if-missing="preempt=full"
}

# Disables realtime from linux kernel arguments
export def "main pw disable realtime" [] {
rpm-ostree kargs --delete-if-present="preempt=full"
}

# Manage pipewire configurations
export def "main pw" [] {
echo "Usage pw <subcommand>."
}
49 changes: 0 additions & 49 deletions config/files/shared/libexec/atomic-studio-cli/pwjack.nu

This file was deleted.

Loading

0 comments on commit 62ceb41

Please sign in to comment.