Topic: Multiface II alsa card number, module load order SOLVED
I have a Multiface II connected to a 64Studio (3.x beta version) work station.
The Multiface worked as advertised right out of the box. However, when I rebooted the machine, it wouldn't work. After two days of research, here is what I found and how I think I solved the problem.
Believe udev was loading the kernel modules in random order (random? can that really happen on a deterministic machine?). Using 'aplay -l' from the command line gave:
**** List of PLAYBACK Hardware Devices ****
card 0: CK804 [NVidia CK804], device 0: Intel ICH [NVidia CK804]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: CK804 [Nvidia CK804], device 2: Intel ICH - IEC958 [NVidia CK804 - IEC958]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: DSP [Hammerfall DSP], device 0: RME Hammerfall DSP + Multiface [RME Hammerfall DSP + Multiface]
Subdevices: 1/1
Subdevice #0: subdevice #0
Running 'cat /proc/asound/cards' gave:
0 [CK804 ]: NFORCE - NVidia CK804
NVidia CK804 with ALC850 at irq 22
1 [DSP ]: H-DSP - Hammerfall DSP
RME Hammerfall DSP + Multiface at 0xfdff0000, irq 17
Running 'lspci' showed two "Multimedia audio controller:" entries. One for the onboard sound card (CK804 AC'97 Audio Controller) and one for the Multiface PCIe card (Xilinx Corporation RME Hammerfall DSP). No surprise there.
When I ran '/sbin/alsa force-reload' followed by 'aplay -l' the card number order alternated between the DSP and CK804. If card 0 was assigned to CK804, then the next time card 0 got assigned to DSP (and the Multiface worked as advertised). Rebooting the machine sometimes changed the card assignment order but more often than not, CK804 got card 0 (resulting in the Multiface not working).
The problem is that with DSP listed as "card 1" instead of "card 0" the Multiface would not work (hdspmixer would not work). The DSP related kernel module needs to get loaded first so alsa will get the indexes right (I guess udev is really what assigns the index numbers based on the module load order?). Running 'lsmod | grep snd' gives a list of the sound related modules loaded and their dependencies. As expected, snd_hdsp shows up in the list. Also, snd_ac97_codec which I assume is the module used by the AC'97 onboard audio controller. The snd_ac97_codec is dependent on snd_intel8x0. I needed to verify the associated kernel module names so I ran 'locate *.ko | grep hdsp' to get snd-hdsp.ko and 'locate *.ko | grep intel8x0' to get snd-intel8x0.ko.
After some research I discovered that udev reads files in /etc/modprobe.d and uses information in those files to load and initialize modules. In the modprobe.d folder, I created a file named 'sound' with the following two lines:
options snd-hdsp index=0
options snd-intel8x0 index=1
The purpose is to force the snd-hdsp module to get loaded first and the onboard audio controller module to get loaded second (by the way, I tried it with just the first line and it didn't work).
Rebooted the machine and presto, card 0 is now the DSP (Hammerfall) and card 1 is the onboard sound card. Now when I run '/sbin/alsa force-reload' followed by either 'aplay -l' or 'cat /proc/asound/cards', the DSP gets assigned as card 0 every time.
Now both the Multiface and the onboard sound card both work. By the way, I have the S/PIDF output of the onboard sound card connected to the S/PIDF input of the Multiface and routed to the Multiface outputs dedicated to the studio monitor speakers. Works great.
Looks like the options entries in the sound file worked.
I found these links were helpful:
http://wiki.debian.org/ALSA
http://alsa.opensrc.org/index.php/MultipleCards
Hope this helps the next guy.