User Tools

Site Tools


proton:raspi_setup

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
proton:raspi_setup [2016/06/18 09:39]
seth
proton:raspi_setup [2016/06/19 13:07]
seth
Line 1: Line 1:
 ** Experimental and for linux pros only ** ** Experimental and for linux pros only **
  
-These steps are what I use to compile stuff by copying things from my Windows computer. ​ A normal ​user would probably just grab the svn tree.+Here is how to setup the Raspberry Pi to support ​normal ​OpenGL or GLES (both with acceleration) and be able to compile ​the Proton SDK examples  (tested with Raspbian "​Jessie"​ on 6/18/2016)
  
 +From my tests I got it working two ways:
  
-Step 1: Make OpenGL ES 1/2 work on the Raspberry Pi 2 or 3.  ​Strangely, as of June 18th 2016 the versions you can get with apt-get are compiled with the wrong flags so it won't work with the hardware acceleration.  ​Useless. ​ So we will install our own SDL2.+1.  Set it up using the OpenGL experimental driver. ​ ResultProton examples only work in X11 in windows mode.  ​Fullscreen (using ​the SDL2 harness) didn't work.  ​[[proton:​raspi_opengl_setup|Directions to setup]]
  
-I did this with the latest version of Raspbian (Jessie I think).+2.  Set it up using GL ES, won't work in X11, works full screen by starting from console. ​ This is more useful for me as it's more pedal to the metal and easier to get 60 fps, no x overhead With this method we're setting up our own EGL context manually, but still using the SDL2 harness for other things
  
-  ​* Give the video card more memory on the pi.  Run raspi-config and give it 128 or 256 (good for the pi3)+ 
 +** Instructions to setup GLES with Raspberry Pi and run Proton SDK examples ** 
 + 
 + 
 +These steps are what I use to compile stuff by copying things from my Windows computer. ​ A normal user would probably just grab the svn tree and run .sh files. 
 + 
 +  ​* Give the video card more memory on the pi.  Run raspi-config and give it at least 128 or so to be safe.
   * Install cmake on the pi (sudo apt-get install cmake)   * Install cmake on the pi (sudo apt-get install cmake)
   * Do "sudo rpi-update"​ to make sure your firmware is updated   * Do "sudo rpi-update"​ to make sure your firmware is updated
 +  * Run the following from a shell:
 +
 +<​code>​
 +sudo apt-get -y install xcompmgr libgl1-mesa-dri && sudo apt-get -y install libalut0 libalut-dev && sudo apt-get -y install mesa-utils
 +
 +sudo apt-get install libglu1-mesa-dev freeglut3-dev mesa-common-dev libgles2-mesa-dev libgegl-dev
 +</​code>​
 +
   * Do the following from a shell window to install SDL2 from source:   * Do the following from a shell window to install SDL2 from source:
  
 <​code>​ <​code>​
 cd ~  cd ~ 
-sudo apt-get install libfreeimage-dev libopenal-dev libpango1.0-dev libsndfile1-dev libudev-dev libasound2-dev libjpeg-dev libtiff5-dev libwebp-dev automake 
 wget https://​www.libsdl.org/​release/​SDL2-2.0.4.tar.gz ​ wget https://​www.libsdl.org/​release/​SDL2-2.0.4.tar.gz ​
 tar zxvf SDL2-2.0.4.tar.gz ​ tar zxvf SDL2-2.0.4.tar.gz ​
 cd SDL2-2.0.4 && mkdir build && cd build  cd SDL2-2.0.4 && mkdir build && cd build 
-../​configure --host=armv7l-raspberry-linux-gnueabihf --disable-pulseaudio --disable-esd --disable-video-mir --disable-video-wayland --disable-video-x11 --disable-video-opengl ​ +../​configure --host=armv7l-raspberry-linux-gnueabihf --disable-pulseaudio --disable-esd --disable-video-mir --disable-video-wayland --disable-video-x11 --disable-video-opengl
 make -j 5  make -j 5 
 sudo make install ​ sudo make install ​
 </​code>​ </​code>​
  
-To test your GL ESdo this with local shell (not a remote shell window.. although maybe that works, dunno) +  * To test, type "​glxgears"​ from a shell inside of the GUI desktop
-<​code>​ +
-cd ~/​SDL2-2.0.4/​test +
-g++ -o testgles2 ​ testgles2.c `sdl2-config --cflags --libs` +
-./​testgles2 +
-</​code>​+
  
-If stuff is setup right, you'll see some triangles or something rendering smoothly. 
  
 Step 2: Proton stuff Step 2: Proton stuff
Line 40: Line 47:
   * Edit SetupVars.bat and edit the IP to the pi   * Edit SetupVars.bat and edit the IP to the pi
   * Run CopyStuffToPi.bat. ​ There should now be a ~/proton tree on the pi   * Run CopyStuffToPi.bat. ​ There should now be a ~/proton tree on the pi
 +  * Edit the RTBareBones/​linux/​CMakeLists.txt file and make sure OPTION(RASPBERRYPI_GLES11 OPTION(RASPBERRYPI_GLES11 "​Compile for Raspberry PI GLES" ON) is uncommented and OPTION(RASPBERRYPI_OPENGL "​Compile for Rasperry PI OpenGL"​ ON) is commented out. 
   * RTBareBones/​CopyStuffToPiAndCompileLoop.bat and it should update that example and compile it in a loop   * RTBareBones/​CopyStuffToPiAndCompileLoop.bat and it should update that example and compile it in a loop
  
 +The last step of the build copies the rtbarebones binary to /​RTBareBones/​bin (as that's where the media is), so go to that dir and run "​./​rtbarebones"​ and it should work.
 +
 +RTSimpleApp is much the same, although you'll need SDL2's mixer as well.  Unlike with the base SDL2, we can just grab a pre-compiled one like this:
 +<​code>​
 +sudo apt-get libsdl2-mixer-dev
 +</​code>​
 +And that should compile ok. We don't have a mouse or anything but I can see it's running at 60 fps...
  
-If you look at the RTBarebones/​linux dir you'll see the CMakeLists.txt file autodetect the pi and sets up GLES 1.1 headers stuff for it. 
proton/raspi_setup.txt · Last modified: 2018/07/28 09:26 by seth