Some Configs to Increase DosBox Performance on Raspberry Pi
June 27, 2013 9:15 pm Leave your thoughtsOn the last post I talked about installing Ultima 7 from GOG.com, however the game was quite slow and I’ve been trying to find the optimum configurations. Here are some of the things that I did so far to increase the playability of some DOS games under DosBox. This is by no means the end of the tunnel of course, there are numerous other ways that I wanted to try including installing FastDosBox.
Install a Lighter Window Manager
The easiest way to run dosbox is of course under X and I also like the idea having to be able to run the DosBox on a separate popup window so I can see the frame skip and cycle information as I tweaked the game. However, the included window manager in Raspbian, LXDE “feels” more resource consumptive. I suppose because LXDE is a more complete window manager very close to a desktop environment, in some ways it does rival Gnome and KDE.
Anyway, back to speeding up DosBox, I decided to install a minimalist window manager, the Window Maker.
Installation process was straight forward and window maker works straight away for me. It even has the handy terminal launcher on the desktop already.
So to install run:
1 |
sudo apt-get install wmaker |
After that, add an xsession file so that startx will start the Window Maker.
1 2 |
cd ~ vim .xsession |
You can of course use VI or other text editors to create the file. Within the file simply type in the command below and save.
1 |
exec wmaker |
After that quit the text editor and run startx as usual, you’ll be greeted with the new window manager. If you ever want to revert back to lxde simply rename the .xsession file into .xsession_wmaker or something like that so you can use it some other time.
You can then run your DosBox games from within the Window Maker.
Edit the DosBox Configuration
DosBox by default emulates a full DOS machine including sound cards and other devices. There are of course some things that we don’t really need, so we should disable them to conserve our limited resource. Below are the configurations based on each of the sections where optimisations are made. Of course below is not the full dosbox configurations, just the parts that made some differences in performance.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
[sdl] fulldouble=false fullresolution=original windowresolution=original output=surface [dosbox] machine=svga_et3000 memsize=16 [render] scaler=none [mixer] rate=8000 blocksize=2048 prebuffer=240 [midi] mpu401=none [sblaster] sbtype=sb1 [gus] gus=false [speaker] pcspeaker=false tandy=off disney=false [joystick] joysticktype=none [ipx] ipx=false |
Notice that with the config above I have disabled all the non-essential hardware devices such as gus, joystick, speakers, etc. Those actually add up, providing extra hardware resources to use. I even disabled the scaler as I don’t need it, I can always lower the resolution of the Raspberry Pi to match the game resolution.
In addition to the above we will also increase the CPU cycle and add some frameskip to reduce the amount of graphics to render. Be sure to play with your cycle configuration similar to the way shown on our previous DosBox article.
1 2 3 4 5 6 7 8 9 |
[cpu] core=auto cputype=386 cycles=3000 cycleup=10 cycledown=10 [render] frameskip=2 |
Lastly, increase the priority of the DosBox process, using the priority key within the sdl section.
1 2 |
[sdl] priority=highest,normal |
Shutdown Every Non-Essential Processes
I have MySql and Apache running in the background and although they are idle most of the time, they still consumes CPU cycle. Therefore I always shut them down before playing any DOS games. Be on the lookout for any process that may consume CPU cycle in the background, use the top command in the console to find out these processes.
Overclock
There are only so much that you can do to speed up DosBox using the configurations. In the end, it’s down to your physical CPU cycles to increase the emulation performance. So at last I braced myself and set the overclock to “turbo” using the raspi-config application. This results in the Raspberry Pi running at 1ghz. Playing the Ultima 7 after this change felt better. It’s not “native” fluid of course, but somewhat more playable as the “Avatar” now moves a bit faster.
Of course, we’ll have to be careful with any over-clocking especially when pressing the limit like this. Perhaps in the near future I will look at investing to some heatsink pack.
As usual, any comments and tips to share on optimising the DosBox performance on Raspberry Pi will be welcomed with open arms :)
Tags: dosbox, gog games, windowmakerCategorised in: Fun computing, Raspberry Pi