You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Terraria on AYN Odin 3: 60 FPS and no save crash (config + two GameNative bugs)
#2243
Terraria (Steam) is rated "Unreliable" on the AYN Odin 3, and with the known config it ran at 25–28 FPS in-game and crashed when saving and quitting. With the config below it holds 60 FPS in-game and saves and quits cleanly.
Device: AYN Odin 3 (Snapdragon 8 Elite, Adreno 830), Android 15, GameNative 1.3.0 Container: bionic, proton-10.0-4-x86_64, Box64 0.3.8, graphics driver wrapper (Turnip), everything else as the known config sets it
Low FPS. Terraria runs on Wine Mono with FNA as a 32-bit WoW64 process, so box64 emulates all of the JIT-compiled game code. FNA draws through Vulkan directly (FNA3D → winevulkan), so the DX wrapper doesn't matter for this game. In-game, the main thread sat at 99% on the prime cores while the GPU was at 4–9%. The known config uses the Compatibility preset (STRONGMEM=1, BIGBLOCK=0, CALLRET=0). Performance takes it from 25–28 FPS to 60 FPS.
Crash on save and quit. The Wine log shows err:virtual:allocate_virtual_memory out of memory for allocation. With a world loaded, the Mono heap is about 1.1 GB (major + LOS), and saving needs more on top, so the 32-bit address space runs out. Proton forces large address awareness by default (PROTON_FORCE_LARGE_ADDRESS_AWARE), but GameNative starts wine directly, so it never gets set. WINE_LARGE_ADDRESS_AWARE=1 fixes it.
Why BOX64_MMAP32=0 and WRAPPER_DISABLE_PLACED=0 are needed. The Performance and Intermediate presets set BOX64_MMAP32=1. BionicProgramLauncherComponent then sets WRAPPER_DISABLE_PLACED=1 for non-arm64ec wine, and it does that before the container env vars are merged in. With placed memory disabled, Terraria crashes at startup on a black screen:
fixme:vulkan:wine_vkMapMemory2KHR returned mapping 0x7b079e2000 does not fit 32-bit pointer
wine: Unhandled page fault on write access to 00000030 ...
Overriding only BOX64_MMAP32=0 in the container is not enough, because WRAPPER_DISABLE_PLACED=1 has already been set by then. Both overrides are needed. This probably affects every 32-bit Vulkan game where someone picks Performance or Intermediate.
Mono settings.MONO_THREADS_SUSPEND=coop and MONO_DEBUG=keep-delegates come from the Madeira port's Terraria work (willfaust/Madeira#206, willfaust/wine#26), where Mono's hybrid suspend and a collected delegate crashed Terraria under emulation. I did not catch a crash on Android that they prevent, so treat them as optional.
Suggestions for GameNative
Set WINE_LARGE_ADDRESS_AWARE=1 by default, the way Proton does.
Decide WRAPPER_DISABLE_PLACED after the container env vars are merged, or let a container override it.
Update the Terraria known config for the Odin 3 to the config above.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Terraria (Steam) is rated "Unreliable" on the AYN Odin 3, and with the known config it ran at 25–28 FPS in-game and crashed when saving and quitting. With the config below it holds 60 FPS in-game and saves and quits cleanly.
Device: AYN Odin 3 (Snapdragon 8 Elite, Adreno 830), Android 15, GameNative 1.3.0
Container: bionic, proton-10.0-4-x86_64, Box64 0.3.8, graphics driver wrapper (Turnip), everything else as the known config sets it
Working config
Emulation tab:
Environment tab (add these):
Why
Low FPS. Terraria runs on Wine Mono with FNA as a 32-bit WoW64 process, so box64 emulates all of the JIT-compiled game code. FNA draws through Vulkan directly (FNA3D → winevulkan), so the DX wrapper doesn't matter for this game. In-game, the main thread sat at 99% on the prime cores while the GPU was at 4–9%. The known config uses the Compatibility preset (STRONGMEM=1, BIGBLOCK=0, CALLRET=0). Performance takes it from 25–28 FPS to 60 FPS.
Crash on save and quit. The Wine log shows
err:virtual:allocate_virtual_memory out of memory for allocation. With a world loaded, the Mono heap is about 1.1 GB (major + LOS), and saving needs more on top, so the 32-bit address space runs out. Proton forces large address awareness by default (PROTON_FORCE_LARGE_ADDRESS_AWARE), but GameNative starts wine directly, so it never gets set.WINE_LARGE_ADDRESS_AWARE=1fixes it.Why
BOX64_MMAP32=0andWRAPPER_DISABLE_PLACED=0are needed. The Performance and Intermediate presets setBOX64_MMAP32=1.BionicProgramLauncherComponentthen setsWRAPPER_DISABLE_PLACED=1for non-arm64ec wine, and it does that before the container env vars are merged in. With placed memory disabled, Terraria crashes at startup on a black screen:Overriding only
BOX64_MMAP32=0in the container is not enough, becauseWRAPPER_DISABLE_PLACED=1has already been set by then. Both overrides are needed. This probably affects every 32-bit Vulkan game where someone picks Performance or Intermediate.Mono settings.
MONO_THREADS_SUSPEND=coopandMONO_DEBUG=keep-delegatescome from the Madeira port's Terraria work (willfaust/Madeira#206, willfaust/wine#26), where Mono's hybrid suspend and a collected delegate crashed Terraria under emulation. I did not catch a crash on Android that they prevent, so treat them as optional.Suggestions for GameNative
WINE_LARGE_ADDRESS_AWARE=1by default, the way Proton does.WRAPPER_DISABLE_PLACEDafter the container env vars are merged, or let a container override it.All reactions