Skip to content

Wine NSPA: Environment Variables && Feature Setup

jrdnjhnstn edited this page Jan 6, 2023 · 28 revisions

Setting up your environment for Wine-NSPA:

Most of Wine-NSPA's features are enabled or setup via Environment Variables, so in order to make use of them; you are required to have them set up, before running Wine-NSPA / your apps. Generally, the best way to do this is to simply setup Wine-NSPA's Environment globally / system-wide.

Why? because in order to have ease-of-use and desktop integration, you don't want to manually have to set them up every time you launch an app. ~ This is especially true when using .desktop files / launchers. The process is very simple. On my system, I set all of my desired Environment Variables in /etc/environment.

Here is what that looks like;

#
# This file is parsed by pam_env module
#
# Syntax: simple "KEY=VAL" pairs on separate lines
#

# Wine-NSPA
#
# Set the Wine-Prefix
WINEPREFIX=/home/ninez/Winebox/winebox-master
# Set wine path
WINEPATH="/usr/lib"
# Wine User & Wiseserver Threads
SRV_RT_POLICY=RR
WINE_RT_PRIO=80
WINE_RT_POLICY="RR"
# Wine, Ntdll & kernel Threads
NTDLL_RT_PRIO=5
NTDLL_RT_POLICY="RR"
# Esync/Fsync
WINEESYNC=1
WINEFSYNC=1
WINEFSYNC_SPINCOUNT=128
# Proton's Logical cpus override
WINE_LOGICAL_CPUS_AS_CORES=1
# Large Address Awareness
WINE_LARGE_ADDRESS_AWARE=1
# From Staging/Disable
STAGING_WRITECOPY=0
# don't use with staging writecopy
WINE_DISABLE_KERNEL_WRITEWATCH=1
# Preloader Remap Stack
WINEPRELOADREMAPSTACK='on-conflict'
# disable debugging/spam
WINEDEBUG=-all

this ensures that Wine-NSPA will run exactly how I want, regardless of how the app is started.

In my case, jackd is running with an RT priority of 90, and the highest wine-related jackd thread will be 86. Followed by the highest wine thread priorities being 80 (wineserver), and so on.

NOTE: In some cases, you may choose/need to Override an env variable. This can be done at the commandline, via scripts or by customizing .desktop files / launchers. Your override will take precedence over the gloaballly set env variable.