ptitSeb
Posts: 135
Joined: Tue May 19, 2015 2:49 pm

Re: Xash3D Engine on Raspberry Pi

Thu Feb 18, 2016 9:09 am

Not much useful info I'm afraid.

Only thing I notice that is strange for me is the error at the dlopen. It seems to not be able to open libs on 1st try but succeed on second try. That's odd, and I'm quite sure to not have this behavior on the Pandora. I have to check in the code to understand what may be happening here.

CockPitt
Posts: 108
Joined: Tue Jun 02, 2015 1:29 pm

Re: Xash3D Engine on Raspberry Pi

Fri Feb 19, 2016 3:16 pm

I managed to install SDL2 in another directory so I won't mess up GLES/GLES2 but I think xash3d is fixed on one specific directory is there a way to change the path?

Code: Select all

pi@raspberrypi:~/Downloads/Half-Life-Repos/xash3d $ cmake . -DRPI=ON -DXASH_SDL=ON -DXASH_VGUI=OFF -DHL_SDK_DIR=hlsdk/ -DCMAKE_C_FLAGS="-mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon -funsafe-math-optimizations" -DCMAKE_CXX_FLAGS="-mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon -funsafe-math-optimizations"
<FindSDL2.cmake>
</FindSDL2.cmake>
CMake Error at /usr/share/cmake-3.0/Modules/FindPackageHandleStandardArgs.cmake:136 (message):
  Could NOT find SDL2 (missing: SDL2_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.0/Modules/FindPackageHandleStandardArgs.cmake:343 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindSDL2.cmake:172 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  engine/CMakeLists.txt:71 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/pi/Downloads/Half-Life-Repos/xash3d/CMakeFiles/CMakeOutput.log".
See also "/home/pi/Downloads/Half-Life-Repos/xash3d/CMakeFiles/CMakeError.log".

moocow1452
Posts: 26
Joined: Wed Apr 04, 2012 10:03 pm

Re: Xash3D Engine on Raspberry Pi

Fri Feb 19, 2016 7:11 pm

I wonder if the new OpenGL drivers for Pi 2 will make Xash perform better than having to work around GLShim?

CockPitt
Posts: 108
Joined: Tue Jun 02, 2015 1:29 pm

Re: Xash3D Engine on Raspberry Pi

Fri Feb 19, 2016 11:58 pm

I think user ktb has already played with VC4 driver:
I played up through most of "We've Got Hostiles!" It sometimes crashes, but I just start it up again and load the last auto-saved game. The whole game intro played well. The sound can get choppy, garbled and full of static. Restarting the game every once in a while can improve the sound issues, but the sound doesn't work very well in general. Multiplayer doesn't seem to work -- I only tried once, but it crashed shortly after joining and starting a game. Also, the in-game console doesn't seem to work (pressing the [`/~] key), the console slides down, but I am unable to type anything into it. Maybe I'm doing something wrong, I'm not that familiar with the game.
I also tried it today. But activating the OpenGL driver didn't work so well for me. My screen just looks absolutley strange and distorted. And any program I start crashes. I'm going to play around with resolution maybe that helps.

CockPitt
Posts: 108
Joined: Tue Jun 02, 2015 1:29 pm

Re: Xash3D Engine on Raspberry Pi

Tue Feb 23, 2016 5:32 pm

I've changed my OS again. It's still Raspbian Jessie but the newest version with the experimental vc4 driver which doesn't work with my screen I guess. So it's deactivated. At the moment I'm writing a step by step guide but I just can't get this to work again. Trying to start the game outputs this:

Code: Select all

pi@raspberrypi:~/Half-Life $ LIBGL_FB=1 LIBGL_BATCH=1 LD_LIBRARY_PATH=/opt/vc/lib:/home/pi/glshim/lib:. ./xash3d -console -debug
[18:24:49] /home/pi/Half-Life is working directory now
================================================================================
	 (build 3224) started at Feb23 2016 [18:24.49]
================================================================================

================================================================================
	 (build 3224) fallback to dedicated mode
 at Feb23 2016 [18:24.51]
================================================================================
[18:24:51] /home/pi/Half-Life is working directory now
================================================================================
	 (build 3224) started at Feb23 2016 [18:24.51]
================================================================================
[18:24:53] execing server.cfg
[18:24:53] Please add "defaultmap" cvar with default map name to your server.cfg!
[18:24:53] Server IP address: 127.0.1.1:27015
[18:24:53] execing config.cfg
It stays there forever so I always have to Ctrl+C it.

Adding a default map to the server.cfg doesn't work either:

Code: Select all

pi@raspberrypi:~/Half-Life $ LIBGL_FB=1 LIBGL_BATCH=1 LD_LIBRARY_PATH=/opt/vc/lib:/home/pi/glshim/lib:. ./xash3d -console -debug
[18:32:30] /home/pi/Half-Life is working directory now
================================================================================
	 (build 3224) started at Feb23 2016 [18:32.30]
================================================================================

================================================================================
	 (build 3224) fallback to dedicated mode
 at Feb23 2016 [18:32.32]
================================================================================
[18:32:32] /home/pi/Half-Life is working directory now
================================================================================
	 (build 3224) started at Feb23 2016 [18:32.32]
================================================================================
[18:32:34] execing server.cfg
[18:32:34] Server IP address: 127.0.1.1:27015
[18:32:34] ^3Warning:^7 loading library dlls/hl_i386.so: valve/dlls/hl_i386.so: cannot open shared object file: No such file or directory
[18:32:34] ^1Error:^7 SV_InitGame: can't initialize "dlls/hl_i386.so"
[18:32:34] execing config.cfg

ptitSeb
Posts: 135
Joined: Tue May 19, 2015 2:49 pm

Re: Xash3D Engine on Raspberry Pi

Fri Feb 26, 2016 9:27 pm

@CockPitt: I think you didn't compiled xash with the correct flags (I don't think RPI build is activated).

CockPitt
Posts: 108
Joined: Tue Jun 02, 2015 1:29 pm

Re: Xash3D Engine on Raspberry Pi

Fri Feb 26, 2016 10:37 pm

I used these, they worked before:
Build xash3d:

Code: Select all

cd ~
git clone https://github.com/SDLash3D/xash3d
git clone https://github.com/ptitSeb/halflife
cp -a halflife/. xash3d/hlsdk/
cd xash3d
cmake . -DRPI=ON -DXASH_SDL=ON -DXASH_VGUI=OFF -DHL_SDK_DIR=hlsdk/ -DCMAKE_C_FLAGS="-mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon -funsafe-math-optimizations" -DCMAKE_CXX_FLAGS="-mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon -funsafe-math-optimizations"
make -j4
cp engine/libxash.so /home/pi/Half-Life
cp mainui/libxashmenu.so /home/pi/Half-Life
cp game_launch/xash3d /home/pi/Half-Life
Now make hl.so:

Code: Select all

cd hlsdk/dlls
make -f Makefile.rpi -j4
cp hl.so /home/pi/Half-Life
Build XashXT:

Code: Select all

cd ~
git clone https://github.com/ptitSeb/XashXT
cd XashXT/client
make -f Makefile.rpi -j4
cp client.so /home/pi/Half-Life
-DRPI=ON wasn't activated so I changed it with ccmake, but after recompiling the game still won't start.

ptitSeb
Posts: 135
Joined: Tue May 19, 2015 2:49 pm

Re: Xash3D Engine on Raspberry Pi

Sat Feb 27, 2016 9:20 am

@CockPitt: what output do you have?

CockPitt
Posts: 108
Joined: Tue Jun 02, 2015 1:29 pm

Re: Xash3D Engine on Raspberry Pi

Sat Feb 27, 2016 6:14 pm

Half-Life outputs the same like before:

Code: Select all

pi@raspberrypi:~/Half-Life $ LIBGL_FB=1 LIBGL_BATCH=1 LD_LIBRARY_PATH=/opt/vc/lib:/home/pi/glshim/lib:. ./xash3d -console -debug
[19:07:21] /home/pi/Half-Life is working directory now
================================================================================
	 (build 3224) started at Feb27 2016 [19:07.21]
================================================================================

================================================================================
	 (build 3224) fallback to dedicated mode
 at Feb27 2016 [19:07.23]
================================================================================
[19:07:23] /home/pi/Half-Life is working directory now
================================================================================
	 (build 3224) started at Feb27 2016 [19:07.23]
================================================================================
[19:07:25] execing server.cfg
[19:07:25] Server IP address: 127.0.1.1:27015
[19:07:25] ^3Warning:^7 loading library dlls/hl_i386.so: valve/dlls/hl_i386.so: cannot open shared object file: No such file or directory
[19:07:25] ^1Error:^7 SV_InitGame: can't initialize "dlls/hl_i386.so"
[19:07:25] execing config.cfg
I believe the output of cmake looks different from what I've seen on my older oses (This it how it looks like with a brand new repo):

Code: Select all

pi@raspberrypi:~/xash3d $ cmake . -DRPI=ON -DXASH_SDL=ON -DXASH_VGUI=OFF -DHL_SDK_DIR=hlsdk/ -DCMAKE_C_FLAGS="-mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon -funsafe-math-optimizations" -DCMAKE_CXX_FLAGS="-mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon -funsafe-math-optimizations"
-- The C compiler identification is GNU 4.9.2
-- The CXX compiler identification is GNU 4.9.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
<FindSDL2.cmake>
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
</FindSDL2.cmake>
-- Found SDL2: /usr/local/lib/libSDL2main.a;/usr/local/lib/libSDL2.so;-lpthread  
<FindSDL2.cmake>
</FindSDL2.cmake>
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    RPI


-- Build files have been written to: /home/pi/xash3d
pi@raspberrypi:~/xash3d $ 
Maybe there's something wrong with that.

ptitSeb
Posts: 135
Joined: Tue May 19, 2015 2:49 pm

Re: Xash3D Engine on Raspberry Pi

Sun Feb 28, 2016 10:50 am

@CockPitt: strange, RPI should be used. Is it my repo that you are using for Xash3D ?
Try using the interactive "ccmake" instead of "cmake" and see if RPI is in the list.

CockPitt
Posts: 108
Joined: Tue Jun 02, 2015 1:29 pm

Re: Xash3D Engine on Raspberry Pi

Sun Feb 28, 2016 7:38 pm

Sorry, I'm an idiot. I was using the native repo (https://github.com/SDLash3D/xash3d) and not your fork :oops:
It works fine now. I also noticed that if you start loading a game and your gpu memory is too little (less than 128mb I think) you get an "glGetError 0x505" error.

CockPitt
Posts: 108
Joined: Tue Jun 02, 2015 1:29 pm

Re: Xash3D Engine on Raspberry Pi

Mon Feb 29, 2016 9:14 pm

@ptitSeb

About SDL2,
I don't want to mess up GLES for Half-Life anymore. I configured SDL2 and SDL2_image with a specific directory (--prefix=/home/pi/SDL2GL/) but trying to build xash3d won't work.

Code: Select all

pi@raspberrypi:~/xash3d $ cmake . -DRPI=ON -DXASH_SDL=ON -DXASH_VGUI=OFF -DHL_SDK_DIR=hlsdk/ -DCMAKE_C_FLAGS="-mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon -funsafe-math-optimizations" -DCMAKE_CXX_FLAGS="-mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon -funsafe-math-optimizations"
-- checking for one of the modules 'sdl2'
CMake Error at /usr/share/cmake-3.0/Modules/FindPkgConfig.cmake:425 (message):
  None of the required 'sdl2' found
Call Stack (most recent call first):
  engine/CMakeLists.txt:87 (pkg_search_module)


-- checking for one of the modules 'SDL2_image'
CMake Error at /usr/share/cmake-3.0/Modules/FindPkgConfig.cmake:425 (message):
  None of the required 'SDL2_image' found
Call Stack (most recent call first):
  engine/CMakeLists.txt:88 (pkg_search_module)


-- checking for one of the modules 'sdl2'
CMake Error at /usr/share/cmake-3.0/Modules/FindPkgConfig.cmake:425 (message):
  None of the required 'sdl2' found
Call Stack (most recent call first):
  game_launch/CMakeLists.txt:42 (pkg_search_module)


-- Configuring incomplete, errors occurred!
See also "/home/pi/xash3d/CMakeFiles/CMakeOutput.log".
I renamed SDL2GL to SDL2 but still no changes.
Any idea?
Here is CMakeOutput.log just in case you need it: http://pastebin.com/W0TrzB8w

ptitSeb
Posts: 135
Joined: Tue May 19, 2015 2:49 pm

Re: Xash3D Engine on Raspberry Pi

Tue Mar 01, 2016 10:30 am

@CockPitt: try to use ccmake instead of cmake, and type "t" to go to advanced option. You should be able to overide all folder / libs there...

CockPitt
Posts: 108
Joined: Tue Jun 02, 2015 1:29 pm

Re: Xash3D Engine on Raspberry Pi

Tue Mar 01, 2016 4:25 pm

@ptitSeb: Which libs shall I overwrite? I tried a few but either SDL2 + SDL2_image is not found or c++ and cc are missing.
ccmake looks like this: http://imgur.com/i0EWk9H&4dJsQLa

ptitSeb
Posts: 135
Joined: Tue May 19, 2015 2:49 pm

Re: Xash3D Engine on Raspberry Pi

Wed Mar 02, 2016 9:34 am

@CockPitt: indeed, it's not there.
Maybe it will be better to use the PKG_CONFIG_PATH variable and the PATH variable (for sdl2-config).
Add the sdl2/bin to your PATH and sdl2_image/lib/pgk-config to your PKG_CONFIG_PATH variable before launching cmake. It should help find the libs.

CockPitt
Posts: 108
Joined: Tue Jun 02, 2015 1:29 pm

Re: Xash3D Engine on Raspberry Pi

Wed Mar 02, 2016 7:46 pm

I don't know whether I interpreted your instructions right or not. I set "PATH=/home/pi/SDL2GL/bin" and "PKG_CONFIG_PATH=/home/pi/SDL2GL/lib/pgk-config". cmake didn't work after that, so I had to run it with "/usr/bin/cmake" but the output didn't change.

Code: Select all

pi@raspberrypi:~/xash3d $ PATH=/home/pi/SDL2GL/bin
pi@raspberrypi:~/xash3d $ PKG_CONFIG_PATH=/home/pi/SDL2GL/lib/pgk-config
pi@raspberrypi:~/xash3d $ cmake . -DRPI=ON -DXASH_SDL=ON -DXASH_VGUI=OFF -DHL_SDK_DIR=hlsdk/ -DCMAKE_C_FLAGS="-mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon -funsafe-math-optimizations" -DCMAKE_CXX_FLAGS="-mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon -funsafe-math-optimizations"
bash: cmake: command not found
pi@raspberrypi:~/xash3d $ /usr/bin/cmake . -DRPI=ON -DXASH_SDL=ON -DXASH_VGUI=OFF -DHL_SDK_DIR=hlsdk/ -DCMAKE_C_FLAGS="-mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon -funsafe-math-optimizations" -DCMAKE_CXX_FLAGS="-mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon -funsafe-math-optimizations"-- checking for one of the modules 'sdl2'
CMake Error at /usr/share/cmake-3.0/Modules/FindPkgConfig.cmake:425 (message):
  None of the required 'sdl2' found
Call Stack (most recent call first):
  engine/CMakeLists.txt:87 (pkg_search_module)


-- checking for one of the modules 'SDL2_image'
CMake Error at /usr/share/cmake-3.0/Modules/FindPkgConfig.cmake:425 (message):
  None of the required 'SDL2_image' found
Call Stack (most recent call first):
  engine/CMakeLists.txt:88 (pkg_search_module)


-- checking for one of the modules 'sdl2'
CMake Error at /usr/share/cmake-3.0/Modules/FindPkgConfig.cmake:425 (message):
  None of the required 'sdl2' found
Call Stack (most recent call first):
  game_launch/CMakeLists.txt:42 (pkg_search_module)


-- Configuring incomplete, errors occurred!
See also "/home/pi/xash3d/CMakeFiles/CMakeOutput.log".
pi@raspberrypi:~/xash3d $ 

ptitSeb
Posts: 135
Joined: Tue May 19, 2015 2:49 pm

Re: Xash3D Engine on Raspberry Pi

Thu Mar 03, 2016 9:44 am

@CockPitt, you have to do
"PATH=/home/pi/SDL2GL/bin:$PATH" and "PKG_CONFIG_PATH=/home/pi/SDL2GL/lib/pgk-config:$PKG_CONFIG_PATH" or it will not work indeed. PATH is an important environnement variable that contain many things (do a "echo $PATH" to have an idea).

CockPitt
Posts: 108
Joined: Tue Jun 02, 2015 1:29 pm

Re: Xash3D Engine on Raspberry Pi

Thu Mar 03, 2016 4:01 pm

Hmm, seems like that makes no difference.

Code: Select all

pi@raspberrypi:~/xash3d $ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
pi@raspberrypi:~/xash3d $ PATH=/home/pi/SDL2GL/bin:$PATH
pi@raspberrypi:~/xash3d $ PKG_CONFIG_PATH=/home/pi/SDL2GL/lib/pgk-config:$PKG_CONFIG_PATH
pi@raspberrypi:~/xash3d $ echo $PATH
/home/pi/SDL2GL/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
pi@raspberrypi:~/xash3d $ cmake -DRPI=ON -DXASH_SDL=ON -DXASH_VGUI=OFF -DHL_SDK_DIR=hlsdk/ -DCMAKE_C_FLAGS="-mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon -funsafe-math-optimizations" -DCMAKE_CXX_FLAGS="-mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon -funsafe-math-optimizations"
-- checking for one of the modules 'sdl2'
CMake Error at /usr/share/cmake-3.0/Modules/FindPkgConfig.cmake:425 (message):
  None of the required 'sdl2' found
Call Stack (most recent call first):
  engine/CMakeLists.txt:87 (pkg_search_module)


-- checking for one of the modules 'SDL2_image'
CMake Error at /usr/share/cmake-3.0/Modules/FindPkgConfig.cmake:425 (message):
  None of the required 'SDL2_image' found
Call Stack (most recent call first):
  engine/CMakeLists.txt:88 (pkg_search_module)


-- checking for one of the modules 'sdl2'
CMake Error at /usr/share/cmake-3.0/Modules/FindPkgConfig.cmake:425 (message):
  None of the required 'sdl2' found
Call Stack (most recent call first):
  game_launch/CMakeLists.txt:42 (pkg_search_module)


-- Configuring incomplete, errors occurred!
See also "/home/pi/xash3d/CMakeFiles/CMakeOutput.log".
pi@raspberrypi:~/xash3d $ 

GAMELASTER
Posts: 35
Joined: Sat Feb 14, 2015 8:05 pm

Re: Xash3D Engine on Raspberry Pi

Sat Mar 05, 2016 7:21 pm

@ptitSeb
What status is of Xash3D on RPI2? Where can I found a Build instructions?

Thanks

CockPitt
Posts: 108
Joined: Tue Jun 02, 2015 1:29 pm

Re: Xash3D Engine on Raspberry Pi

Sun Mar 06, 2016 12:55 pm

@ptitSeb The step-by-step guide almost complete. But it seems like "ccmake Makefile.rpi" doesn't work. I'm pretty sure it worked before. Now it says the source is a file not a directory. http://imgur.com/8OyxHvI

@GAMELASTER
To answer your question, the Half-Life campaign works good. Only console isn't usable because it crashes the game. Multiplayer works quite well too. I'm going to release a step-by-step guide in a new thread in a few days. The only thing I have to add to the guide will boost the performance quite much. ptitSeb did an awesome job there.

GAMELASTER
Posts: 35
Joined: Sat Feb 14, 2015 8:05 pm

Re: Xash3D Engine on Raspberry Pi

Sun Mar 06, 2016 3:12 pm

@CockPitt
Well, I tried myself to build Xash3D, after a patch a bug from Xash3D (I already pulled a request with fix), I successfully builded all, but I cannot run it yet, because of Segmentation Fault! I builded a Debug version and here is backtrace:

Code: Select all

GNU gdb (Raspbian 7.7.1+dfsg-5) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./xash3d...done.
(gdb) r
Starting program: /home/pi/Half-Life/xash3d 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
[New Thread 0x745ab460 (LWP 8014)]
[New Thread 0x73d8f460 (LWP 8015)]
[New Thread 0x733ff460 (LWP 8016)]
[New Thread 0x72bff460 (LWP 8017)]
[New Thread 0x723ff460 (LWP 8018)]

Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
(gdb) bt full
#0  0x00000000 in ?? ()
No symbol table info available.
#1  0x747b7070 in GL_SetDefaults ()
    at /home/pi/hl/xash3d/engine/client/gl_vidnt.c:1841
        i = 1954255980
#2  0x747b9794 in R_Init () at /home/pi/hl/xash3d/engine/client/gl_vidnt.c:2222
No locals.
#3  0x747439ac in CL_Init () at /home/pi/hl/xash3d/engine/client/cl_main.c:1833
        loaded = (unknown: 160664)
#4  0x74826190 in Host_Main (argc=1, argv=0x7efff654, 
    progname=0x10f00 "valve", bChangeGame=0, func=0x10c24 <Sys_ChangeGame>)
    at /home/pi/hl/xash3d/engine/common/host.c:1048
        oldtime = 0
        newtime = 0
        event = {type = 139272, common = {type = 139272, 
            timestamp = 1995113128}, window = {type = 139272, 
            timestamp = 1995113128, windowID = 2130703552, event = 224 '\340', 
            padding1 = 243 '\363', padding2 = 234 '\352', padding3 = 118 'v', 
            data1 = 0, data2 = 1996484688}, key = {type = 139272, 
            timestamp = 1995113128, windowID = 2130703552, state = 224 '\340', 
            repeat = 243 '\363', padding2 = 234 '\352', padding3 = 118 'v', 
            keysym = {scancode = SDL_SCANCODE_UNKNOWN, sym = 1996484688, 
              mod = 61520, unused = 1954703044}}, edit = {type = 139272, 
            timestamp = 1995113128, windowID = 2130703552, 
            text = "\340\363\352v\000\000\000\000P\360\377vP\360\377v\304f\202t\000\000\000\000\234\375\352v8 \002", start = 69280, length = 68500}, text = {
            type = 139272, timestamp = 1995113128, windowID = 2130703552, 
            text = "\340\363\352v\000\000\000\000P\360\377vP\360\377v\304f\202t\000\000\000\000\234\375\352v8 \002"}, motion = {type = 139272, 
            timestamp = 1995113128, windowID = 2130703552, which = 1995109344, 
            state = 0, x = 1996484688, y = 1996484688, xrel = 1954703044, 
            yrel = 0}, button = {type = 139272, timestamp = 1995113128, 
            windowID = 2130703552, which = 1995109344, button = 0 '\000', 
            state = 0 '\000', clicks = 0 '\000', padding1 = 0 '\000', 
            x = 1996484688, y = 1996484688}, wheel = {type = 139272, 
            timestamp = 1995113128, windowID = 2130703552, which = 1995109344, 
            x = 0, y = 1996484688}, jaxis = {type = 139272, 
            timestamp = 1995113128, which = 2130703552, axis = 224 '\340', 
            padding1 = 243 '\363', padding2 = 234 '\352', padding3 = 118 'v', 
            value = 0, padding4 = 0}, jball = {type = 139272, 
            timestamp = 1995113128, which = 2130703552, ball = 224 '\340', 
            padding1 = 243 '\363', padding2 = 234 '\352', padding3 = 118 'v', 
            xrel = 0, yrel = 0}, jhat = {type = 139272, 
            timestamp = 1995113128, which = 2130703552, hat = 224 '\340', 
            value = 243 '\363', padding1 = 234 '\352', padding2 = 118 'v'}, 
          jbutton = {type = 139272, timestamp = 1995113128, 
            which = 2130703552, button = 224 '\340', state = 243 '\363', 
            padding1 = 234 '\352', padding2 = 118 'v'}, jdevice = {
            type = 139272, timestamp = 1995113128, which = 2130703552}, 
          caxis = {type = 139272, timestamp = 1995113128, which = 2130703552, 
            axis = 224 '\340', padding1 = 243 '\363', padding2 = 234 '\352', 
            padding3 = 118 'v', value = 0, padding4 = 0}, cbutton = {
            type = 139272, timestamp = 1995113128, which = 2130703552, 
            button = 224 '\340', state = 243 '\363', padding1 = 234 '\352', 
            padding2 = 118 'v'}, cdevice = {type = 139272, 
            timestamp = 1995113128, which = 2130703552}, quit = {
            type = 139272, timestamp = 1995113128}, user = {type = 139272, 
            timestamp = 1995113128, windowID = 2130703552, code = 1995109344, 
            data1 = 0x0, data2 = 0x76fff050 <_rtld_global>}, syswm = {
            type = 139272, timestamp = 1995113128, msg = 0x7efff4c0}, 
          tfinger = {type = 139272, timestamp = 1995113128, 
            touchId = 8568929386554717376, fingerId = 8574836441924763648, 
            x = 2.59552698e+33, y = 8.26517244e+31, dx = 0, 
            dy = 2.38308843e+33, pressure = 1.95228902e-40}, mgesture = {
            type = 139272, timestamp = 1995113128, 
            touchId = 8568929386554717376, dTheta = 0, dDist = 2.59552698e+33, 
            x = 2.59552698e+33, y = 8.26517244e+31, numFingers = 0, 
            padding = 0}, dgesture = {type = 139272, timestamp = 1995113128, 
            touchId = 8568929386554717376, gestureId = 8574836441924763648, 
            numFingers = 1996484688, error = 8.26517244e+31, x = 0, 
            y = 2.38308843e+33}, drop = {type = 139272, 
            timestamp = 1995113128, file = 0x7efff4c0 "8 \002"}, 
          padding = "\b \002\000\250\002\353v\300\364\377~\340\363\352v\000\000\000\000P\360\377vP\360\377v\304f\202t\000\000\000\000\234\375\352v8 \002\000\240\016\001\000\224\v\001\000\304f\202t"}
#5  0x00010da0 in main (argc=1, argv=0x7efff654)
    at /home/pi/hl/xash3d/game_launch/xash.c:145
No locals.
(gdb) q
A debugging session is active.

	Inferior 1 [process 8011] will be killed.

Quit anyway? (y or n) 
Maybe a wrong HL files? Im using official Half Life "valve" directory from Steam.

CockPitt
Posts: 108
Joined: Tue Jun 02, 2015 1:29 pm

Re: Xash3D Engine on Raspberry Pi

Sun Mar 06, 2016 3:58 pm

Well, I'm not good in backtrace reading that's more ptitSeb's specialty. But I know how to build it.
Are you using ptitSebs's repos?
Did you compile SDL2 with OpenGL support?
And have you ever played the game a little before copying the valve folder?

I can give you a preview of the upcoming guide. Maybe it can help you:

WARNING!!! Currently the necessary OpenGL build will be installed in the common directory. That means it'll very likely mess up GLES/GLES2. So you won't be able to play GLES games. If you want to try it out I highly recommend you to follow this step by step guide on a separate OS. WARNING!!!


Let's get started! There a few things you need to run Half-Life on your Raspberry Pi (The whole process will take about an hour):

- Raspberry Pi 2 model b (Currently we're trying to get it running on RPi 1/zero)
- Raspbian Jessie (It hasn't been tested on other OSes with Raspberry Pi)
- The game itself (You'll only need the valve folder of your Half-Life installation)
- Note that this guide is written for user pi (just change all paths to another user if you install it for another user)

Ensure that everything is up to date by running:

sudo apt-get update
sudo apt-get upgrade

You also need some packages:
- git

Code: Select all

sudo apt-get install git
- cmake

Code: Select all

sudo apt-get install cmake
- ccmake

Code: Select all

sudo apt-get install cmake-curses-gui
Next up we install some libs:

Code: Select all

sudo apt-get install libsdl2-2.0-0 libX11-dev libxext-dev
Now we build SDL2 with OpenGL support:

Code: Select all

sudo apt-get install build-essential libfreeimage-dev libopenal-dev libpango1.0-dev libsndfile-dev libudev-dev libasound2-dev libjpeg8-dev libtiff5-dev libwebp-dev automake
cd ~
wget https://www.libsdl.org/release/SDL2-2.0.3.tar.gz
tar zxvf SDL2-2.0.3.tar.gz
cd SDL2-2.0.3 && mkdir build && cd build
(sudo apt-get install build-essential libfreeimage-dev libopenal-dev libpango1.0-dev libsndfile-dev libudev-dev libasound2-dev libjpeg8-dev libtiff5-dev libwebp-dev automake) is one command.



To configure SDL2 type:

Code: Select all

../configure --host=armv7l-raspberry-linux-gnueabihf --disable-pulseaudio --disable-esd --disable-video-mir --disable-video-wayland --enable-video-x11 --enable-video-opengl
Then make:

Code: Select all

make -j 4
sudo make install
You also have to install SDL_image:

Code: Select all

cd ~
wget http://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.0.tar.gz
tar zxvf SDL2_image-2.0.0.tar.gz
cd SDL2_image-2.0.0 && mkdir build && cd build
../configure
make -j 4
sudo make install
Now it's time to build glshim:

Code: Select all

cd ~
git clone https://github.com/ptitSeb/glshim
cd glshim
cmake . -DBCMHOST=1; make GL
Next up we create the actual game directory. (which is /home/pi/Half-Life)

Code: Select all

cd ~
mkdir /home/pi/Half-Life
Build xash3d:

Code: Select all

cd ~
git clone https://github.com/ptitSeb/xash3d
git clone https://github.com/ptitSeb/halflife
cp -a halflife/. xash3d/hlsdk/
cd xash3d
cmake . -DRPI=ON -DXASH_SDL=ON -DXASH_VGUI=OFF -DHL_SDK_DIR=hlsdk/ -DCMAKE_C_FLAGS="-mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon -funsafe-math-optimizations" -DCMAKE_CXX_FLAGS="-mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon -funsafe-math-optimizations"
make -j4
cp engine/libxash.so /home/pi/Half-Life
cp mainui/libxashmenu.so /home/pi/Half-Life
cp game_launch/xash3d /home/pi/Half-Life
Now make hl.so:

Code: Select all

cd hlsdk/dlls
make -f Makefile.rpi -j4
cp hl.so /home/pi/Half-Life
Build XashXT:

Code: Select all

cd ~
git clone https://github.com/ptitSeb/XashXT
cd XashXT/client
make -f Makefile.rpi -j4
cp client.so /home/pi/Half-Life
Let's clean it up a bit by removing the uncompiled repos:

Code: Select all

cd ~
sudo rm -r xash3d XashXT zxvf SDL2-2.0.3.tar.gz


I noticed that sometimes the game won't launch after building everything. Fix it by typing:

Code: Select all

sudo ldconfig
Copy your valve game folder to "/home/pi/Half-Life/" (You need to play a little while before copying it otherwise it won't work).

Launch the game

Code: Select all

cd /home/pi/Half-Life
LIBGL_FB=1 LIBGL_BATCH=1 LD_LIBRARY_PATH=/opt/vc/lib:/home/pi/glshim/lib:. ./xash3d -console -debug
That's it.
Last edited by CockPitt on Sun Mar 13, 2016 11:22 am, edited 1 time in total.

GAMELASTER
Posts: 35
Joined: Sat Feb 14, 2015 8:05 pm

Re: Xash3D Engine on Raspberry Pi

Sun Mar 06, 2016 5:11 pm

Wow, thanks!
I looked at my Segmentation Fault, its a GL problem, so fix solution is glshim I think.

The warning that you say about disfunction of other GLES applications, why not build GLSHIM into a another directory (not common) and "include" it in LD_LIBRARY_PATH? I think this will work good

GAMELASTER
Posts: 35
Joined: Sat Feb 14, 2015 8:05 pm

Re: Xash3D Engine on Raspberry Pi

Sun Mar 06, 2016 6:47 pm

Okay, i recompiled SDL etc... and now its launch! Problem is there is not any output in monitor (i dont use any X server, so only in FBA)
Console:

Code: Select all

[18:42:33] . is working directory now
=================================================================================
	 (build 3153) started at Mar06 2016 [18:42.33]
=================================================================================
[18:42:33] 1 joysticks found
[18:42:33] Joystick Microsoft X-Box 360 pad has 6 axes
[18:42:35] execing video.cfg
[18:42:35] execing opengl.cfg
[18:42:35] CL_Shutdown()

=================================================================================
	 (build 3153) fallback to dedicated mode
 at Mar06 2016 [18:42.35]
=================================================================================[18:42:35] . is working directory now
=================================================================================
	 (build 3153) started at Mar06 2016 [18:42.35]
=================================================================================
[18:42:35] 1 joysticks found
[18:42:35] Joystick Microsoft X-Box 360 pad has 6 axes
[18:42:37] execing server.cfg
CL_Init, game = Half-Life
dlopen("./hl.so", RTLD_LAZY)=0x34c940, error=(null)
[18:42:37] Dll loaded for mod Half-Life
[18:42:37] Server loaded
[18:42:37] Server IP address 127.0.1.1:27015
[18:42:37] Spawn Server: lambda_bunker
[18:42:38] execing skill.cfg
[18:42:38] server: GAME SKILL LEVEL:1
[18:42:38] SV_LoadFromFile: 0 entities inhibited
[18:42:38] 8 player server started
[18:42:38] Usage: map <mapname>
[18:42:38] execing config.cfg
[18:42:43] SV_Shutdown: Server shutdown
[18:42:43] CL_Shutdown()

CockPitt
Posts: 108
Joined: Tue Jun 02, 2015 1:29 pm

Re: Xash3D Engine on Raspberry Pi

Sun Mar 06, 2016 7:07 pm

@GAMELASTER About the warning: The problem is not glshim but SDL2. Currently we're trying to build it into another directory. But xash3d doesn't compile anymore so we're trying to change enviroment variables to make it work again.
About launching Half-Life: So you are using SSH or console only? I don't know what FBA is :oops:

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 16 guests