Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pulseaudio direct connection #852

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 5 additions & 14 deletions modules/microvm/virtualization/microvm/common/ghaf-audio.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ let
audiovmHost = "audio-vm";
audiovmPort = config.ghaf.services.audio.pulseaudioTcpPort;
address = "tcp:${audiovmHost}:${toString audiovmPort}";
reconnectMs = 1000;
in
{
options.ghaf.ghaf-audio = with lib; {
Expand All @@ -26,19 +25,11 @@ in
};

config = lib.mkIf cfg.enable {
security.rtkit.enable = true;
users.extraUsers.ghaf.extraGroups = [
"audio"
"video"
];

hardware.pulseaudio = {
enable = true;
extraConfig = ''
load-module module-tunnel-sink-new sink_name=${cfg.name}.speaker server=${address} reconnect_interval_ms=${toString reconnectMs}
load-module module-tunnel-source-new source_name=${cfg.name}.mic server=${address} reconnect_interval_ms=${toString reconnectMs}
'';
package = pkgs.pulseaudio-ghaf;
environment = {
systemPackages = [ pkgs.pulseaudio ];
sessionVariables = rec {
PULSE_SERVER = "${address}";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should be an option, as some applications do not respect/read this environment variable and just connect to localhost.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good comment, yes that was one of the original reasons for the previous implementation.
There were some complaints that with the earlier setup the TCP tunnel remains open after the application is closed.

};
};
};
}
1 change: 0 additions & 1 deletion overlays/custom-packages/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
open-normal-extension = final.callPackage ../../packages/open-normal-extension { };
gtklock = import ./gtklock { inherit prev; };
hardware-scan = final.callPackage ../../packages/hardware-scan { };
pulseaudio-ghaf = import ./pulseaudio { inherit prev; };
globalprotect-openconnect =
final.libsForQt5.callPackage ../../packages/globalprotect-openconnect
{ };
Expand Down
7 changes: 0 additions & 7 deletions overlays/custom-packages/pulseaudio/default.nix

This file was deleted.

This file was deleted.