How to order multiple sound cards with ALSA, when some are using the same module?

Hi all!

I have a sound card on my nvidia graphic card that used to be loaded by udev before my on board sound card so there was no more sound. The problem was both of the cards are using the snd-hda-intel module so I worked around this problem with the following option in /etc/modprobe.d/50-sound.conf, adding a coma to reorder the driver:

options snd slots=,snd-hda-intel

Later on, I installed a USB webcam and I had no sound again because it was again being loaded before my on board sound card. So I worked around this problem by blacklisting snd-usb-audio in /etc/modprobe.d/blacklist.conf:

blacklist snd-usb-audio

But recently, I had to connect a USB to MIDI adapter cable and it wouldn’t show up on my system until I remembered I had previously blacklisted snd-usb-audio. So I temporary commented out that line in /etc/modprobe.d/blacklist.conf to enable my USB MIDI port. So after doing that, I could see the MIDI port but I had no more sound.

I felt like all these manipulations were dirty hacks so I went back to read the ALSA documentation to find a cleaner way, without having to manually change my settings to use the MIDI connection while loosing sound in openSUSE.

So I commented out the snd-usb-audio blacklist and I added the following configuration in /etc/modprobe.d/50-sound.conf, where I used hwinfo to get the vid and pid I needed:

options snd-hda-intel index=1,2 vid=0x1462,0x1043 pid=0x7255,0x8334
options snd slots=snd-hda-intel,snd-usb-audio

This didn’t work and after rebooting I had in kmix the USB card showing first, then nvidia and then the on board card.

Ideally, I would like to see my on board card loading first with the USB card second. I don’t even care about the nvidia sound card and I would rather no see it at all. Does anyone have any idea how I could configure my system this way?

So it looks like you are really trying to stay on top of this problem. I would ask if all during these modifications did you check to see what YaST had set as the default sound card? So I have a creative card and a nVIDA card with sound. I must make a visit to YaST / Hardware / Sound and place the creative card as card “0” or the default card. I did not see you mention you had done this with your sound card.

Thank You,

When I looked at the Sound screen in YaST this is how it showed up:


Index                  Card Model

0                         HDA VIA VT82xx
1                         VT1708/A [Azalia HDAC] (VIA High Definition Controller)
Not configured    nVidia Corporation

So I removed the blacklisted snd-usb-audio module, rebooted and went back on the Sound screen. The USB card was showing up as well but the order was messed up again so I selected HDA VIA VT82xx as the primary card. When I pushed OK, it suggested to remove some of my cards saying KDE detected they could be removed. No matter what I answered to this prompt (I tried answering Yes and No and rebooted twice) it left my system without sound.

Then I had to re-apply the manipulations I had done before to get the sound working again.

I remember you previously helped me out with the first ALSA issue I described above and I could never fix my sound settings in YaST.

I would just like to reorder my USB card as the second one, but as soon as I remove its blacklisted module entry they keep being ordered the opposite way of what I need…

Thanks for your reply!

I’ve never had so many audio devices in a PC at one time.

Is it not possible to assign a card # to the USB device so as to have it last … possibly with an alias ? ie if you start counting (and assign) at card-0 (because I think it starts with 0), and card-0 (motherboard) and card-1 (nvidia) are already in use, then possibly try (speculation on my part) this line somewhere in the 50-sound.conf


alias snd-card-2 snd-usb-audio

You may also need to assign card-0 and card-1 to their appropriate devices (ie don’t assume they will get the 0 and 1 in the order you want) … I don’t know enough to be definitive there … for me it would be a trial and error effort.

But do note, if you are using openSUSE-11.4 with pulse audio, you can also use the application ‘pavucontrol’ to sort your audio devices and that could likely take a lot of the pain out of this.

4 years later, I’ve got no more webcam on my computer, but I still worked around this problem by blacklisting snd-usb-audio in /etc/modprobe.d/blacklist.conf:

blacklist snd-usb-audio

After upgrading to 12.3 on my desktop, tonight this just saved my openSUSE experience, in front of Windows and Apple users, but at least I was able to show them I could “patch” this mess.

I guess I might have an esoteric configuration at home but I wonder how can it be so complicated to implement something stable over ALSA and pulseaudio. I really wish I could help because this smells very bad.

I realize I’m dredging up an old thread, but I see you followed up on it years later Jerome and since I came across it when trying to reorder my snd-hda-intel cards and it helped me, I thought I’d reply.

I couldn’t get this to work either, the cards continued to be in the wrong order even though I reversed them in the vid/pid parameters:

options snd-hda-intel index=1,2 vid=0x1462,0x1043 pid=0x7255,0x8334

However, it worked for me to inside reverse the index, in my case using index 0 and 1:

options snd-hda-intel index=1,0 vid=0x1462,0x1043 pid=0x7255,0x8334

You had additional cards adding complication over my configuration, but I wanted to offer this piece of information in case it helped unravel it a bit for you.

Take care,

-Dan

Post#11 in this thread https://forums.opensuse.org/showthread.php/505170-SOUND-ALSA-two-sound-cards-using-the-same-module?highlight=intel from a couple of weeks ago, has the success of a user with a similar problem. I find it interesting you managed to do with one line of code, the same thing that user Demokrit managed in two lines of code (two lines due to my less than efficient code suggestion).

Thanks for sharing your success.

In Yast. Just select the second card and use the options to change it to default. you can order the cards that way

I do not recall YaST assigning the vid and pid for cases where the same kernel module is used for sound (ie multiple (two) instances of the same module running). That was one of the main points behind this solution needing to be done manually via an edit.

maybe but it does change the order of the drivers and thus the numbering. I found that I had to put the NVIDIA driver first even though the sound was from my MB. If the MB driver was first I got no sound. Change the order in yast and bingo sound.

Indeed YaST works great to reverse the sound card module (and hence driver) order/numbering, IF they are different sound modules/drivers. I recommend anyone with different modules to take your advice to heart.

This thread has a specific title which is “same module”.

YaST sound turning does not work so good if they are the same sound module. There are a number of threads on not just openSUSE forums where this problem was noted and YaST did not help. There are also other distro forums on this very topic of the same sound module being a problem that is not so easy to solve.