Skip to content

**** ****

Quakeforge on RPi

June 17, 2014


On my never ending quest for as much gaming as possible on my little Raspberry Pi I was remembering a time where the laws of physics were mostly irrelevant and the frags were plentiful.

Quake

The original quake, no bloody 2, no bloody 3 and no bloody 4! Just pure fast paced carnage. So I pulled up the latest Quakeforge repository and decided to see where it would get me.

The long quest for Quake

The first problem I ran into was fairly minor but it seemed Rasbian defaulted at bison 2.5 and QF required 2.6 for some bloody reason. This was no big deal I just downloaded the source, compiled it and away it went. The process griped about a few more libraries along the way but they were all available from apt-get from that point on.

Once I had all the dependencies and ./configure ran its course I had a nice status menu of what it was building when I did the make.

The make process took a long time, walk away, go to the store, do something. This is a low powered single processor machine and it takes a while. Make sure you have everything configured the way you want as well as any changes makes it start it all over again.

So after growing a beard and starting a small garden in the back yard my first attempt at QF was compiled. Excited I typed nq-sdl to be presented with an error “libGL.so not found. QF defaults to the GL version it seems.

nq-sdl +set vid_render “sw”

Tada! we have Quake! the screen was a small window in the center of my console to correct this I had to revise my startup command

nq-sdl +set vid_render “sw +set vid_width “640” +set vid_height “480”

Now we have full screen Quake! Almost immediately though I noticed something was wrong. First the sound was popping. Eventually the client would become unbearably slow and fill the console with errors stating it was out of channels.

Secondly any time the player hits an item or is damaged the screen flickers for about a second. Very distracting, very annoying.

Sound problem

I reconfigured and disabled ALSA and OSS drivers with –disable-alsa and –disable-oss as I was trying for an SDL only build. This fixed the sound issue 100% No popping, no eventual slow down and channel problems.

Flickering problem

This issue took me a day or so of on and off investigating to isolate as I have never dealt with the Quake source directly before.

Eventually I came across a file called cl_view.c which had 2 functions as plain as day for handling damage and bonus collections with a palette change “flash”. What I did just to see if I had the right idea was block out the cshift variable changing with an #ifdef block and recompiled.

Sure enough no more flicker. Not sure why it’s broken on software rendering but I filed a ticket to the project and hopefully someone properly fixes it someday. For now it works for me time to move on!

Arcade controls

Come on, you knew that was coming… heh. Yes I got Quake working with my arcade controls. At first I tried handling it through the quake menu system under controls -> bindings but this wasn’t actually setting the functions I wanted to the buttons I wanted.

I eventually had to manually edit ~/.quakeforge/id1/config.cfg and set the bindings manually to match the keys my retrogame was sending to the actions I wanted. It was a bit tedious and manual BUT I got the results I wanted.

Retrogame changes

With the existing setup I had I could pull up the menu with the KEY_ESC vulcan nerve pinch that the code already had but to select items I needed a KEY_ENTER. What I did was added multiple key combinations to the code so I can send KEY_ESC, KEY_ENTER and a specific system halt combination. This allows me to navigate MAME, Super Mario war and now Quake with ease. I have uploaded all my retrogame changes to github you can view them here.

Not done yet

Now what about multiplayer? Don’t worry, I am going to do something special with qw-client-sdl in this regard. I’m sure there will be a post in the future about it.


Super Mario War on RPi

June 15, 2014


Ever play Super Mario War? If you haven’t it is essentially Super Mario death match in the setting of SMB1,2,3 and Mario World graphics.

It’s you and 3 other marios trying to stomp, hammer, shell, b-bomb each other to death until you have no lives left. There are other game modes like chicken, ctf and king of the hill to keep it interesting but to put it plainly it is a great multiplayer game.

I decided to see if I could get this running on my Pi and not only just running but also working with my arcade controls.

I downloaded the source yesterday and at first ran into a few basic issues, Installed LibSDL, SDLMixer, SDLImage ,  blah blah blah packages. Long story short I got it working but the backgrounds were garbled, maybe 1 or 2 maps were playable. Refreshing the maps list caused a crash after about 6 maps as well.

Still a success, it was working in some manner at least I thought

Today I was investigating how to correct that issue when I came across a Raspberry Pi Forum post outlining a better and simpler method to get it running and it had a patch. A patch that I had hoped resolved my garbled maps issue.

Script:

wget --no-check-certificate https://aur.archlinux.org/packages/sm/smw-svn/smw-svn.tar.gz
tar -xf smw-svn.tar.gz
cd smw-svn
svn co http://supermariowar.googlecode.com/svn/trunk smw
cd smw
dos2unix configure
chmod +x configure
patch -Np0 < ../gcc.patch
./configure
make

I modified the script slightly to add –no-check-certificate to the wget (as mine failed by default with it not present) and it was off to the races. After about 20 minutes the script had done its job. The SVN was downloaded, patched, configured and compiled.  Once you have run sudo make install you should be able to execute the game with “smw”

Problems

Unfortunately the background issue and map crash was still present. I had noticed however some maps now appeared to work so I started going through the list pruning the unplayable maps and the ones that caused the game to fault.

It’s also occasionally crashy it was a beta after all and despite my efforts I can’t seem to find a copy of the older more stable 1.7 source. Despite the problems it is well worth the effort to install.

Controls

The controls for SMW are 100% customizable for game and menu input. This means anything SDL can detect as an input you can set up. You may need a keyboard at first for menu enter/cancel until you set up a primary controller for that but once that’s covered keyboards can be put away!

The first controller I obviously set up is my arcade controls. Works 100%

Second was a semi busted ps3 controller I have that doesn’t work over bluetooth anymore but still works as usb. The PS3 controller I tried to plug in through my keyboard first but the bus power was too low so I plugged it in directly to the Pi. After that I started SMW and it was detected automatically.

You can have upto 4 players so technically with a good powered hub or 4 bluetooth gamepads you could have a lot of fun with this game

 


Raspberry Pi: On/OFF

May 23, 2014


Last Saturday I made a shut down button for my XBMC Pi which has worked great and made my SD cards live in a happier place

I decided to look into a PowerOn button because it is still sorta silly to unplug/plug in the Pi to turn it back on. Well as it turns out if you have a button on Pin 5 (GPIO 3) it will reset the Pi from halt state when pressed.

I verified this first with my arcade box as it already had a shut down implemented and an On button would be great plus I probably already had a button on that pin as I only had 2 free GPIO pins to begin with. Sure enough my yellow right hand button was on this pin.

I shut down the arcade box using the coin+1p nerve pinch and once the Pi was in a halted state I pressed the yellow button.

Success!

I immediately applied this change to my XBMC pi just by move my button connection from 7/GND to 3/GND and updated the retrogame program to reflect the change.

So now both my Pi’s have graceful shutdown buttons and power on buttons. Life is good.


Raspberry Pi View Client

May 22, 2014


A couple weeks back my main desktop gave up the ghost after 6 years of usage. This leaves me without a desktop at home and if something were to arise that had to keep me home I would now have no way to work from home.

So I was thinking…

What about the VMware Open View client, that was a source code project on Google Code that allowed extra platforms to build the RDP based View client on whatever platform. Well it turns out that was closed suddenly over a year ago but in my searching for it it turned out someone had managed to get the binary packages working on the Pi with a Debian ARM package that seemed to exist.

The Raspberry Pi thin client project seemed to have what I was looking for out of the box. A View client that works with current View deployments and half a dozen other thin client packages for other platforms.

Problems problems problems

View client:

My Pi was on Ethernet to start, I opened up view put in my connection server and hit connect. It pops up with the MOTD and I continue, enter my credentials and then the desktops available to me appear. Great so far! I click the desktop pool the wheel spins and POOF the window goes away.

-I made sure RDP was selected

-I set the window to small in case the poor Pi couldn’t handle it

Poof! window goes away!

CPU speed:

CPU is set to the default 700mhz, this isn’t really a problem from a technical standard, the Pi is default a 700mhz ARM however all the applications crawl at this speed, including the View client

Wifi:

Wifi did not work out of the box, it did not detect my USB wifi and this Wifi has worked perfectly with all other Pi projects I’ve done in the past.

Boot Splash video:

It ran longer than the actual boot process, on a 4:3 screen you can see the booted desktop in the background and you’re still stuck watching the movie

Fixes Fixes Fixes

So I downloaded this for the sole purpose of using it for View so when that didn’t work I was a little disheartened but this was still the best bet I had so I wasn’t about to give up on it.

View fixes:

So as I said earlier, it worked up until showing me my available desktop pools and then it closes when you select one. I tried a multiple set of options, smallest window size, RDP, Full screen, windowed etc and nothing yet. I checked google and wasn’t getting far there other than a couple people on the RpiTC forums with the same problem.

It wasn’t looking good.

So for the hell of it I decided to run the app in LXterm to see if it said anything useful to STDout and it did. First it told me where it saved its logs. /tmp/vmware-view-some#-tmp.log and secondly when it closed it gave me a useful error.

“vmware-view-usb cannot be started: file does not exist” once again I hit google and got nothing but KB’s and other stuff and once again it didn’t look good.

Then for some reason I decided to just touch vmware-view-usb in /usr/bin and guess what the hell happened? It worked.

View problem solved! works great, even faster than some of proper full desktop versions.

CPU Speed:

700MHZ just wasn’t cutting it, everything dragged and pushed CPU to max. The nice folks had an overclock config set already in /boot/config.txt but commented out. Easy solution, Solved.

I also cleaned out the autostart applications for LXDE, commented out all startup applications and added @vmware-view –fullscreen

The reason for this is so the system boots up straight to the View client like a proper View thin client. Removing the desktop stats application (showed cpu/ram on the desktop) and the other startup apps greatly reduced CPU overhead

Wifi:

So the system worked great on ethernet but at home I use mainly wifi so the fact that it wasn’t detecting my wifi at all was a serious problem and even a deal breaker. The system appeared to actually see the wifi card when I did ifconfig wlan0 but it wasn’t connecting to anything and wpa_gui always reported it could not get status from wpa_supplicant.

What seems to be the issue is no wpa_supplicant.conf file existed and there was no proper definition of wlan0 in /etc/network/interfaces. I followed a simple guide here and the wifi issue was resolved. I can see why wifi may have been overlooked a wireless connection does impact thin client performance but the View client performance is still more than acceptable. Problem solved.

Boot splash video:

It is a neat looking video, it looked great at home on the 40inch HD TV but on my 4:3 monitor you can quite easily tell the system booted longer before the video was over so it was also kind of annoying. The videos are located in /opt all you need to do to quickly fix this is rename them. If you want your own fancy boot videos they are in m4v format just replace the files with something of your own.

Solved.

Project summary

So it took some tweaking and some unusual fixes to get this to do exactly what I needed but after all is said and done I am quite pleased with the results. Now I have an SD card I can pop into any of my Pi’s and immediately bring up a View Client for work. Small investment big gain for me.

 

 


Shutdown button for my Pi

May 18, 2014


It has been around a year now since my first Pi arrived and that first Pi has always been used as a media centre for my trailer and at home.

The problem being…

I use the remote app on my phone and iPad as the primary control there is no keyboard attached to the Pi for input. On the rare occasion there is a problem where either XBMC hangs up or the Pi drops from wifi I have no way to power it off other than unplugging it.

At home when it is just the wifi problem no biggie, the physical remote over HDMI works but at my trailer I have an older TV and this doesn’t work.

Anyone who has used a Pi knows you do an unclean shutdown enough times and you have to re image the OS because the file system damage is not always repairable. With lower quality cards this even sometimes leads to the SD card becoming unbootable permanently but I have only had that happen with one particular brand.

The solution

So I have some buttons left over from my original Arcade project and I decided to solve the problem by adding a shutdown button to my Pi. This way even if XBMC locks the physical button can execute a shutdown. It would take a full hardware lock of the Pi to cause a forced power off again and the only time I have seen that occur is when over clocking to 1Ghz so this should in almost all cases solve the problem!

Hardware

In this particular case I am using a red sanwa style arcade button for the shutdown, red seemed appropriate I also had blue and white available. I got this button from Adafruit last year along with the easy connector cable that will be used to connect to the GPIO on the Pi.

I connected the cable to the last pair of pins on the GPIO board as it was the easiest place to place the jumper and manipulate the cable in a manner to fit through the GPIO slot on my Pibow case.

I tried to keep as much of the cable within the case as possible, this is meant to be functional not pretty. Maybe I’ll get a smaller button in the future but this is what I had on hand.

Software

I’m using retrogame to handle the GPIO input detection and also the shutdown activation. Recent versions of retrogame seem to have taken this out but I forked an earlier version that has what I want for my projects.

For the Vulcan nerve pinch code to work with just a single button I just modified the bitmask to look for the same button instead of 2: (1L << 5) | (1L << 5)

Results

It works! hold the button for about 2 seconds and the Pi shuts down. This hopefully will extend the life of my OS and the SD cards.