Jump to content

switching from OSS to ALSA


skyhawk
 Share

Recommended Posts

I am running Mandriva 2007.0, kernel 2.6.17-5mdv. My KDE sound system is currently set-up to use the OSS driver for my on-board audio. With this audio set-up, I have some sound skipping when playing MP3 files using Amarok, regardless of buffer settings, and I am unable to play MIDI files. Also, when I start DOSBox 0.72 (self-compiled) I see the following Konsole output:

 

[me@mycomputer]$ dosbox
DOSBox version 0.72
Copyright 2002-2007 DOSBox Team, published under GNU GPL.
---
ALSA lib confmisc.c:670:(snd_func_card_driver) cannot find card '0'
ALSA lib conf.c:3479:(_snd_config_evaluate) function snd_func_card_driver returned error: No such device
ALSA lib confmisc.c:391:(snd_func_concat) error evaluating strings
ALSA lib conf.c:3479:(_snd_config_evaluate) function snd_func_concat returned error: No such device
ALSA lib confmisc.c:1070:(snd_func_refer) error evaluating name
ALSA lib conf.c:3479:(_snd_config_evaluate) function snd_func_refer returned error: No such device
ALSA lib conf.c:3947:(snd_config_expand) Evaluate error: No such device
ALSA lib pcm.c:2143:(snd_pcm_open_noupdate) Unknown PCM default
CONFIG:Loading primary settings from config file /home/myuserID/.dosboxrc
CONFIG:Loading additional settings from config file dosbox.conf
ALSA lib seq_hw.c:457:(snd_seq_hw_open) open /dev/snd/seq failed: No such file or directory
ALSA:Can't open sequencer
MIDI:Opened device:none
MAPPER: Loading mapper settings from /home/myuserID/mapper.txt

 

Obviously, DOSBox would prefer having ALSA installed, and the sound I hear when running it confirms that fact. So, I have decided to switch to the ALSA driver, but before doing so, I have two initial questions.

 

1. Switching to the ALSA driver is easily done using MCC:

 

MCC/Hardware/Look at and configure the hardware/Soundcard ICH2 810 Chipset AC'97 Audio Controller/Run config tool/...

 

i810_audio [OSS]

snd-intel8x0 [ALSA]

 

but I would like to know the corresponding CLI method for changing the soundcard driver.

 

2. After the ALSA driver has been selected and loaded, the ALSA documentation recommends:

 

   Copy and paste this [script] to the bottom of your /etc/modules.conf file:

  # ALSA portion
  alias char-major-116 snd
  alias snd-card-0 snd-intel8x0
  # 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

 

For Mandriva 2007.0, the correct path is /etc/modprobe.conf; there is no /etc/modules.conf file. The above script, by the way, is specific to the i810 chipset.

 

The ALSA documentation also recommends: "If you get an 'init_module: No such device' error when you run this <modprobe> command [referring to initial module insertion tests, not the execution of the above script, which serves to automate the module loading], make sure that you uninstall all the sound related modules first."

 

I do not anticipate any module removal, but should it be necessary I do not want to do anything permanently; I want the option to be able to easily revert back to the OSS sound system if something is not to my liking. I am a complete newbie as far as the <modprobe -r> command is concerned, but I understand that only modules that are not in use can be removed, and I assume that any modules removed using <modprobe -r> are only removed from memory, not permanently from the kernel stored on HDD.

 

All this sets up my second question: if I need to prevent specific modules from being loaded at boot-up, how can I do so, again by using the CLI method? At this moment I am assuming that appropriate lines, such as "remove ... etc. ... etc.", added to modprobe.conf will do the job.

 

I should have more questions concerning ALSA configuration in the near future, particularly when I tackle MIDI functionality. Doing that will require adding more lines of script to /etc/modprobe.conf, among other things. I have already installed almost every ALSA-related package for Mandriva 2007.0, so whatever I might need is readily at-hand.

 

Thanks in advance for reading all this. I was educated in a scientific discipline, so I rapidly learned to rely in the time-trusted addage, "If you can't dazzle them with brilliance, then baffle them with ...", well, you know the last word ... I don't have to spell it out. Anyway, terse prose is not one of my talents.

 

Some additional Konsole output follows:

 

[me@mycomputer]# lsmod			   <-- This shows loaded modules
...
i810_audio			 33684  0
ac97_codec			 18316  1 i810_audio
soundcore			   8096  1 i810_audio
...

[me@mycomputer]$ cat modprobe.conf		 <-- This shows current settings
alias eth0 eepro100
alias sound-slot-0 i810_audio
install usb-interface /sbin/modprobe uhci-hcd; /bin/true
alias net-pf-10 off

[me@mycomputer]# lspci | egrep audio
00:1f.5 Multimedia audio controller: Intel Corporation 82801BA/BAM AC'97 Audio (rev 02)

[me@mycomputer]# lspcidrake -v | grep -i audio
i810_audio	  : Intel Corp.|ICH2 810 Chipset AC'97 Audio Controller [MULTIMEDIA_AUDIO] (vendor:8086 device:2445 subv:0e11 subd:000b)

 

--------------------------------------------------

Compaq Deskpro EN, Pentium III 933 MHz, 256 MB RAM, Nvidia Riva TNT2 AGP Card, Canon BJC-610 Printer, Best Data 56SX92 External Serial Modem, Mandriva 2007.0, kernel 2.6.17-5mdv, KDE 3.5.4

--------------------------------------------------

Link to comment
Share on other sites

The sound card driver is a kernel module. You can use the modprobe command to add or remove a kernel module. But you also have to start the ALSA service too. I don't know if the kernel module starts automatically ALSA too or no not but in case it doesn't you can use the

service servicename start

command or the chkconfig command to start it. Note that after a reboot these settings will disappear and you have to load the services again unless you use chkconfig with the --add switch.

 

To blacklist a module Mandriva has /etc/modprobe.d/blacklist-compat and blacklist-mdv files. I can't remember Mandriva 2007.

Link to comment
Share on other sites

Thanks very much, dexter11. What you have written is helpful. I am already familiar with starting and stopping system services thanks to the Bruno Linux website. ALSA is running at boot-up, but is not yet functional, due to its driver not being loaded and no configuration. I will do a little more research on "blacklisting" to confirm where the appropriate lines should be added, if necessary. I think getting MIDI functionality will be the major challenge ahead.

Link to comment
Share on other sites

dexter11: Can you confirm if the files /etc/modprobe.d/blacklist-compat and /etc/modprobe.d/blacklist-mdv are original Mandriva 2008.0 installation files, or are they autogenerated sometime after the initial install? This is changed from Mandriva 2007.0. For Mandriva 2007.0, /etc/modprobe.d/ contains only one file on my system:

 

-rw-r--r-- 1 root root 70 Sep 19  2006 ldetect-lst.conf

and cat ldetect-lst.conf gives:

alias pcmcia:m*c*f*fn*pfn*paC7B8DF9Dpb1700D087pc4B74BAA0pd* hostap_cs

 

So, right at this moment, it looks like a line beginning with "remove" in /etc/modprobe.conf for Mandriva 2007.0 will have the same effect as a line beginning with "blacklist" in /etc/modprobe.d/blacklist-mdv for Mandriva 2008.0. See the following example, taken from a recent MUB post, where a soundcard is being blacklisted.

 

/etc/modprobe.conf

alias eth0 8139too
install scsi_hostadapter /sbin/modprobe sata_via; /sbin/modprobe usb_storage; /bin/true
# alias sound-slot-1 snd_via82xx
install usb-interface /sbin/modprobe uhci_hcd; /sbin/modprobe ehci_hcd; /bin/true
install ide-controller /sbin/modprobe via82cxxx; /bin/true
remove snd_emu10k1 /sbin/modprobe --first-time -r --ignore-remove snd_emu10k1
install snd_emu10k1 /sbin/modprobe --first-time --ignore-install snd_emu10k1

/etc/modprobe.d/blacklist-mdv

# blacklisted modules for PCI coldplug
# see also /etc/modprobe.d/blacklist-compat

blacklist rivatv
blacklist snd_via82xx

 

Although the above example is from a Mandriva 2008.0 system, note the "remove" line in /etc/modprobe.conf. Actually, the scripts in the two files seem redundant to me. I would think the line that is commented-out in /etc/modprobe.conf would be enough to do the job. Correct me if I am wrong on this.

 

I am staying with Mandriva 2007.0 at least until the closing months of this year, although I might purchase installation discs for Mandriva 2008.1 in Summer or Fall, if I see complaints related to the sound system fading away. I would like to have two system units so that I can "leap-frog" Mandriva distributions from year-to-year. It is my personal preference to have only one Mandriva release installed per unit, and no Microsoft Windows versions need apply.

Link to comment
Share on other sites

Both files came in the package module-init-tools. It's a base package in Mandriva 2008.

module-init-tools - Tools for managing Linux kernel modules​ 

 

This package contains a set of programs for loading, inserting, and removing kernel modules for Linux (versions 2.5.47 and above). It serves the same function that the "modutils" package serves for Linux 2.4.

Their content is either autogenerated or prewritten because I've never changed any of them but there are a few module names in them.

This is from the beginning of blacklist-compat:

# Listing a module here prevents the hotplug scripts from loading it.

# Usually that'd be so that some other driver will bind it instead,

# no matter which driver happens to get probed first. Sometimes user

# mode tools can also control driver binding.

 

Mandriva 2008.1 will use a new audio system called PulseAudio. Like with every new system you can expect some problems.

Link to comment
Share on other sites

modules.conf is old, the documentation you refer to above is dated. Ignore it.

ALSA documentation, available at the official website, points out that for kernel 2.6 script should be added to /etc/modprobe.conf. Script is added to /etc/modules.conf for earlier kernels. So, anyone reading that documentation page should not be confused.

 

I will post on this topic later if I have other questions, or to summarize the procedure used to changeover my sound system. At this moment, everything seems very clear and I am ready to go ahead.

Link to comment
Share on other sites

Trying to switch from OSS to ALSA was a minor fiasco in my case. It was all wasted effort. ALSA documentation, obtained from the official ALSA website, is out-of-date just enough to be next to worthless; setup instructions do not reflect reality. I have also concluded that my on-board audio hardware is insufficient to play MIDI files, otherwise the necessary OSS modules would have been automatically installed by Mandriva 2007.0. My on-board audio is detected as follows:

 

[root@localhost /]# lspci | egrep audio
00:1f.5 Multimedia audio controller: Intel Corporation 82801BA/BAM AC'97 Audio (rev 02)

[root@localhost rcglassford]# lspcidrake -v | grep -i audio
i810_audio	  : Intel Corp.|ICH2 810 Chipset AC'97 Audio Controller [MULTIMEDIA_AUDIO] (vendor:8086 device:2445 subv:0e11 subd:000b)

 

Initial <modprobe> commands to test insertion of ALSA modules went smoothly, but when I rebooted after adding the recommended script to /etc/modprobe.conf, I saw that things were beginning to get strange. The added lines of script had disappeared, although module insertion seemed to have taken place with no apparent problems. I had audio at this point. Going further, trying to insert the module <snd-seq>, is when everything went wrong. No sound, ALSA could no longer be started or stopped, and <alsamixer> settings could not be stored.

 

As a residual after-effect of the whole process, I now have two extra lines in my /etc/modprobe.conf file that were not there before, and they refuse to be deleted.

 

[root@localhost etc]$ cat modprobe.conf
alias eth0 eepro100										<-- pre-ALSA 
install usb-interface /sbin/modprobe uhci-hcd; /bin/true   <-- pre-ALSA
alias net-pf-10 off										<-- pre-ALSA
alias sound-slot-0 i810_audio							  <-- pre-ALSA
blacklist audio											<-- post-ALSA
blacklist snd-usb-audio									<-- post-ALSA

 

Despite the added lines, however, my OSS seems to be back to normal, although I am wondering why those two extra lines persist. ALSA has been stopped at boot-up (it is now behaving), and I removed the /etc/modprobe.d/sound file created by <alsaconf>.

 

I discovered an easy way to solve the sound-skipping problem in Amarok, and I also discovered there are soft synths available the can be linked to /dev/dsp, the OSS output device, making playing of MIDI files possible without hardware. So, OSS will be staying on my unit. It is much more user-friendly than ALSA.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...