Getting alsa-oss compatibility to work in 12.1

I recently reloaded openSuSE from scratch as I just upgraded my PC (new hard disks). All is good so far, except for one thing; I cannot get some old games to produce any sound. They are written to use oss, so I’m trying to get them to work using alsa’s oss compatibility. Things are not going well though. The problem is that none of the modules related to alsa-oss seem to be loading (snd-seq-oss, snd-mixer-oss, and snd-pcm-oss). If I could get that working, I could move on to the real problem of getting these old games to use that oss compatibility mode. I’m not there yet though.

BTW, these are all linux versions of games, so I cannot run them in WINE.

Here’s some basic system information:

   :~> uname -a 
 Linux YP38 3.1.10-1.9-desktop #1 SMP PREEMPT Thu Apr 5 18:48:38 UTC 2012 (4a97ec8) x86_64 x86_64 x86_64 GNU/Linux


   :~> cat /etc/SuSE-release 
 openSUSE 12.1 (x86_64) 
 VERSION = 12.1 
 CODENAME = Asparagus


Here’s the information requested in the sticky thread (uname -a is above):
Output of /usr/sbin/alsa-info.sh:
http://www.alsa-project.org/db/?f=d1309f502ccb786e48bba4d5bf4d3dc9d359ff33

   :/> rpm -qa '*alsa*' 
 alsa-driver-kmp-desktop-1.0.25.20120527_k3.1.10_1.9-1.1.x86_64 
 alsa-plugins-32bit-1.0.25-53.2.x86_64 
 alsa-firmware-1.0.25-26.1.noarch 
 alsa-oss-1.0.25-33.1.x86_64 
 alsa-oss-32bit-1.0.25-33.1.x86_64 
 alsa-utils-1.0.25-65.1.x86_64 
 alsa-devel-32bit-1.0.25-123.1.x86_64 
 alsa-1.0.25-123.1.x86_64 
 alsa-plugins-pulse-1.0.25-53.2.x86_64 
 alsa-plugins-pulse-32bit-1.0.25-53.2.x86_64 
 alsa-plugins-1.0.25-53.2.x86_64 
 alsa-docs-1.0.25-123.1.noarch 
 alsa-devel-1.0.25-123.1.x86_64


   :/> rpm -qa '*pulse*' 
 pulseaudio-1.1-1.2.x86_64 
 libpulse0-32bit-1.1-1.2.x86_64 
 pulseaudio-module-bluetooth-1.1-1.2.x86_64 
 pulseaudio-module-zeroconf-1.1-1.2.x86_64 
 pulseaudio-module-x11-1.1-1.2.x86_64 
 pulseaudio-module-gconf-1.1-1.2.x86_64 
 libpulse-mainloop-glib0-32bit-1.1-1.2.x86_64 
 libpulse0-1.1-1.2.x86_64 
 pulseaudio-utils-1.1-1.2.x86_64 
 libpulse-mainloop-glib0-1.1-1.2.x86_64 
 pulseaudio-equalizer-2.7rev4-1.1.noarch 
 pulseaudio-module-lirc-1.1-1.2.x86_64 
 alsa-plugins-pulse-1.0.25-53.2.x86_64 
 alsa-plugins-pulse-32bit-1.0.25-53.2.x86_64 
 libpulse-devel-1.1-1.2.x86_64


   :/> rpm -q libasound2 
 libasound2-1.0.25-123.1.x86_64


   :/> cat /etc/modprobe.d/50-sound.conf 
 # ALSA portion 
 alias char-major-116 snd 
  
 # OSS/Free portion 
 alias char-major-14 soundcore 
 alias sound-slot-0 snd-card-0 
 alias sound-slot-1 snd-card-1 
  
 options snd slots=snd-virtuoso,snd-hda-intel 
  
 # AMUB.hJ2fTVR7hHD:Virtuoso 100 (Xonar DX) 
 alias snd-card-0 snd-virtuoso 
  
 # NXNs.hGKkp_Wnp_0:nVidia Corporation 
 alias snd-card-1 snd-hda-intel 
  
 # card #1 
 alias sound-service-0-0 snd-mixer-oss 
 alias sound-service-0-1 snd-seq-oss 
 alias sound-service-0-3 snd-pcm-oss 
 alias sound-service-0-8 snd-seq-oss 
 alias sound-service-0-12 snd-pcm-oss 
  
 # card #2 
 alias sound-service-1-0 snd-mixer-oss 
 alias sound-service-1-3 snd-pcm-oss 
 alias sound-service-1-12 snd-pcm-oss


BTW, before I go any further, let me make it clear that my audio is working fine otherwise. Probably should have said that from the start. Oops.

Following the SDB: Audio troubleshooting page, I did the following:
*Installed Pulse Audio Volume Control (pavucontrol)
*I then updated Alsa to the latest version…

   :~> rpm -q alsa alsa-utils alsa-firmware 
 alsa-1.0.25-123.1.x86_64 
 alsa-utils-1.0.25-65.1.x86_64 
 alsa-firmware-1.0.25-26.1.noarch


*Deleted sound cards in YAST, the deleted /etc/modprobe.d/50-sound.conf.
*Used YAST to set up cards again.
*Checked sound system for detailed information…

   :~> cat /proc/asound/version 
 Advanced Linux Sound Architecture Driver Version 1.0.25-git20120527. 
 Compiled on May 26 2012 for kernel 3.1.10-1.9-desktop (SMP).


   :~> cat /proc/asound/modules 
  0 snd_virtuoso 
  1 snd_hda_intel


   :~> cat /proc/asound/cards 
  0 [DX             ]: AV200 - Xonar DX 
                       Asus Virtuoso 100 at 0xd000, irq 16 
  1 [NVidia         ]: HDA-Intel - HDA NVidia 
                       HDA NVidia at 0xfb080000 irq 17


On Step-5 of those instructions, I could not find the information they specified in the /usr/src/linux-2.6.22.13-0.3/Documentation/sound/alsa/ALSA-Configuration.txt file, so I did not add a “model=” option to my /etc/modprobe/50-sound.conf file.

At the end of Step-3, the document has me go to the Alsa Wiki and check for additional codec information for my specific card (Asus Xonar DX aka Asus Virtuoso). Here’s a link to the page: http://www.alsa-project.org/main/index.php/Matrix:Module-virtuoso
The first step is to run the following:

:/> sudo /sbin/modinfo soundcore
root's password:
filename:       /lib/modules/3.1.10-1.9-desktop/kernel/sound/soundcore.ko
alias:          char-major-14-*
license:        GPL
author:         Alan Cox
description:    Core sound module
srcversion:     8C2CC496EFFF806BFEE1D0C
depends:        
vermagic:       3.1.10-1.9-desktop SMP preempt mod_unload modversions 
parm:           preclaim_oss:int

If it returns something other than nothing found, you don’t have to recompile kernel. Cool.

So I can skip the installation part as it’s already installed (and working except for oss-compatibility).

The next step is to alter the /etc/modprobe.d/50-sound.conf file. I wants me to to add these lines:


# ALSA portion
alias char-major-116 snd
alias snd-card-0 snd-virtuoso

# module options should go here

# OSS/Free portion
alias char-major-14 soundcore
alias sound-slot-0 snd-card-0

# card #1
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss

Rather than just overwrite what was in the file, I merged the two manually. The result was the 50-sound.conf posted above. The next step was autoloading OOS/Free emulation. That was redundant as you can see by the “card #1” section. I did add the aliases for the second sound card, though I don’t use it currently. Finally, I created a ~/.asoundrc file as follows, per the alsa wiki:

pcm.virtuoso {
  type hw
  card 0
}
      
ctl.virtuoso {
   type hw
   card 0
}

.

So that’s where I am now. When I reboot my system and try to run one of the games that uses OSS, I get no sound, or errors. However, if I then do an lsmod, I find that none of the “oss” specific modules are loaded.

BTW, I did use the /etc/sysconfig Editor in YAST to modify the Hardware | Soundcard section as follows:
LOAD_SEQUENCER: yes
SOUNDFONT_FILES:
LOAD_OSS_EMUL_MODULES: yes
LOAD_OSS_SEQ_MODULE: yes (was set to “no” originally).

So what am I doing wrong. Why are these modules not loading, and how can I get them to load?

BTW, since I know I’ve got problems getting the games to recognize the oss-compatibility stuff, does anybody have a way that I can test that oss stuff to make sure it is working? For all I know, it’s broken and this is all a waste of time. I’d like to test that out first, just to be sure.

There are two alsa’s oss compatibility modes. First use the user space one, that requires no kernel modules and lets other apps use the sound card. Just run the game as “aoss <game>” instead of “<game>”.

I have tried that with Pulse Audio enabled and with Pulse Audio disabled to no effect. However, I will try it again, just to be sure. When I tried it, it was before making all the updates and verifications. It will be a few days before I can test it though. I’m out of town.

I tried aoss <game>. No luck.

Can anybody help me figure out how to get the oss modules loaded? What have I done wrong, or forgotten to do?

Since I guess you are using PulseAudio you should try with “padsp” instead.

Otherwise. kernel-space emulation…

First, it doesn’t work out of the box because of this: Access Denied

Second… loading a module is really easy: execute “modprobe <module_name>” as root
So just run “modprobe snd-pcm-oss”. Everything else you did was unneeded.

If you are running pulseaudio you may need to run the games with “pasuspender”.

“padsp” doesn’t work. Apparently, it doesn’t work on most distros based on what I’ve been reading. Instead, I had to use LD_PRELOAD=/usr/lib/libpulsedsp.so <game launcher script> (or something like that - that was by memory, I’m not on that system right now).

Otherwise. kernel-space emulation…

First, it doesn’t work out of the box because of this: Access Denied

Good, intersting info. Thanks for the link.

Second… loading a module is really easy: execute “modprobe <module_name>” as root
So just run “modprobe snd-pcm-oss”. Everything else you did was unneeded.

If you are running pulseaudio you may need to run the games with “pasuspender”.

I didn’t execute modprobe. Instead, I used the /etc/configsys Editor in YaST to add those to modules to load at boot in the kernel settings. I think I will remove those and add the modprobe lines to the startup script of the game. That way they won’t be loaded unless I run the game.

I didn’t try “pasuspender”, but I might if I still have trouble.

Thanks for the help.