Skip to content

Commit

Permalink
Shared memory refactoring. Audio on memsocket
Browse files Browse the repository at this point in the history
Signed-off-by: Jaroslaw Kurowski <[email protected]>
  • Loading branch information
gngram authored and jkuro-tii committed Jan 7, 2025
1 parent 606a182 commit 99db384
Show file tree
Hide file tree
Showing 10 changed files with 299 additions and 176 deletions.
18 changes: 16 additions & 2 deletions modules/common/services/audio.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ in
default = 4714;
description = "TCP port used by Pipewire-pulseaudio control";
};
pulseaudioUnixSocketPath = mkOption {
type = types.path;
default = "/run/pipewire/pulseaudio-0";
description = "Path to Unix socket used by Pipewire-pulseaudio service";
};
pulseaudioUseShmem = mkOption {
type = types.bool;
default = true;
description = "Use shared memory for audio service";
};
};

config = mkIf cfg.enable {
Expand All @@ -46,10 +56,14 @@ in
{
name = "libpipewire-module-protocol-pulse";
args = {
# Enable TCP socket for VMs pulseaudio clients
# Enable Unix or TCP socket for VMs pulseaudio clients
"server.address" = [
{
address = "tcp:0.0.0.0:${toString cfg.pulseaudioTcpPort}";
address =
if cfg.pulseaudioUseShmem then
"unix:${cfg.pulseaudioUnixSocketPath}"
else
"tcp:0.0.0.0:${toString cfg.pulseaudioTcpPort}";
"client.access" = "restricted";
}
];
Expand Down
2 changes: 1 addition & 1 deletion modules/disko/disko-ab-partitions.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
};
disko = {
# 8GB is the recommeneded minimum for ZFS, so we are using this for VMs to avoid `cp` oom errors.
memSize = 18432;
memSize = 25432;
imageBuilder = {
extraPostVM = lib.mkIf (config.ghaf.imageBuilder.compression == "zstd") ''
${pkgs.zstd}/bin/zstd --compress $out/*raw
Expand Down
Loading

0 comments on commit 99db384

Please sign in to comment.