FWGS / xash3d-fwgs

Xash3D FWGS engine
1.59k stars 242 forks source link

Instantly closes on Aarch64 Linux #207

Closed parkerlreed closed 4 years ago

parkerlreed commented 4 years ago

Arch Linux Aaarch64 xash3d-hlsdk r458.d7509365-1 xash3d-git r1260.065811c-1

Everything seems to be placed right. User has access to the valve folder. The executable loads a window for a split second and just closes out with no errors printed.

strace log xash.txt

[parker@alarm ~]$ ls /opt/valve/
1024_textscheme.txt  cached.wad   dlls                  game.tga      liquids.wad       models        skill.cfg          steamcomm.lst  xeno.wad
1152_textscheme.txt  cl_dlls      events                gfx           listenserver.cfg  overviews     sound              steam.inf
1280_textscheme.txt  config.cfg   fonts.wad             gfx.wad       logos             resource      spectatormenu.txt  titles.txt
1600_textscheme.txt  credits.txt  game.icns             halflife.wad  mapcycle.txt      SAVE          spectcammenu.txt   user.scr
640_textscheme.txt   decals.wad   game.ico              hw            maps              scripts       spraypaint.wad     valvecomm.lst
800_textscheme.txt   default.cfg  gameinfo.txt          language.cfg  maps.lst          server.cfg    sprites            valve.rc
autoexec.cfg         delta.lst    GameServerConfig.vdf  liblist.gam   media             settings.scr  steam_appid.txt    violence.cfg
[parker@alarm xash3d-git]$ pacman -Ql xash3d-hlsdk 
xash3d-hlsdk /usr/
xash3d-hlsdk /usr/lib/
xash3d-hlsdk /usr/lib/valve/
xash3d-hlsdk /usr/lib/valve/cl_dlls/
xash3d-hlsdk /usr/lib/valve/cl_dlls/client_arm64.so
xash3d-hlsdk /usr/lib/valve/dlls/
xash3d-hlsdk /usr/lib/valve/dlls/hl_arm64.so
[parker@alarm xash3d-git]$ pacman -Ql xash3d-git 
xash3d-git /etc/
xash3d-git /etc/conf.d/
xash3d-git /etc/conf.d/xash3d
xash3d-git /usr/
xash3d-git /usr/bin/
xash3d-git /usr/bin/xash3d
xash3d-git /usr/bin/xash3d-dedicated
xash3d-git /usr/lib/
xash3d-git /usr/lib/xash3d/
xash3d-git /usr/lib/xash3d/libmenu.so
xash3d-git /usr/lib/xash3d/libref_gl.so
xash3d-git /usr/lib/xash3d/libref_soft.so
xash3d-git /usr/lib/xash3d/libxash.so
xash3d-git /usr/lib/xash3d/xash
xash3d-git /usr/lib/xash3d/xash3d
xash3d-git /usr/share/
xash3d-git /usr/share/applications/
xash3d-git /usr/share/applications/xash3d.desktop
xash3d-git /usr/share/pixmaps/
xash3d-git /usr/share/pixmaps/xash3d.png
xash3d-git /usr/share/xash3d/
xash3d-git /usr/share/xash3d/extras.pak
[parker@alarm xash3d-git]$ cat /etc/conf.d/xash3d 
# Set here the path where valve folder is placed 
export XASH3D_BASEDIR="/opt"

# Don't move it if you don't know what does it mean
export LD_LIBRARY_PATH+="/usr/lib/xash3d"

# Path for extras.pak
export XASH3D_EXTRAS_PAK1="/usr/share/xash3d/extras.pak"

[parker@alarm xash3d-git]$ cat /usr/bin/xash3d
#!/bin/sh
. /etc/conf.d/xash3d

DEFAULT_LIBPATH=/usr/lib

if [ ! -d "$XASH3D_BASEDIR" ]; then
    echo "$XASH3D_BASEDIR not found"
    exit 1
fi

#if [ $(uname -m) == "x86_64" ]; then 
#       if [ ! -f "$XASH3D_BASEDIR/valve/dlls/hl_amd64.so" ]; then
#       ln -sr $DEFAULT_LIBPATH/valve/dlls/hl_amd64.so "$XASH3D_BASEDIR"/valve/dlls/hl_amd64.so
#       ln -sr $DEFAULT_LIBPATH/valve/cl_dlls/client_amd64.so "$XASH3D_BASEDIR"/valve/cl_dlls/client_amd64.so
#       fi
#else 
        if [ ! -f "$XASH3D_BASEDIR/valve/dlls/hl.so" ]; then
        ln -sr $DEFAULT_LIBPATH/valve/dlls/hl_aarch64.so "$XASH3D_BASEDIR"/valve/dlls/hl.so
        ln -sr $DEFAULT_LIBPATH/valve/cl_dlls/client_aarch64.so "$XASH3D_BASEDIR"/valve/cl_dlls/client.so
        fi
#fi

$DEFAULT_LIBPATH/xash3d/xash3d "$@"
[parker@alarm xash3d-git]$ xash3d
parkerlreed commented 4 years ago

@a1batross I see it noted on the port status that Android/Linux (aarch64) is still in dev. Is there a place I can see the activity for this?

nekonomicon commented 4 years ago

We did not maintain Arch linux and Arch package maintainer probably made some mistakes. As an example Arch linux package for x86 does not have vgui_support library. For arm need to compile xash3d with nanogl/OpenGL ES support and to have SDL2 library compiled with OpenGL ES support, but package was compiled with OpenGL support.

a1batross commented 4 years ago

1) Don't really use Arch Linux AUR package. It's outdated and was never tested for ARM. I've removed Arch Linux package recommendatation from README.md now. 2) Compile it from the sources enabling NanoGL/gl-wes-v2 support which will you GLES1 and GLES2 renderers. I don't think your board has OpenGL, it's rare for ARM boards. 3) Thanks for posting strace log, but engine can write log by itself by passing -dev 2 -log to command line.

parkerlreed commented 4 years ago

Thanks. The board I was testing on does have full OpenGL 4.6 (Nintendo Switch with Tegra X1. Same drivers as the Jetson Nano)

So in that case do I need to just do a normal compile? That's why I thought the AUR packages would work.

I see the notes about regular x86. Does it need 32bit on ARM as well or does the ARM 64bit support work for the Steam data files?

nekonomicon commented 4 years ago

I see the notes about regular x86. Does it need 32bit on ARM as well or does the ARM 64bit support work for the Steam data files?

Nope. Steam files does not have libraries for 32bit arm. You need to compile libraries from hlsdk-xash3d yet.

parkerlreed commented 4 years ago

Yeah that was part of the AUR package routine.

Do I just need to try that manually and see how it goes?

parkerlreed commented 4 years ago

Ok so cloned xash3d and hlsdk. Built both with the default waf.

Changed to the game folder

[parker@alarm valve]$ cp ~/build/hlsdk-xash3d/build/dlls/hl_arm64.so dlls/hl.so 
[parker@alarm valve]$ cp ~/build/hlsdk-xash3d/build/cl_dll/client_arm64.so cl_dlls/client.so 
[parker@alarm valve]$ cp ~/halflife/lib/xash3d/xash3d .
[parker@alarm valve]$ cp -R ~/halflife/lib/ .
[parker@alarm valve]$ export LD_LIBRARY_PATH+="/opt/valve/lib/xash3d"
[parker@alarm valve]$ export XASH3D_BASEDIR="/opt"
[parker@alarm valve]$ ./xash3d -dev 2 -log
[16:06:13] Console initialized.

[16:06:14] /opt is working directory now
[16:06:14] Error: Sys_InitLog: can't create log file engine.log
Ver: Xash3D FWGS 0.20 (build 1962-3f3160e, linux-arm64)
Crash: signal 11 errno 0 with code 1 at (nil) 0x7fc5901370
Ver: Xash3D FWGS 0.20 (build 1962-3f3160e, linux-arm64)
Crash: signal 11 errno 0 with code 1 at (nil) 0x7fc5901370
Stack backtrace:
Stack backtrace:
 1: 0x7f89c54844 <fwrite+28> (/usr/lib/libc.so.6)
 1: 0x7f89c54844 <fwrite+28> (/usr/lib/libc.so.6)
Stack dump:
Stack dump:
[16:06:14] Ver: Xash3D FWGS 0.20 (build 1962-3f3160e, linux-arm64)
Crash: signal 11 errno 0 with code 1 at (nil) 0x7fc5901370
Stack backtrace:
 1: 0x7f89c54844 <fwrite+28> (/usr/lib/libc.so.6)
Stack dump:
parkerlreed commented 4 years ago

I think I missed the recursive clone of fwgs. Recompiling now

parkerlreed commented 4 years ago

Ok finally got it working. It was a combination of missing the recursive checkout and the hl and client needing the arm64 suffix. It was crashing out because it was looking for client_arm64.so and hl_arm64.so specifically instead of the generic names.

parkerlreed commented 4 years ago

Thanks for the help.