Audio Playback Hardware Device Issue

Hello all. I hope you can assist with this bug. When I boot onto my laptop the list of audio playback hardware devices varies from boot to boot. For example upon booting into Tumbleweed if I type “aplay -l” in the terminal sometime I get the following output (note the item in red):


aplay -l
**** List of PLAYBACK Hardware Devices ****
card 1: PCH [HDA Intel PCH], device 0: 92HD91BXX Analog [92HD91BXX Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Other times I boot into my laptop and when I type “aplay -l” in the terminal I get below (note the item in red):


aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: 92HD91BXX Analog [92HD91BXX Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0:  PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI  1]
  Subdevices:  1/1
  Subdevice #0: subdevice  #0
card 0: PCH [HDA Intel PCH],  device 8: HDMI 2 [HDMI  2]
  Subdevices:  1/1
  Subdevice #0: subdevice  #0
card 1: HDMI [HDA ATI HDMI],  device 3: HDMI 0 [HDMI  0]
  Subdevices:  1/1
  Subdevice #0: subdevice #0

The problem is that I can’t hear music using mpd/ncmpcpp unless card 1 is the analog device. I have to hard code it in mpd’s config to look for card 1 in order to hear music using mpd/ncmpcpp. Whenever I boot up and my system has card 0 as the default analog system, I can’t hear sound from mpd. I have to reboot and hope that on reboot my system has card 1 as the default. Other application sound seem unaffected. My question is, is there a way to have Tumbleweed always default to card 1? Or at the very least can I reset/reload the audio list of playback hardware devices without having to reboot my pc?

Thanks in advance.

Have you tried configuring the sound cards in Yast? I think that should fix indexes for them. It should also allow you to set one card as the primary card. That will be card 0 though. I think you could get finer control of the indexes by editing /etc/modprobe.d/50-sound.conf/

It might be worth doing: cat /proc/asound/cards
to see what cards are reported. Using my PC, I get:

jon@worthy:~> cat /proc/asound/cards
 0 [CODEC          ]: USB-Audio - USB Audio CODEC
                      Burr-Brown from TI USB Audio CODEC at usb-0000:00:12.0-1, full speed
 1 [SB             ]: HDA-Intel - HDA ATI SB
                      HDA ATI SB at 0xfdff4000 irq 16
 2 [NVidia         ]: HDA-Intel - HDA NVidia
                      HDA NVidia at 0xfcffc000 irq 19
 3 [CX8811         ]: CX88x - Conexant CX8811
                      Conexant CX8811 at 0xf9000000
 4 [UM2            ]: USB-Audio - UM-2
                      EDIROL UM-2 at usb-0000:00:16.0-1, full speed
 5 [CODEC_1        ]: USB-Audio - USB Audio CODEC
                      Burr-Brown from TI USB Audio CODEC at usb-0000:00:16.0-2, full speed

Card 3 is part of a tv tuner card and card 4 is a MIDI interface. Neither of these cards show with aplay -l or as cards in Yast.

Thanks for the reply Jon. So I have 2 issues with your suggestions:

  1. I don’t have a file 50-sound.conf in the /etc/modprobe.d/ directory.
  2. This could be somewhat related but when I click on the sound icon in Yast it bricks my Yast session. Yast freezes and becomes unresponsive for 30+ minutes. Performing a killall doesn’t even work to kill it. In fact I created a thread about it here months ago which no one responded to. http://forums.opensuse.org/showthread.php/511254-Yast2-Sound-Module-Issue

So any instruction on creating a 50-sound.conf file?

Hmm Yast sound isn’t working for me on TW either alhough I just get a refusal to set up hda-intel. Going by my (Leap 42.1) desktop PC.

Do: cat /proc/asound/modules
and see what modules are in use. Mine has.

cat /proc/asound/modules
 0 snd_usb_audio
 1 snd_hda_intel
 2 snd_hda_intel
 3 cx88_alsa
 4 snd_usb_audio
 5 snd_usb_audio

Moving on to my /etc/modprobe.d/50-sound.conf, I have:

options snd slots=snd-usb-audio,snd-hda-intel,snd-hda-intel
# 6ayf.+yFd9ajqeMA:USB Audio CODEC
alias snd-card-0 snd-usb-audio
# 5Dex.9U18Ia0zXn7:SBx00 Azalia (Intel HDA)
alias snd-card-1 snd-hda-intel
# NXNs.UtMRYeUD0j2:High Definition Audio Controller
alias snd-card-2 snd-hda-intel

The alsa documentation seems to suggest the snd slots and the alias methods are alternatives but I have both.

Note that the same module is refferred to more than once (and that I have several snd_usb_audio modules). I have been unable to find out whether the numbers in the comments placed by Yast do anything but I’m guessing they don’t

Whatever, in my case, the correct USB card is always coming up at index 0 and at present, I am not worried about other ordering.

Going by memory, on a previous version of OpenSuse, I had problems with the “detection order” varying with 2 snd_usb_audio devices. In that case, I had use another method eg.

options snd-usb-audio index=1,2 vid=0x0ccd,0x0d8c pid=0x0028,0x000c

Alsa documentation is at http://alsa.opensrc.org/MultipleCards

Jon Freeman gave some helpful guidance to you.

If you run a diagnostic script for us, likely we can tell you exactly what to put in a new /etc/modprobe.d/50-sound.conf file that you can create.

Please run this diagnostic script in a konsole/xterm as a regular user, with PC connected to the internet, and let script run to completion :


/usr/sbin/alsa-info.sh

and select the SHARE/UPLOAD option. After script is complete it will give you a URL/Web-address where it uploaded the information. Post that address here. We can then look at it, figure out your devices, and give you a specific edit.

Note that I will be out of country from 17-to-21-Feb and hence will likely not reply to any posts in that time frame.

Jon,

Here’s my output

cat /proc/asound/modules
 0 snd_usb_audio
 1 snd_hda_intel
 2 snd_hda_intel


OldCPU,

Here’s the output of


/usr/sbin/alsa-info.sh

http://www.alsa-project.org/db/?f=b1a7fcf5934ab3684120fbd70259e8166e1bc37b

Note this:


!!Soundcards recognised by ALSA
!!-----------------------------
 0 [Audio          ]: USB-Audio - HP Wireless Audio
                      Standard Microsystems Corp. HP Wireless Audio at usb-0000:00:1d.0-1.5, high spe
 1 [PCH            ]: HDA-Intel - HDA Intel PCH
                      HDA Intel PCH at 0xc3800000 irq 51
 2 [HDMI           ]: HDA-Intel - HDA ATI HDMI
                      HDA ATI HDMI at 0xc2820000 irq 52


!!PCI Soundcards installed in the system
!!--------------------------------------
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 05)
01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Turks/Whistler HDMI Audio [Radeon HD 6000 Series] (rev ff)


!!Advanced information - PCI Vendor/Device/Subsystem ID's
!!-------------------------------------------------------
00:1b.0 0403: 8086:1c20 (rev 05)
    Subsystem: 103c:1689
--
01:00.1 0403: 1002:aa90 (rev ff) (prog-if ff)
    !!! Unknown header type 7f

I colour coded the above to make it easier to see.

Note also in this case - your USB device has sound card-0. This reads to me that the issue here is booting with your USB audio device plugged in or not plugged in. That is contributing to the problem. The other problem is both analog and HDMI use the same alsa sound module and YaST-hardware-sound has difficulties handing that.

You stated:

My question is, is there a way to have Tumbleweed always default to card 1?

Yes that is doable. But typically card-0 is the default sound device for applications. I find it very surprising your observation and I wonder if you have made an error here.

But I will give you the /etc/modprobe.d/50-sound.conf file entry to do what you asked. Note thou I am skeptical that you have asked for the right thing.

I think to make the HDMI card-2 and the analog sound card-1 put the following in the /etc/modprobe.d/50-sound.conf :


options index=1,2 vid=0x8086,0x1002 pid=0x1c20,0xaa90

Then reboot and test.

I may have the index wrong, but I don’t think so.
.

Possibly the intel driver should be specified in that line. ie


options snd_hda_intel index=1,2 vid=0x8086,0x1002 pid=0x1c20,0xaa90

Alternatively, this could be done in two lines:


options snd_hda_intel index=1 vid=8086 pid=1c20
options snd_hda_intel index=2 vid=1002 pid=aa90 

but I note - what you asked for makes no sense to me. It makes more sense to make the analog audio card-0, make the HDMI card-1, and make the usb device card-2. Then configure default to use card-0 (which is the nominal state) and use pavucontrol to switch to usb audio when ever you plug in your usb device. However I provided what you asked - not what makes more sense to me.
.

You are the expert so I’ll follow your advice and make analog audio card-0. How would 50-sound.conf look like in that scenario?

You just change the numbers to match the indexes you want. With the example you quoted, I’d change it to:

options snd_hda_intel index=0 vid=8086 pid=1c20
options snd_hda_intel index=1 vid=1002 pid=aa90

With this, the first usb card you plug in would be card 2

Agree with Jon_freeman wrt the new /etc/modprobe.d/50-sound.conf file. You will need to create the file with root permissions, and reboot to activate it. I recommend you install pavucontrol so to control sound to your USB device if not automatically directed to such when it is plugged in. Note pavucontrol allows one to redirect sound to different sound devices on a per application basis.

If after trying this it does not work, rerun the diagnostic script in a konsole/xterm (as regular user with pc connected to internet - select UPLOAD/SHARE option and post here address given when script completes):


/usr/sbin/alsa-info.sh

Jon & OldCPU… after creating the 50-sound.conf file as you’ve specified it & rebooting a few times it appears to have fixed things. Thank you.