Skip to content

Commit

Permalink
ALVR update to 20.9.1 (native pipewire)
Browse files Browse the repository at this point in the history
  • Loading branch information
Faupi committed Jul 21, 2024
1 parent f481d28 commit 7d433d0
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 92 deletions.
84 changes: 0 additions & 84 deletions nixos/cfgs/go/vr/alvr-session.sh

This file was deleted.

9 changes: 1 addition & 8 deletions nixos/cfgs/go/vr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
environment.systemPackages = with pkgs; [
wlx-overlay-s # First time setup to run as `steam-run wlx-overlay-s`
# For ALVR util | TODO: Substitute in
# Used for the SteamVR util | TODO: Substitute in?
jq
moreutils # sponge
];
Expand All @@ -22,13 +22,6 @@
package = pkgs.alvr;
};

environment.etc."ALVR Session Handler" = {
# TODO: Set up auto link to ALVR config?
source = ./alvr-session.sh;
target = "alvr-session.sh";
mode = "0755";
};

# Patch to resolve issues with async reprojection
# https://wiki.nixos.org/wiki/VR#SteamVR
boot.kernelPatches = [
Expand Down
97 changes: 97 additions & 0 deletions pkgs/alvr/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# https://github.com/PassiveLemon/lemonix/blob/master/pkgs/alvr/default.nix

{ lib
, stdenv
, fetchzip
, fetchFromGitHub
, alsa-lib
, autoPatchelfHook
, brotli
, ffmpeg
, libdrm
, libGL
, libunwind
, libva
, libvdpau
, libxkbcommon
, nix-update-script
, openssl
, pipewire
, pulseaudio
, vulkan-loader
, wayland
, x264
, xorg
, xvidcore
, SDL2
}:
stdenv.mkDerivation (finalAttrs: {
pname = "alvr";
version = "20.9.1";

src = fetchzip {
url = "https://github.com/alvr-org/ALVR/releases/download/v${finalAttrs.version}/alvr_streamer_linux.tar.gz";
hash = "sha256-S8GeUskAqxzPqKC5XDiRDezV++vestlHLAzK001wkXQ=";
};

alvrSrc = fetchFromGitHub {
owner = "alvr-org";
repo = "ALVR";
rev = "v${finalAttrs.version}";
hash = "sha256-kw/UGh9nxZMVnvxyXV4CUm3HZegyjWolNoHHNindc5s=";
};

nativeBuildInputs = [
autoPatchelfHook
];

buildInputs = [
alsa-lib
libunwind
libva
libvdpau
vulkan-loader
pipewire
SDL2
];

runtimeDependencies = [
brotli
ffmpeg
libdrm
libGL
libxkbcommon
openssl
pipewire
pulseaudio
wayland
x264
xorg.libX11
xorg.libxcb
xorg.libXcursor
xorg.libXi
];

installPhase = ''
runHook preInstall
mkdir -p $out/share/applications
cp -r $src/* $out
install -Dm444 $alvrSrc/alvr/xtask/resources/alvr.desktop -t $out/share/applications
install -Dm444 $alvrSrc/resources/alvr.png -t $out/share/icons/hicolor/256x256/apps
runHook postInstall
'';

passthru.updateScript = nix-update-script { };

meta = with lib; {
description = "Stream VR games from your PC to your headset via Wi-Fi";
homepage = "https://github.com/alvr-org/ALVR/";
changelog = "https://github.com/alvr-org/ALVR/releases/tag/v${finalAttrs.version}";
license = licenses.mit;
maintainers = with maintainers; [ passivelemon ];
platforms = platforms.linux;
mainProgram = "alvr_dashboard";
};
})
1 change: 1 addition & 0 deletions pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
adjustor = pkgs.callPackage ./adjustor.nix { };
handheld-daemon = pkgs.callPackage ./handheld-daemon.nix { };

alvr = pkgs.callPackage ./alvr { };
cad-blender = pkgs.callPackage ./cad-blender.nix { };
cura = pkgs.callPackage ./cura.nix { };
minecraft-server-fabric_1_20_4 = pkgs.callPackage ./minecraft-server-fabric_1_20_4.nix { };
Expand Down

2 comments on commit 7d433d0

@appsforartists
Copy link

Choose a reason for hiding this comment

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

Interesting - you got ALVR working in NixOS on the Go?

PCVR is the only thing I use Windows for. If I could easily connect my Quest to the Go and have perf on-par or better with Steam Link, I might not need Windows at all.

@Faupi
Copy link
Owner Author

@Faupi Faupi commented on 7d433d0 Nov 17, 2024

Choose a reason for hiding this comment

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

Interesting - you got ALVR working in NixOS on the Go?

PCVR is the only thing I use Windows for. If I could easily connect my Quest to the Go and have perf on-par or better with Steam Link, I might not need Windows at all.

I think the base source was taken from discussions at NixOS/nixpkgs#308097, in this case I just updated the source. I haven't used ALVR on the Go much, but generally I've noticed quite a lot of "viewport lag" possibly due to the massive overload on the iGPU (this was namely on VRChat) - have yet to test this on an eGPU. But using ALVR on the NixOS Go with my Quest 2 worked pretty well overall, as long as the application was relatively lightweight.
With SteamVR on Linux nowadays it seems to be easier to run, but VR on AMD seems to still need a few tweaks, and especially on Wayland, the desktop control in VR is a little tricky, but wlx-overlay-s (also packaged in nix) worked pretty well.

EDIT: The first part with link is irrelevant, I mistook it, it's been a while and I didn't really pay attention to what exactly this related to haha - rest still applies though! I do want to revisit VR on NixOS Go sometime, I just don't have much time for it lately.

Please sign in to comment.