# ALSA issue... cannot configure alternate audio card

## chix4mat

Hi all, 

I've been having an issue for a few weeks where I cannot configure the second audio card I have installed. My onboard audio is disabled via BIOS, which leaves me with an ASUS Xonar D2X (virtuoso) and a Chaintech AV-710 (ice1724). Right now I'm running drivers from a recent official non-Gentoo-patched kernel, 2.6.25.7. The problem is that when choosing the ice1724 with alsaconf, the process completes fine, but it doesn't actually activate the card I want it to. Rather, it will default right back to the virtuoso driver. 

Here's the output that alsaconf gives me after selecting the ice1724 card:

```
Running update-modules...

Loading driver...

 * Loading ALSA modules ...

 *   Loading: snd-card-0 ...                                                                  [ ok ]

 *   Loading: snd-seq-oss ...                                                                 [ ok ]

 *   Loading: snd-pcm-oss ...                                                                 [ ok ]

 *   Loading: snd-seq-midi ...                                                                [ ok ]

 * Restoring Mixer Levels ...                                                                 [ ok ]

Setting default volumes...
```

Looks good, except...

```
techgage rwilliams # lsmod

Module                  Size  Used by

snd_seq_midi           10944  0

snd_pcm_oss            41248  0

snd_mixer_oss          18560  1 snd_pcm_oss

snd_seq_oss            33088  0

snd_seq_midi_event     10880  2 snd_seq_midi,snd_seq_oss

snd_seq                52464  5 snd_seq_midi,snd_seq_oss,snd_seq_midi_event

snd_virtuoso           11204  0

snd_oxygen_lib         28672  1 snd_virtuoso

snd_pcm                74760  2 snd_pcm_oss,snd_oxygen_lib

snd_timer              24208  2 snd_seq,snd_pcm

snd_page_alloc         12304  1 snd_pcm

snd_mpu401_uart        11392  1 snd_oxygen_lib

snd_rawmidi            24480  2 snd_seq_midi,snd_mpu401_uart

snd_seq_device         10900  4 snd_seq_midi,snd_seq_oss,snd_seq,snd_rawmidi

snd                    54904  11 snd_pcm_oss,snd_mixer_oss,snd_seq_oss,snd_seq,snd_virtuoso,snd_oxygen_lib,

snd_pcm,snd_timer,snd_mpu401_uart,snd_rawmidi,snd_seq_device

ac97_bus                6144  0

nvidia               8101488  18

soundcore              10768  1 snd
```

... it completely ignored my request and loaded the other card's drivers. 

/etc/modprobe.d/alsa shows this:

```
# --- BEGIN: Generated by ALSACONF, do not edit. ---

# --- ALSACONF version 1.0.16 ---

alias snd-card-0 snd-virtuoso

alias sound-slot-0 snd-virtuoso

# --- END: Generated by ALSACONF, do not edit. ---
```

When I modprobe snd-ice1724 manually, it loads without an issue, so I'm unsure why alsaconf won't go ahead and load it when I ask it to. I don't think it's a driver issue though, because I've tested this with kernel drivers, alsa-drivers from Portage and also the latest stable and beta drivers from the ALSA web site. 

I looked through a few error logs and couldn't see anything related to audio, but if I can attach something that will help, please let me know. I should also mention that the card is not dead... I tested it elsewhere and it worked fine. 

Thanks in advance for any help!

----------

## NeddySeagoon

chix4mat,

I suspect that udev is detecting both your sound cards and loading their modules before /etc/modules.d/alsa gets a look in.

Look at your lsmod after a clean boot.

The first loaded module is at the bottom of the list.

Your sound card 0 is the first loaded driver module, nearest the bottom of the list.

Move the alsa file out of /etc/modules.d (renaming will not work)  and reboot.

If your sound modules are loaded now, its not your alsa file that doing it so changing that won't help.

----------

## chix4mat

Hi NeddySeagoon, 

Thanks for the quick response! I moved the /etc/modules.d/alsa and /etc/modprobe.d/alsa files and the modules all still loaded. I figure it's the alsasound service that's loading them, but I'm not sure. I have nothing in /etc/modules.autoload.d/kernel-2.6.

That aside, after a whack of tinkering, I now have a brand-new issue. Upon initial boot, the virtuoso driver works, but if I so much as dare to run alsaconf, I cannot get it to work again. Instead, no matter what I choose, it will default (ironically) to the ice1724. 

Now it's almost a vice versa prediciment, but they do both work... just not ideally how I'd like them to. Here's the new print-out of modules after I configure alsaconf again, regardless of what I choose to configure.

```
techgage rwilliams # lsmod

Module                  Size  Used by

snd_pcm_oss            41248  0

snd_mixer_oss          18560  1 snd_pcm_oss

snd_seq_oss            33088  0

snd_seq_midi_event     10880  1 snd_seq_oss

snd_seq                52464  4 snd_seq_oss,snd_seq_midi_event

snd_ice1724            95816  0

snd_ice17xx_ak4xxx      7680  1 snd_ice1724

snd_ac97_codec        111304  1 snd_ice1724

snd_ak4114             12928  1 snd_ice1724

snd_pcm                74760  4 snd_pcm_oss,snd_ice1724,snd_ac97_codec,snd_ak4114

snd_timer              24208  2 snd_seq,snd_pcm

snd_page_alloc         12304  1 snd_pcm

snd_pt2258              8064  1 snd_ice1724

snd_i2c                 9344  2 snd_ice1724,snd_pt2258

snd_ak4xxx_adda        12288  2 snd_ice1724,snd_ice17xx_ak4xxx

snd_mpu401_uart        11392  1 snd_ice1724

snd_rawmidi            24480  1 snd_mpu401_uart

snd_seq_device         10900  3 snd_seq_oss,snd_seq,snd_rawmidi

snd                    54904  15 snd_pcm_oss,snd_mixer_oss,snd_seq_oss,snd_seq,

snd_ice1724,snd_ac97_codec,snd_ak4114,snd_pcm,snd_timer, snd_pt2258,

snd_i2c,snd_ak4xxx_adda,snd_mpu401_uart,snd_rawmidi,snd_seq_device

ac97_bus                6144  1 snd_ac97_codec

nvidia               8101488  24

soundcore              10768  1 snd
```

This problem is so frustrating!

----------

## VoidMage

While not quite similar, this is what I have in /etc/modules.d/alsa for my card to work with virtual midi

```

alias snd-card-0 snd-intel8x0

alias sound-slot-0 snd-intel8x0

alias snd-card-1 snd-virmidi

alias sound-slot-1 snd-virmidi

```

You probably need something like that.

And please add breaks to those long lines in your code blocks so this page stops looking silly.

----------

## chix4mat

 *VoidMage wrote:*   

> And please add breaks to those long lines in your code blocks so this page stops looking silly.

 

Hmm, sorry about that. I am using Firefox 3.0 and it's not breaking or expanding the page at all. 

As for /etc/modules.d/alsa, mine shows the proper information whenever I configure a card, but it still doesn't mean it will work. For example, if I configure the virtuoso with alsaconf, it shows it properly in that file... but it's still ice1724 that works.

----------

## hiziki_gard

I have the same exact problem.  

Here is my /etc/modprobe.d/alsa

```

alias char-major-116 snd

alias char-major-14 soundcore

#Card 1

alias snd-card-1 snd-intel8x0

alias sound-slot-1 snd-card-1

alias sound-service-1-0 snd-mixer-oss

alias sound-service-1-3 snd-pcm-oss

alias sound-service-1-12 snd-pcm-oss

options snd-intel8x0 index=1

#Card 2

alias snd-card-0 snd-emu10k1

alias sound-slot-0 snd-card-0

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

options snd-emu10k1 index=0

alias /dev/dsp snd-pcm-oss

alias /dev/dsp1 snd-pcm-oss

options snd cards_limit=2

```

I found that I have to edit the card to be at slot 0 everytime I want to use alsaconf to switch over to that card.  It's a work round but it works.   Anyone have a idea on what is really going on here?

----------

## chix4mat

 *hiziki_gard wrote:*   

> I found that I have to edit the card to be at slot 0 everytime I want to use alsaconf to switch over to that card.  It's a work round but it works.   Anyone have a idea on what is really going on here?

 

What an arduous workaround! 

One thing I noticed with my rig is that after the boot, if I ls -l /proc/asound/, it will show two cards, like this: 

```
rwilliams@techgage ~ $ ls -l /proc/asound/

total 0

lrwxrwxrwx 1 root root 5 Jun 24 03:06 AV200 -> card0

lrwxrwxrwx 1 root root 5 Jun 24 03:06 AV710 -> card1

dr-xr-xr-x 6 root root 0 Jun 24 03:06 card0

dr-xr-xr-x 6 root root 0 Jun 24 03:06 card1

-r--r--r-- 1 root root 0 Jun 24 03:06 cards

-r--r--r-- 1 root root 0 Jun 24 03:06 devices

-r--r--r-- 1 root root 0 Jun 24 03:06 modules

dr-xr-xr-x 2 root root 0 Jun 24 03:06 oss

-r--r--r-- 1 root root 0 Jun 24 03:06 pcm

dr-xr-xr-x 2 root root 0 Jun 24 03:06 seq

-r--r--r-- 1 root root 0 Jun 24 03:06 timers

-r--r--r-- 1 root root 0 Jun 24 03:06 version
```

But as soon as alsaconf is run, goodbye to that:

```
rwilliams@techgage ~ $ ls -l /proc/asound/

total 0

lrwxrwxrwx 1 root root 5 Jun 24 03:08 AV710 -> card0

dr-xr-xr-x 6 root root 0 Jun 24 03:08 card0

-r--r--r-- 1 root root 0 Jun 24 03:08 cards

-r--r--r-- 1 root root 0 Jun 24 03:08 devices

-r--r--r-- 1 root root 0 Jun 24 03:08 modules

dr-xr-xr-x 2 root root 0 Jun 24 03:08 oss

-r--r--r-- 1 root root 0 Jun 24 03:08 pcm

dr-xr-xr-x 2 root root 0 Jun 24 03:08 seq

-r--r--r-- 1 root root 0 Jun 24 03:08 timers

-r--r--r-- 1 root root 0 Jun 24 03:08 version
```

It's so frustrating. Problems have stumped me in the past, but I cannot wrap my head around this one at all.

----------

## NeddySeagoon

chix4mat,

I suspect its udev doing the module loading for you.

To gain control of the module load order, you need to use udevs blacklist file, so it does not modprobe the modules, then your /etc/modules.d/alsa will get used.  udev simply gets in first.

There is a dirty hack you can use with exactly two cards. Build the module for sound card 0 into the kernel and leave the other as a module. It will always be started before any modules are loaded.

----------

## chix4mat

Thanks a lot for the tip NeddySeagoon, I'll keep that in mind for the future. 

Once again though, after some tinkering, my alsaconf is working as it should. I can configure both cards without a single issue, but I still don't understand what the freaking problem was. I edited the /etc/modprobe.d/alsa last night to change the alias, and after that, it was fixed. It doesn't make much sense as to why that would fix it, but it did, or something else did at the same time that I didn't catch. 

Regardless, it's fixed and I'm pleased. I just wish I understood the issue better. 

Thanks again for all of the help!

----------

