LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Default Device for Flash Sound (https://www.linuxquestions.org/questions/slackware-14/default-device-for-flash-sound-890844/)

vttay03 07-09-2011 05:07 PM

Default Device for Flash Sound
 
--I've got an issue with Flash sound that only appears depending on the way devices are assigned during boot (I assume). Basically, it breaks down to the following - when flash sound works the output of 'aplay -l' is below:

Code:

**** List of PLAYBACK Hardware Devices ****
card 0: SB [HDA ATI SB], device 0: ALC892 Analog [ALC892 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: SB [HDA ATI SB], device 1: ALC892 Digital [ALC892 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 8: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 9: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 3: default [USB Audio CODEC ], device 0: USB Audio [USB Audio]           
  Subdevices: 1/1                                                             
  Subdevice #0: subdevice #0

When flash sound doesn't work, the output of 'aplay -l' is below:

Code:

**** List of PLAYBACK Hardware Devices ****
card 1: SB [HDA ATI SB], device 0: ALC892 Analog [ALC892 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: SB [HDA ATI SB], device 1: ALC892 Digital [ALC892 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: default [USB Audio CODEC ], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 3: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 3: NVidia [HDA NVidia], device 7: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 3: NVidia [HDA NVidia], device 8: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 3: NVidia [HDA NVidia], device 9: HDMI 0 [HDMI 0]                         
  Subdevices: 1/1                                                             
  Subdevice #0: subdevice #0

As you can see, the difference is that flash sound works only when card 0 is the '[HDA ATI SB]' device. My question is how do I force this to always be card 0? I've read some things about .asoundrc but it all is as clear as mud. Since it seems to fluctuate on each boot (sometimes it is assigned to be card 0 and other times it's card 1 or card 2) I'm having a hard time figuring out how to force it to be card 0. More background info is below...

1) I use the onboard audio of my motherboard
2) I have a video card with an HDMI output
3) I have a webcam which is probably the USB audio

Any suggestions?

David the H. 07-10-2011 05:30 AM

Numbering of hardware devices is generally controlled by udev. I don't know much about sound cards specifically, but I did find this page:

http://alsa.opensrc.org/Udev

I also came across this page during the search. It seems that udev alone may not be enough:

http://alsa.opensrc.org/MultipleCards

HTH

Daedra 07-10-2011 11:17 AM

I have basically the same setup, I have an PCI soundcard, a USB webcam with microphone, and a video card with a HDMI input. What you need to do is set the order of your soundcards in the /etc/modprobe.d/sound.conf file. See this post for more details http://www.linuxquestions.org/questi...device-713793/. You can also blacklist the hdmi sound module if you are not using your video cards hdmi port. That is what I do since I am not using it and its one less sound device to deal with.

vttay03 07-10-2011 03:54 PM

Thank you to both...

I ended up with a 'sound.conf' file that contains the following:

Code:

options snd slots=snd-hda-intel
Apparently, this forces the correct sound device to be assigned index 0. I've run some tests and powered on/off 5 times without any issues. Hopefully it'll stay that way...

I originally started with a 'alsa.conf' file but that caused something to go wrong and I ended up without any devices.

@Daedra - In order to blacklist your hdmi sound module, did you blacklist the module named 'snd-hda-codec-hdmi' ?

Daedra 07-10-2011 10:17 PM

I blacklisted the module snd_hda_intel for my HDMI, but you can try snd-hda-codec-hdmi, that should work.

vttay03 07-11-2011 09:26 PM

Quote:

Originally Posted by Daedra (Post 4411131)
I blacklisted the module snd_hda_intel for my HDMI, but you can try snd-hda-codec-hdmi, that should work.

I thought this was the main sound module (corresponding HDA ATI SB). If I blacklist 'snd-hda-intel', won't my onboard audio disappear too such that no devices will be listed when I query with 'aplay -l'? Since you have an actual PCI sound card (whereas my sound is integrated onto the motherboard), this might be why it works for you...

Daedra 07-11-2011 09:38 PM

Yes it is possible, I don't use onboard sound so I don't know. You don't have to blacklist it, that's just what I do.

vttay03 07-12-2011 06:54 AM

Quote:

Originally Posted by Daedra (Post 4412169)
Yes it is possible, I don't use onboard sound so I don't know. You don't have to blacklist it, that's just what I do.

Ok, fair enough. I think I've rebooted about 10-15 times without any issues now so I'll go ahead and close this out. The 'sound.conf' file was definitely the trick. I thought I had tried this previously but perhaps I had only created an 'alsa.conf' file instead.


All times are GMT -5. The time now is 01:58 PM.