Skip to content

Commit

Permalink
Shared memory refactoring. Now gui sent via shm
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 Mar 5, 2025
1 parent b4bcdb6 commit 33457f6
Show file tree
Hide file tree
Showing 10 changed files with 390 additions and 192 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 = false;
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
Loading

0 comments on commit 33457f6

Please sign in to comment.