For a few months now I have struggled with 3 separate Ubuntu desktops running SDLMAME that all refused to cleanly exit SDLMAME when I hit escape. Problem solved
If SDLMAME freezes, hangs, crashes or pauses when you try to exit SDLMAME fire up a terminal and type:
sudo apt-get install libsdl1.2debian-pulseaudio
Tested working on Intrepid, Jaunty and Karmic
SDL (Simple DirectMedia Layer) is a library that allows programs low level access to a video framebuffer, audio output, mouse, and keyboard. Installing libsdl1.2debian-pulseaudio is SDL but with added X11 and PulseAudio options. Since SDLMAME is using PulseAudio to handle the sound in games this package adds the relevant code to correctly handle the audio requests between SDL and Pulseaduldio.
A nice 'bonus' of installing this package is that you can play music from another app in the background (say Rhythmbox) at the same time as playing SDLMAME games without that annoying glitching sound that tends to occur by default without affecting the game audio.
Edited to add more detail for those that want to know why it works rather than just how to fix the problem.
Edited again to add:
This also works for MAME 0.136u1 and newer on Linux. As of 0.136u1 SDLMAME became part of the main MAME release and is no longer a separate offshoot.