LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Alsa Problems (https://www.linuxquestions.org/questions/linux-newbie-8/alsa-problems-551493/)

bookie 05-05-2007 09:46 AM

Alsa Problems
 
Hi again, I have had problems installing my sound card on slackware 11. I tried to use alsaconf, but that didn't work so well. I have two sound cards on my computer - one is inbuilt in the motherboard and the other I have added. The strange thing is - alsaconf finds both of them, but only the inbuilt one comes up when I run alsamixer? I will add that I choose the sound card that I have added myself. Why does alsaconf choose the wrong one? The inbuilt one is a intel and the other diamond multimedia sonic impact. Even though the sonic impact card is old - it is better than the built in one.
Has anyone any ideas as what I can do to make alsa choose the right card.

bookie

manwichmakesameal 05-05-2007 10:05 AM

Rebuild
 
The easiest way that I've found to keep alsa from using the wrong soundcard is to either modprobe -r unwantedmodule or just recompile your kernel and don't even enable the module for said unwanted soundcard.

bookie 05-05-2007 10:15 AM

Re Alsa problems
 
Thanks for the quick response manwichmakesameal. Do you think that you could elaborate a little for a newbie. Don't know all the commands and how to go about them, so a little more info would be greatly appreciated.

manwichmakesameal 05-05-2007 10:27 AM

commands
 
modprobe -r will just remove the unwanted module, (driver for soundcard or whatever). So if you do lsmod, you get something like
Code:

x_tables              11460  5 xt_tcpudp,iptable_nat,ipt_LOG,xt_state,ip_tables
it87                  16656  0
hwmon_vid              2688  1 it87
i2c_isa                3456  1 it87
eeprom                  5456  0
tuner                  59496  0
bttv                  167604  0
video_buf              19780  1 bttv
ir_common              29636  1 bttv
compat_ioctl32          1024  1 bttv
i2c_algo_bit            6728  1 bttv
btcx_risc              3848  1 bttv
nvidia              4703828  20
tveeprom              13264  1 bttv
snd_emu10k1          126720  2
snd_rawmidi            19104  1 snd_emu10k1
firmware_class          7104  2 bttv,snd_emu10k1
snd_ac97_codec        93024  1 snd_emu10k1
ac97_bus                1728  1 snd_ac97_codec
snd_pcm                69000  4 snd_pcm_oss,snd_emu10k1,snd_ac97_codec
snd_seq_device          6284  4 snd_seq_oss,snd_seq,snd_emu10k1,snd_rawmidi
snd_page_alloc          7304  2 snd_emu10k1,snd_pcm
snd_util_mem            3328  1 snd_emu10k1
rtc_cmos                6804  0
joydev                  7808  0
videodev              25600  1 bttv
rtc_core                6740  1 rtc_cmos
rtc_lib                2944  1 rtc_core

On my system, the snd_emu10k1 is the module for my soundcard. If I didn't want it loaded, I would just do modprobe -r snd_emu10k1. When you unload a module, you have to make sure it's not being used by anything though. So you may want to log out of X then use modprobe.

bookie 05-05-2007 10:52 AM

Re Alsa problems
 
Thanks for all the info, but I am still at a loss as to what I should write in the command console. Sorry to seem a bit dense. Some things with linux take a little longer for me to grasp. Getting on a bit now.

bookie

manwichmakesameal 05-05-2007 11:08 AM

console
 
When you run modprobe, you have to be root. So your prompt might look like:
Code:

root@graceland:~#
So when you type in commands, it will look like:
Code:

root@graceland:~# modprobe -r snd_emu10k1
To get to root, just type su, then it will prompt you for the root password. Type it in and hit enter. Only log in as root WHEN ABSOLUTELY NECESSARY. Like they say, "Don't take the name of root in vain." You can run lsmod as normal user, so you don't need to be root. So to see a list of loaded modules, just do:
Code:

allen@graceland:~$lsmod

netcrawl 05-05-2007 11:10 AM

I find the simplest way to disable onboard sound is to disable the option in BIOS settings; this assumes the option is available in your MB's BIOS settings, and that you do not want to use onboard sound at all.

bookie 05-06-2007 12:20 PM

Success
 
Thanks a lot guys. I hadn't even given it a thought to change the info in bios. I tried netcrawl's way because it was easiest - and that I don't run the risk of removing something that I might need in the future.
Once again, thanks

bookie

AlfredSka 07-10-2007 07:07 PM

Another Fix
 
Another solution to the problem:

If you want to keep both sound cards running (for whatever reason), you can specify which card gets which ID at load time.
Code:

cat /proc/asound/modules
Copy that information down EXACTLY.
Code:

cd /etc/modprobe.d
Look for a file named "sound", "alsa", or "alsa-base"
Edit the file you have, for example:
Code:

su
nano /etc/modprobe.d/sound

Add lines:
Code:

install sound-slot-0 NAME_CARD_1
install sound-slot-1 NAME_CARD_2

For example on my system I have:
install sound-slot-0 snd_emu10k1
install sound-slot-1 snd_bt87x
install sound-slot-2 snd_usb_audio

I have commented out the alias lines that were originally in the file as well, and it hasn't caused problems yet, but if you do run into problems, just make sure the name of the alias is correct. (Pay particular attention to dashes being used when underscores should be used)

ctrl-O saves the file
ctrl-x exits from nano

Reboot the system and see if it works.

IF IT DOESN'T WORK there's another ugly solution:
create ".asoundrc" in home directory with the following:

Code:

pcm.!default {
        type hw
        card 2
        }

ctl.!default {
        type hw
        card 2
        }

Change "card #" to whichever number represents the sound card you want to use.

You can find the card # by: "alsamixer -c#" until you hit the one you're looking for.

For reference, the first solution was mostly ripped from https://bugs.launchpad.net/ubuntu/+s...ver/+bug/56482
while the second solution was taken from the ALSA Wiki

bookie 07-11-2007 01:01 PM

Hi AlfredSka
 
Thanks for the update. I appreciate the help.

bookie


All times are GMT -5. The time now is 09:29 PM.