Max

OpenArena package

Mon Jun 18, 2012 12:42 am

Image

Created a hardware accelerated OpenArena Debian package (based on the q3 code from github).

To install it:

Code: Select all

sudo apt-get install openarena-data openarena-server
wget http://www.berryterminal.com/dl/openarena-rpi_0.8.5_armel.deb
sudo dpkg -i ./openarena-rpi_0.8.5_armel.deb
To run type (in the normal text console, not in a X terminal):

Code: Select all

/usr/games/openarena
Package is for the standard Debian Squeeze image.

Known issues:
  • requires recent firmware. (if you get an "error while loading shared libraries: libvchiq_arm.so error", update the firmware).
  • there is a problem with sound.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5105
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: OpenArena package

Mon Jun 18, 2012 8:57 am

Great - I was hoping someone would do this.

asb
Forum Moderator
Forum Moderator
Posts: 853
Joined: Fri Sep 16, 2011 7:16 pm
Contact: Website

Re: OpenArena package

Mon Jun 18, 2012 9:25 am

You are a star. Did it require any source changes? Do you have a copy of any changes and scripts to build your .deb? I'm keen to include this in the raspberrypi.org repository, but would want to be able to rebuild the deb myself (at least in principle).

Max

Re: OpenArena package

Mon Jun 18, 2012 9:57 am

asb wrote:You are a star. Did it require any source changes? Do you have a copy of any changes and scripts to build your .deb? I'm keen to include this in the raspberrypi.org repository, but would want to be able to rebuild the deb myself (at least in principle).
There is a source tarball in the /dl/source folder on my webserver.
Be aware that it's a bit of a quick hack, and not that pretty.


Did the following steps:
  • diff'ed the ioquake code from rPi github with vanilla ioquake.
  • fetched the source used by Debian from: http://packages.debian.org/squeeze/openarena
  • applied the patch generated in step 1
  • worked through the rejects and the files that wouldn't diff properly because of different line endings.
  • applied most of the patches from the "debian/patches" folder
  • cross compiled
Also did some changes in an attempt to get sound (changed it to use sdl_snd.cpp instead of the dummy es_snd.cpp, and some other minor edits), but didn't got that to work properly.
It initializes the sound hardware, and there comes static out of the speakers, but not what you expect to hear.

build-rpi.sh in the root folder of my tarball compiles the package and packs it up in a .deb.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5105
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: OpenArena package

Mon Jun 18, 2012 6:39 pm

@Max
I tried it on the new Wheezy distribution, and get:

Code: Select all

pi@raspberrypi:~$     sudo dpkg -i ./openarena-rpi_0.8.5_armel.deb
Selecting previously unselected package openarena-rpi.
(Reading database ... 58282 files and directories currently installed.)
Unpacking openarena-rpi (from .../openarena-rpi_0.8.5_armel.deb) ...
dpkg: dependency problems prevent configuration of openarena-rpi:
 openarena-rpi depends on openarena-server (<< 0.8.6~); however:
  Version of openarena-server on system is 0.8.8-4.
dpkg: error processing openarena-rpi (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 openarena-rpi

Max

Re: OpenArena package

Mon Jun 18, 2012 7:18 pm

Did take a look at Wheezy the other day, but it comes with a newer version of the engine and data files that requires some additional OpenGL code to be translated to ES, or be disabled.
E.g. I recall they used GL_QUADS instead of triangles somewhere.

Might not be too hard to convert, but settled for building a package for the version that comes with Squeeze first. Was closer to the rpi github code.

Max

Re: OpenArena package

Wed Jun 20, 2012 1:31 pm

Max wrote:E.g. I recall they used GL_QUADS instead of triangles somewhere.
nvm, turns out it only uses that for a special effect (bloom) that is disabled by default anyway.
Uploaded a package for Wheezy with working sound.


To install under Debian Wheezy:

- if you accidently installed the earlier package that was meant for Squeeze, uninstall it: sudo apt-get remove openarena-rpi

- install the patched engine first and then the standard Debian game package:

Code: Select all

wget http://www.berryterminal.com/dl/ioquake3_99.1.36-rpi01_armel.deb
sudo dpkg -i ./ioquake3_99.1.36-rpi01_armel.deb
sudo apt-get install openarena
To play:

Code: Select all

If you want to use headphones/analog audio: amixer cset numid=3 1
sudo /usr/games/openarena
Known issues:
  • In the menu go to "Setup" -> "System" -> "Graphics" and change "Lighting" from "Lightmap" to "Vertex" to get an acceptable frame rate.
  • If you start without sudo, the game appears to start, but your keyboard will not function.
(Source is on the website under /dl/src. This one needs to be compiled with the standard Debian build tools like 'dpkg-buildpackage' on an actual Pi).

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5105
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: OpenArena package

Wed Jun 20, 2012 8:21 pm

@Max

You got sound working! You hero!

On a clean Wheezy you need to:
sudo apt-get install libcurl3-gnutls

then follow your instructions and it works great!

Max

Re: OpenArena package

Wed Jun 20, 2012 8:45 pm

dom wrote: You got sound working!
Yes, works better without sections like this. ;)

https://github.com/raspberrypi/quake3/b ... dma.c#L393

Code: Select all

// XXX hacked to disable sound
s_soundMuted = 1;
On a clean Wheezy you need to:
sudo apt-get install libcurl3-gnutls
Thanks for the info.

mrlinux2u
Posts: 187
Joined: Sat Sep 24, 2011 8:38 pm

Re: OpenArena package

Wed Jun 20, 2012 10:28 pm

Max wrote:
dom wrote: You got sound working!
Yes, works better without sections like this. ;)

https://github.com/raspberrypi/quake3/b ... dma.c#L393

Code: Select all

// XXX hacked to disable sound
s_soundMuted = 1;

don't suppose that's whats causing everyone's quake3 installs not to have sound as well?

Max

Re: OpenArena package

Wed Jun 20, 2012 10:55 pm

mrlinux2u wrote:don't suppose that's whats causing everyone's quake3 installs not to have sound as well?
In short there are three thingies necessary to have sound in Openarena, and I assume it to be the same in quake3:
  • Makefile needs to be changed so that it compiles sdl_snd.c instead of the dummy (empty methods) es_snd.c file.
  • You need to have libsdl/libogg/libvorbis available to link to, and have it enabled in Makefile.
  • That one liner, needs to be changed back to what it is in the original source: s_soundMuted = qfalse;
I don't know why sound was disabled in the first place though.
Maybe something was/is wrong with it. (or it could have been just done to get a higher fps, or to loose the external depencies. but that is just guessing)

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5105
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: OpenArena package

Wed Jun 20, 2012 11:10 pm

Max wrote:I don't know why sound was disabled in the first place though.
Maybe something was/is wrong with it. (or it could have been just done to get a higher fps, or to loose the external depencies. but that is just guessing)
Well, Quake was ported a couple of years ago. The ALSA driver is relatively new.
It's possible muting the sound in that way avoids some processing which improves the framerate, and if the sound is going nowhere then why not disable it.

Trouble is, when I got the ALSA driver going, I wasn't aware of that s_soundMuted flag. Strangely I did, after a couple of hours of bashing it, manage to get some noises out, but nothing recognisable.
I put it down to the buggy ALSA driver.

But, I just played OpenArena for twenty minutes with headphones on, and the sound was perfect. It's much more fun with sound.

OlDrunk
Posts: 23
Joined: Mon Jun 11, 2012 4:27 am

Re: OpenArena package

Thu Jun 21, 2012 4:48 am

Is sound only working for wheezy or is it working for squeeze as well now too just trying to clarify?

Max

Re: OpenArena package

Thu Jun 21, 2012 12:31 pm

OlDrunk wrote:Is sound only working for wheezy or is it working for squeeze as well now too just trying to clarify?
edit: just uploaded a new package for Squeeze. Kept the same filename.

To install for Squeeze (assuming you already updated the firmware)

Code: Select all

sudo apt-get install openarena-data openarena-server alsa-utils
wget http://www.berryterminal.com/dl/openarena-rpi_0.8.5_armel.deb
sudo dpkg -i ./openarena-rpi_0.8.5_armel.deb
To start Squeeze with sound:

Code: Select all

sudo modprobe snd-bcm2835
If you want headphones/analog: sudo amixer cset numid=3 1
sudo /usr/games/openarena
Last edited by Max on Thu Jun 21, 2012 12:54 pm, edited 1 time in total.

OlDrunk
Posts: 23
Joined: Mon Jun 11, 2012 4:27 am

Re: OpenArena package

Thu Jun 21, 2012 12:52 pm

Thanks for the reply!
Now off to find to another SD card to load wheezy on.



-Cheers!

Max

Re: OpenArena package

Thu Jun 21, 2012 1:06 pm

Correction to my Squeeze start instructions, it should be: sudo modprobe snd-bcm2835
(not bcm2708, but can no longer edit my post)
OlDrunk wrote:Thanks for the reply!
Now off to find to another SD card to load wheezy on.
No need, just uploaded a new Squeeze package after all.
Only took that one line change.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5105
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: OpenArena package

Thu Jun 21, 2012 1:29 pm

Max wrote:Correction to my Squeeze start instructions, it should be: sudo modprobe snd-bcm2835
(not bcm2708, but can no longer edit my post)
I've edited it for you, to avoid confusion.

OlDrunk
Posts: 23
Joined: Mon Jun 11, 2012 4:27 am

Re: OpenArena package

Fri Jun 22, 2012 4:31 pm

Awesome work , thank you very much for the update!

-Cheers!

OlDrunk
Posts: 23
Joined: Mon Jun 11, 2012 4:27 am

Re: OpenArena package

Sat Jun 23, 2012 3:52 am

Just a note, I found that game won't run if the RasPi is overclocked, when I disable it in my config.txt the game works. Would it work better if I compiled it my self then install from deb package?

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5105
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: OpenArena package

Sat Jun 23, 2012 8:56 am

OlDrunk wrote:Just a note, I found that game won't run if the RasPi is overclocked, when I disable it in my config.txt the game works. Would it work better if I compiled it my self then install from deb package?
Sounds like you have overclocked too much, and this is the first thing that has stressed the GPU. What's in your config.txt?

Note: overclocking increases power consumed. You may need a higher capacity power supply for successful overclocking.

OlDrunk
Posts: 23
Joined: Mon Jun 11, 2012 4:27 am

Re: OpenArena package

Sat Jun 23, 2012 4:21 pm

Input 1A, not an el-cheapo PSU
192/64 memory split
Config.txt
arm_freq=900
sdram_freq=500

Have been running with these settings for over a week now and every thing else I've been doing has been running stable and fast (omxplayer, LXDE, and a bunch of CLI apps) I'm going to try to dial it back to see if I can find some kind of sweet spot where every thing will work together. Also going to try installing Quake3 to see if acts the same way.

Trukkle
Posts: 2
Joined: Sun Jun 24, 2012 2:01 am

Re: OpenArena package

Sun Jun 24, 2012 2:41 am

Trying to get this running on Wheezy. The installation seems to go well, but when I run openarena (or sudo /usr/games/openarena) I get this error:

Code: Select all

ioq3 99.1.36-rpi01/Debian linux-arm Jun 20 2012
----- FS_Startup -----
Current search path:
/home/pi/.openarena/baseoa
/usr/lib/openarena/baseoa
/usr/lib/openarena/baseoa/pak6-patch088.pk3 (711 files)
/usr/lib/openarena/baseoa/pak6-patch085.pk3 (559 files)
/usr/lib/openarena/baseoa/pak6-misc.pk3 (229 files)
/usr/lib/openarena/baseoa/pak5-TA.pk3 (139 files)
/usr/lib/openarena/baseoa/pak4-textures.pk3 (1753 files)
/usr/lib/openarena/baseoa/pak2-players.pk3 (669 files)
/usr/lib/openarena/baseoa/pak2-players-mature.pk3 (231 files)
/usr/lib/openarena/baseoa/pak1-maps.pk3 (100 files)
/usr/lib/openarena/baseoa/pak0.pk3 (1042 files)

----------------------
5433 files in pk3 files
execing default.cfg
couldn't exec q3config.cfg
couldn't exec autoexec.cfg
Hunk_Clear: reset the hunk ok
----- Client Initialization -----
Couldn't read q3history.
----- Initializing Renderer ----
-------------------------------
QKEY found.
----- Client Initialization Complete -----
----- R_Init -----
SDL using driver "fbcon"
Chose EGL config 22: r=5,g=6,b=5,a=0, depth=24,stencil=0, samples=4,sample_buffers=1
Using native window 0
eglCreateWindowSurface() failed
----- Client Shutdown (Client fatal crashed: GLimp_Init() - could not load OpenGL subsystem
) -----
RE_Shutdown( 1 )
Hunk_Clear: reset the hunk ok
-----------------------
GLimp_Init() - could not load OpenGL subsystem

Clean install, fully updated, not overclocked, 192 MB RAM.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5105
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: OpenArena package

Sun Jun 24, 2012 9:42 am

@Trukkle
You're not using the 224M memory split are you?

texy
Forum Moderator
Forum Moderator
Posts: 5015
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: OpenArena package

Sun Jun 24, 2012 11:57 am

Thanks go all that got this going. I didn't have any problems runnig the game up, however i couldn't play the game for more than a minute before the pi seriously crashed.
I didn't default from the standard gpu/cpu memory split. This is with the latest wheezy distro. I MAY of done a update && upgrade, can't be sure. Also this is with a relatively slow 10mb/s Sandisk SD card, if thats of help.

Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

Max

Re: OpenArena package

Sun Jun 24, 2012 1:16 pm

Hmm, seems it starts to swap under Wheezy, which might give issues.

Try if it works better with the following workaround:

Code: Select all

sudo swapoff -a
sudo /usr/games/openarena +set com_hunkMegs 64

Return to “Media centres”

Who is online

Users browsing this forum: No registered users and 7 guests