Getting sound out of Stepmania

I migrated almost all my media consumption onto a Linux based, Ubuntu, Intel atom based Nettop with an Nvidia ION chipset a while ago. Previously i had tried a couple of media players, Popcorn hour and others, which where awful to use to say the least. Sure they played a lot of content but their user interfaces where all terrible.

I think this is a terrific combo. A silent nettop, Ubuntu and XBMC satisfies all my media consumption needs for now.

But to keep us on track with the story. We also have an aging PS/2 here for playing games on etc. This is where Stepmania comes in.Β On the PS/2 we have two Dance pads that are quite fun to play with. Since I have a general quest trying to stop using optical mediums, such as CDs and DVDs, I’m working on retiring the PS/2 as well, keeping the box count at a minimum.

Thus I started investigating Linux alternatives for the games on the PS/2. Singstar got replaced by Performous which is also capable of handling dance pads but this feature seems not really finished yet. (As a side note here, the wireless Singstar microphones worked flawlessly in Ubuntu 10.10. Just plug the receiver into the USB port on the computer and you are done)

Getting sound to work with Stepmania on this system was however not as easy. Installing the application was an easy task. Even though no Debian packages exists, that I’m aware of, there is precompiled binaries for download at the Stepmania web page.

But then when launching the application, it starts up totally muted. The log says something like:

ALSA: Advanced Linux Sound Architecture Driver Version 1.0.23.
ALSA Driver: 0: HDA NVidia [NVidia], device 0: ALC888 Analog [ALC888 Analog], 1/1 subdevices avail
ALSA Driver: 0: HDA NVidia [NVidia], device 1: ALC888 Digital [ALC888 Digital], 1/1 subdevices avail
ALSA Driver: 0: HDA NVidia [NVidia], device 3: NVIDIA HDMI [NVIDIA HDMI], 0/1 subdevices avail
Couldn't load driver ALSA: Not enough substreams for hardware mixing, using software mixing
ALSA: Software mixing at 44100hz
Sound driver: ALSA-sw

Looking at the output above it’s not aparent which of the three devices that gets used. To list the available sinks in the system use the command

aplay -l

which on my system yields

card 0: NVidia [HDA NVidia], device 0: ALC888 Analog [ALC888 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 1: ALC888 Digital [ALC888 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 3: NVIDIA HDMI [NVIDIA HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0

And since I use the HDMI connection to connect the computer to my TV I want my output to use card 0 device 3. This information could of course be retrieved from the log above as well.

To tell Stepmania to really use this device fire up your favorite editor and edit the file Data/StepMania.iniFind the lines that says

SoundDevice=
SoundDrivers=

and change that to

SoundDevice=plughw:0,3
SoundDrivers=

Almost done. This worked somewhat for me but for some strange reason Stepmania almost always terminated with an error (Couldn’t open card) the first time i ran it. Successive invocations always seemed to work. After some investigation it seems like PulseAudio might be the bad guy in this scenario.

The solution is to tell PulseAudio to step back while Stepmania is executing. Starting Stepmania with the pasuspender tool like this

pasuspender stepmania

has worked nicely for me.

The final question is why on earth Stepmania have a problem with this to begin with. All other applications works correctly, using the device i configured. A guess is that Stepmania tries to be a bit to smart for it’s own good. Hopefully the upcoming 4.0 release will do a better job here.

This entry was posted in Howto, Linux. Bookmark the permalink.

4 Responses to Getting sound out of Stepmania

  1. Shira says:

    Big thanks! This was just what I’ve been looking for, for hours now. πŸ˜€ Simple and worked like a charm. πŸ™‚

  2. Loads of thanks! As fast as I realized Stepmania was mute, I googled my way to this article. Solved in 5 minutes. Without this, I’d probably been stuck for hours.

    Hint to others: In version 4 of Stepmania, it seems like the .ini file is located in Save/ directory. Locate it with

    grep -rIi sounddevice ~/.stepmania4

    And please note that Stepmania mustn’t be running when you edit the file, or it will be overwritten. This took me at least two minutes to realize.

    Cheerz!

    Johan

  3. Colin says:

    And in StepMania 5, the ini file is at ~/.stepmania-5.0/Save/Preferences.ini

  4. Chuck says:

    “plughw:0,3” also worked for me, switching to HDMI audio output just as you described. Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.