You are not logged in.

#1 2020-09-26 21:30:25

Maniaxx
Member
Registered: 2014-05-14
Posts: 738

[Solved]How to change audio card id for NVidia audio driver?

Hallo,
i have 3 audio devices (SBAudigy2, Intel HDA, HDA NVidia). The NVidia card occupies 'card0' but it should be 'card2' (with aplay -l). When i apply the modprobe index option (see below) the SBAudigy2 throws an error in bootlog that the slot is already occupied and i don't know the handle for the NVidia card as its the proprietary driver (there is no snd_* driver for nvidia).

Any idea how to shift the nvidia index?

/etc/modprobe.d/alsa-base.conf:

options snd_emu10k1 index=0
options snd_hda_intel index=1

$ dmesg |grep snd_

[   11.265764] snd_hda_intel 0000:00:1b.0: enabling device (0000 -> 0002)
[   11.265961] snd_hda_intel 0000:01:00.1: enabling device (0000 -> 0002)
[   11.265989] snd_hda_intel 0000:01:00.1: Disabling MSI
[   11.265992] snd_hda_intel 0000:01:00.1: Handle vga_switcheroo audio client
[   11.374052] snd_hda_codec_realtek hdaudioC1D0: autoconfig for ALC892: line_outs=4 (0x14/0x15/0x16/0x17/0x0) type:line
[   11.374056] snd_hda_codec_realtek hdaudioC1D0:    speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[   11.374058] snd_hda_codec_realtek hdaudioC1D0:    hp_outs=1 (0x1b/0x0/0x0/0x0/0x0)
[   11.374060] snd_hda_codec_realtek hdaudioC1D0:    mono: mono_out=0x0
[   11.374062] snd_hda_codec_realtek hdaudioC1D0:    dig-out=0x1e/0x0
[   11.374064] snd_hda_codec_realtek hdaudioC1D0:    inputs:
[   11.374066] snd_hda_codec_realtek hdaudioC1D0:      Front Mic=0x19
[   11.374068] snd_hda_codec_realtek hdaudioC1D0:      Rear Mic=0x18
[   11.374070] snd_hda_codec_realtek hdaudioC1D0:      Line=0x1a
[   11.559824] snd_emu10k1 0000:06:01.0: cannot find the slot for index 0 (range 0-3), error: -16
[   11.560240] snd_emu10k1: probe of 0000:06:01.0 failed with error -16

Last edited by Maniaxx (2020-09-27 16:00:55)


sys2064

Offline

#2 2020-09-26 21:54:02

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,664

Re: [Solved]How to change audio card id for NVidia audio driver?

You need to pass multiple params for each card you want to manipulate and pass them comma seperated, so

options snd_emu10k1 index=0
options snd_hda_intel index=2,1 #... if the nvidia card occupies 0 without configuration that means it's the first card being enumerated so the first index value will relevantly shift the nvidia card to slot 2, the second the internal analog card to 1

If you don't care which of the snd_hda_intel cards gets which spot you can also do the more flexible config of

options snd_emu10k1 index=-1
options snd_hda_intel index=-2,-2

that will prevent the slot occupied message and just pick the next "free" index where the logic for negative numbers is -(index+1) so a -1 makes the card eligible for slots 0 to 8 whichever is free -2 1 to 8 and so on.

The problem you have right now is that the nvidia card does get shifted to 1 but 0 being free will be taken by the internal analog card and when the emu10k1 card's turn comes up you are telling it that it must take 0 or not load at all

Last edited by V1del (2020-09-26 21:56:00)

Online

#3 2020-09-27 01:02:46

Maniaxx
Member
Registered: 2014-05-14
Posts: 738

Re: [Solved]How to change audio card id for NVidia audio driver?

Thanks, but if i get it right from the docs comma separated index is for cards with same module only so i guess it will not work.

Looks like there is a new 'slots' option that will preallocate the slots. Will test that tomorrow.

https://alsa.opensrc.org/MultipleCards# … lled_cards
(Point 5. Link jumps are not working)

Last edited by Maniaxx (2020-09-27 01:05:51)


sys2064

Offline

#4 2020-09-27 11:21:11

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: [Solved]How to change audio card id for NVidia audio driver?

but if i get it right from the docs comma separated index is for cards with same module only

There's a very big chance the nividia audio does use snd_hda_intel , check lspci -k .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#5 2020-09-27 11:25:01

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,664

Re: [Solved]How to change audio card id for NVidia audio driver?

nvidia does use snd_hda_intel, just the codec is different, but the driver that ultimately handles registration in ALSA is snd_hda_intel (... HDA intel is a specification for sound card designs, nearly everything uses that unless they have a very specific reason not to).

Online

#6 2020-09-27 16:00:32

Maniaxx
Member
Registered: 2014-05-14
Posts: 738

Re: [Solved]How to change audio card id for NVidia audio driver?

You're right. Now it makes sense. 'lspci -k' is nice to have here indeed.
I've fixed my alsa-base.conf. Not sure though if double entry for 'slots' is correct (snd_hda_intel,snd_hda_intel). There are no errors in dmesg though and order is correct so far.
Thanks!

$ lspci -k
01:00.1 Audio device: NVIDIA Corporation GK104 HDMI Audio Controller (rev a1)
	Subsystem: ASUSTeK Computer Inc. Device 8465
	Kernel driver in use: snd_hda_intel
	Kernel modules: snd_hda_intel

/etc/modprobe.d/alsa-base.conf

options snd cards_limit=4
options snd slots=snd_emu10k1,snd_hda_intel,snd_hda_intel,snd_aloop
options snd_emu10k1 index=0
options snd_hda_intel index=1,2
options snd_aloop index=3
alias snd-card-0 snd-emu10k1
alias snd-card-1 snd_hda_intel
alias snd-card-2 snd_hda_intel
alias snd-card-3 snd_aloop

#
# 27.09.2020
# lspci -knn
# https://alsa.opensrc.org/MultipleCards
# https://www.kernel.org/doc/html/latest/sound/alsa-configuration.html
#
# options snd_hda_intel index=1,2 vid=0x8086,0x1043 pid=0x1c20,0x8465
# [   11.767622] snd_hda_intel: unknown parameter 'vid' ignored
# [   11.767625] snd_hda_intel: unknown parameter 'pid' ignored
#

Last edited by Maniaxx (2020-09-27 16:03:49)


sys2064

Offline

Board footer

Powered by FluxBB