Monday, April 27, 2009

Dosbox and Ubuntu 9.04 Jaunty

I've been having problems with my DOSBox after upgrading to Jaunty. Here's problems and the fix for one of them at least:

1. The arrow keys are not responding. (actually they are mapped to totally different keys)
For Ubuntu Jaunty the 'usescancodes' option for SDL must be disabled. To do this you edit the DOSBox config file (dosbox.conf or .dosboxrc), go to the [sdl] section and edit the line to say:

usescancodes=false

This should do the trick.

The following sites are where I found the solution:
http://ubuntuforums.org/showthread.php?p=5963381
http://vogons.zetafleet.com/viewtopic.php?t=19851

If you haven't got a dosbox.conf or .dosboxrc file in your home directory you can create it by doing the following:

  • Open DOSBox
  • Type 'config -writeconf dosbox.conf'
  • The file dosbox.conf will be created in your home directory
  • Rename the file to .dosboxrc if you want it to be hidden 

2. The sound is either totally gone or stuttering.

UPDATE: Use export SDL_AUDIODRIVER=esd instead, you will also need to have the package libsdl1.2debian-esd installed. See comments, thanks to mgedmin and Alex for the solution.

I haven't found the solution to this problem yet, noone seems to have (So if you have please tell me). But one can try the following: The problem is apparently caused by the change from ALSA sound server to PulseAudio.
Download the PulseAudio plugin, libsdl1.2debian-pulseaudio using synaptic or by typing:

sudo aptitude install libsdl1.2debian-pulseaudio

You will be asked to uninstall libsdl1.2debian-alsa. alternatively you can install libsdl1.2debian-all if you want to keep the ALSA plugin.
Now you need to tell SDL (which is what DOSBox is built on) to use PulseAudio, type export SDL_AUDIODRIVER=pulse in a console window, then start dosbox from the same window by typing dosbox

You might also be getting errors like

ALSA:Can't subscribe to MIDI port (65:0) nor (17:0)
MIDI:Opened device:oss

then go to the dosbox.conf file, find the MIDI section and change the settings in there to:

mpu401=intelligent
device=default
config=128:0


Hope some of this is of any help to you.

2 comments:

  1. 'export SDL_AUDIODRIVER=esd' helped me fix sound stuttering problems in dosbox in Jaunty. I found the suggestion via Google on Fedora forums.

    ReplyDelete
  2. Thanks for posting this!

    Telling SDL to use PulseAudio didn't work for me, but telling it to use ESD did. In order for mgedmin's advice to work it seems necessary to have the libsdl1.2debian-esd package installed as well.

    ReplyDelete