Skip to content

Commit f480c1b

Browse files
gngramjkuro-tii
authored andcommitted
Shared memory refactoring. Now gui sent via shm
Signed-off-by: Jaroslaw Kurowski <[email protected]>
1 parent 32897a3 commit f480c1b

File tree

13 files changed

+437
-215
lines changed

13 files changed

+437
-215
lines changed

modules/common/services/audio.nix

+16-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ in
2929
default = 4714;
3030
description = "TCP port used by Pipewire-pulseaudio control";
3131
};
32+
pulseaudioUnixSocketPath = mkOption {
33+
type = types.path;
34+
default = "/run/pipewire/pulseaudio-0";
35+
description = "Path to Unix socket used by Pipewire-pulseaudio service";
36+
};
37+
pulseaudioUseShmem = mkOption {
38+
type = types.bool;
39+
default = false;
40+
description = "Use shared memory for audio service";
41+
};
3242
};
3343

3444
config = mkIf cfg.enable {
@@ -46,10 +56,14 @@ in
4656
{
4757
name = "libpipewire-module-protocol-pulse";
4858
args = {
49-
# Enable TCP socket for VMs pulseaudio clients
59+
# Enable Unix or TCP socket for VMs pulseaudio clients
5060
"server.address" = [
5161
{
52-
address = "tcp:0.0.0.0:${toString cfg.pulseaudioTcpPort}";
62+
address =
63+
if cfg.pulseaudioUseShmem then
64+
"unix:${cfg.pulseaudioUnixSocketPath}"
65+
else
66+
"tcp:0.0.0.0:${toString cfg.pulseaudioTcpPort}";
5367
"client.access" = "restricted";
5468
}
5569
];

0 commit comments

Comments
 (0)