30 March 2012

Ubuntu Default Sound Card Select


Change the default sound card in Ubuntu Karmic

I’ve got a pc with two sound cards, the onboard sound, and a Sound Blaster Live Value I’ve had for a while. I use the Sound Blaster as I’ve never been able to get the onboard sound working in Ubuntu. For some reason or other, I managed to mess up the default sound card on my install of Ubuntu Karmic. Sound would work for most apps, but wouldn’t work for Flash (such as Youtube). Most of the apps were going through PulseAudio, and working fine. Flash however was still using Alsa directly and was using the wrong sound card by default, hence no sound.
So, I set about trying to fix the issue, but it quickly became apparent that it wasn’t an easy fix. There used to be an app called “asound” which would let you configure this sort of thing. But since Karmic it has been dropped from the repo’s! So I found a different way of fixing the issue.
You’ll need a terminal window open.
  1. Find out what your default sound card is. You can simply do this by firing up alsamixer. The card that shows upon opening it is your default sound card for Alsa.
  2. sudo alsamixer
  3. Next list the names of your sound cards. It should show two cards, and their “index”. The one with index 0 is your default one. In my case it was “snd_hda_intel”
  4. cat /proc/asound/modules
  5. Take note of the name of the card you don’t want to be the default. As mentioned mine was “snd_hda_intel”. You then need to open up the Alsa base configuration file.
  6. sudo gedit /etc/modprobe.d/alsa-base.conf
  7. Look for the line “# Prevent abnormal drivers from grabbing index 0″, then above it you want to put the following…
  8. options snd_hda_intel index=1
  9. In the above line I’ve set the currently default card (the one I don’t want as the default) to an index of 1. This will force the other card to become index 0 and hence the default.
  10. Reboot, and all should be fixed. To check you can “sudo alsamixer” and see which card comes up.

1 comment:

Miro Turek said...

After command: sudo alsamixer getting message:
Cannot open mixer No such file or directory

After refusing installation Windows 10, I installed Linux Mint. first of all it reacts quite slowly and I do not heave a sound. As a beginner I tried everything suggested on internet but to no avail. As a beginner in Linux I am very disappointed with such a simple things I used to solve in no time from Windows 95 to Windows 7. I also had (many years ago) MS DOS training, but in this Linux I do not know how to check if system even sees my sound card (built directly in MoBo).