You are not logged in.

#1 2014-08-20 01:50:23

jajacool
Member
Registered: 2014-08-20
Posts: 10

Issue setting up ALSA and getting sound

This is my first time really using Arch.
I cannot for the life of me get the sound to work. All channels are unmuted and I did manage to get white noice to the speakers using some command which I can't find anymore (aplay /dev/urandom something something card 1), but all speaker-test commands failed. I think the issue is that Alsa is using my HDMI as the default, which I can't find a way to change form the wiki's instructions due to them having the same module name snd_hda_intel.
If you can help I'd appreciate it

Offline

#2 2014-08-20 04:27:02

headkase
Member
Registered: 2011-12-06
Posts: 1,976

Re: Issue setting up ALSA and getting sound

Here's a template from my own system at one time for when different hardware shares the same driver and going about managing them:

options snd_hda_intel enable=1,0 vid=8086,10de pid=3b56,0bea
options snd_hda_intel index=0 vid=8086 pid=3b56
options snd_usb_audio index=1

You get the "vid" and "pid" from "lspci -nn | grep -i audio" → See in: This Section.

In the given example there are two audio cards, one 8086:3b56 and one 10de:0bea.  Notice how they are split in the enable options.  In the enable options, 1 is enabled and 0 is disabled.  The next line, the "index=0" line, makes the card that was enabled the default device as well by making it "0".  You can ignore the "snd_usb_audio" line as that is specific to my own system to make a webcam microphone the next device in line.

If you want both audio devices enabled, using vid and pid give one index 0 (the one you want to be default) and the other index 1 or greater.  In this case you would also not have an enable line.

Save the given configuration file with your specific vid's and pid's as "/etc/modprobe.d/alsa.conf" and reboot your system for it to take effect.

Last edited by headkase (2014-08-20 04:35:57)

Offline

#3 2014-08-20 04:48:59

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,791

Re: Issue setting up ALSA and getting sound

Please post the output of aplay -lL    (That is a lower case L and an upper case L)
Also, of pacman -Qs pulseaudio (as a sanity check)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#4 2014-08-20 09:41:52

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: Issue setting up ALSA and getting sound

@headkase I do realize that the wiki is still holding this up, but it is somewhat misguiding. The vid and pid is accepted by snd-usb-audio fine, although recently the parameter nrpacks apparently was removed, but snd-hda-intel does not accept those, nor does the majority of other sound modules. They will be ignored, which should be reported by journalctl or dmesg. I will update the wiki eventually and post in the thread we had the discussion lately, since I did take a look into enable parameter, it behaves somewhat like slots. For more explanation read through this, especially the last post. Even though I tested this on two different systems, I came to the wrong conclusion.
Those parameters do not cause any harm other than the placebo that they actually do something. The procedure is basically the same, the parameters can even stay there, but the sound cards need to be reordered depending on the position on the bus, that appears to determine the position index, enable and others refer to. I have had too little test cases to confirm that algorithm of procedure, so maybe this thread will help with that.
So in this case 'enable=0,1' might be needed or 'index=1,0' or first a line with 'index=1', then with 'index=0'.

Offline

#5 2014-08-20 10:19:13

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: Issue setting up ALSA and getting sound

jajacool wrote:

[...]all speaker-test commands failed. I think the issue is that Alsa is using my HDMI as the default[...]

Your speaker-tests use card 0 device 0 by default and since your HDMI probably does not have a device 0, but highly likely does have device 3, it cannot be opened. For further explanation take a look here, recent thread with probably the same problem.
But try what headkase suggested first considering my remarks, should he not update his post, to set the other sound card as default. That would put the other sound card as card 0, and it is highly likely this sound card has a device 0, so calling speaker-test should work then. Other than that you can specify the device to use with '-D' switch, and what ewaller ask you to post with 'aplay -lL' will list those devices you can use.

Offline

#6 2014-08-20 11:53:11

jajacool
Member
Registered: 2014-08-20
Posts: 10

Re: Issue setting up ALSA and getting sound

**** List of PLAYBACK Hardware Devices ****
card 0: HDMI [HDA Intel HDMI], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 0: ALC1150 Analog [ALC1150 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 1: ALC1150 Digital [ALC1150 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

null
    Discard all samples (playback) or generate zero samples (capture)
hdmi:CARD=HDMI,DEV=0
    HDA Intel HDMI, HDMI 0
    HDMI Audio Output
hdmi:CARD=HDMI,DEV=1
    HDA Intel HDMI, HDMI 1
    HDMI Audio Output
hdmi:CARD=HDMI,DEV=2
    HDA Intel HDMI, HDMI 2
    HDMI Audio Output
default:CARD=PCH
    HDA Intel PCH, ALC1150 Analog
    Default Audio Device
sysdefault:CARD=PCH
    HDA Intel PCH, ALC1150 Analog
    Default Audio Device
front:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1150 Analog
    Front speakers
surround21:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1150 Analog
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1150 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1150 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1150 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1150 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1150 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=PCH,DEV=0
    HDA Intel PCH, ALC1150 Digital
    IEC958 (S/PDIF) Digital Audio Output

Offline

#7 2014-08-20 12:01:09

jajacool
Member
Registered: 2014-08-20
Posts: 10

Re: Issue setting up ALSA and getting sound

Headkase: I think this might solve the problem and I did try this, but I have no idea which one of these is my HDMI or the other. Here's the out put of lspci -nn | grep -i audio:

00:03.0 Audio device [0403]:Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller [8086:0c0c] (rev 06)
00:1b.0 Audio device [0403]: Intel Corporation 9 Series Chipset Family HD Audio Controller [8086:8ca0]

Offline

#8 2014-08-20 12:07:43

jajacool
Member
Registered: 2014-08-20
Posts: 10

Re: Issue setting up ALSA and getting sound

emeres:
Are you saying that if I put index=1 then below that index=0 will set the order of the sound cards used? So ALSA will use the first line within the .conf file as the default? This sounds like the simplist solution.

Offline

#9 2014-08-20 14:46:42

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: Issue setting up ALSA and getting sound

Use code tags for commands output, please correct your posts, it is easier to read.

No, the issue is far more complex than that. The first options line will probably correspond to the first sound card on the bus, which seems to be the HDMI in your case, since the processor shows up with its integrated gpu. Like I wrote, follow headkases suggestion. As I expected your HDMI does not have device 0, look at what you posted for 'aplay -l'. These should work, also when run in multiple instances:

speaker-test -c 2 -t wav -D plug:"dmix:{CARD PCH DEV 0}" #should output sound through PCH
speaker-test -c 2 -t wav -D plug:"dmix:{CARD HDMI DEV 3}" #and this through HDMI

I reluctantly answer, after waiting some time for others to respond, but I am interested in getting the new procedure right this time.

Last edited by emeres (2014-08-20 17:11:36)

Offline

#10 2014-08-20 19:26:00

headkase
Member
Registered: 2011-12-06
Posts: 1,976

Re: Issue setting up ALSA and getting sound

emeres wrote:

@headkase I do realize that the wiki is still holding this up, but it is somewhat misguiding. The vid and pid is accepted by snd-usb-audio fine, although recently the parameter nrpacks apparently was removed, but snd-hda-intel does not accept those, nor does the majority of other sound modules. They will be ignored, which should be reported by journalctl or dmesg. I will update the wiki eventually and post in the thread we had the discussion lately, since I did take a look into enable parameter, it behaves somewhat like slots. For more explanation read through this, especially the last post. Even though I tested this on two different systems, I came to the wrong conclusion.
Those parameters do not cause any harm other than the placebo that they actually do something. The procedure is basically the same, the parameters can even stay there, but the sound cards need to be reordered depending on the position on the bus, that appears to determine the position index, enable and others refer to. I have had too little test cases to confirm that algorithm of procedure, so maybe this thread will help with that.
So in this case 'enable=0,1' might be needed or 'index=1,0' or first a line with 'index=1', then with 'index=0'.

Hey emeres,

From empirical testing, actually doing it, the enable line needs all devices (Edit: that use the same driver) in one statement split up as given.  That is empirical, that is what the computer needed when I tried it on my own system.  In theory it might work another way but in practice it did not.  Setting the enabled device later to index 0 probably isn't needed if it ends up being the only audio output left turned on in the system.  And the usb audio line is superfluous but I did mention as much.

Thank you, especially since you - as you have indicated - are going to settle the matter once and for all in the Wiki.. wink

Last edited by headkase (2014-08-20 19:29:01)

Offline

#11 2014-08-21 11:25:49

jajacool
Member
Registered: 2014-08-20
Posts: 10

Re: Issue setting up ALSA and getting sound

Sorry for the late reply. I played around with the conf file. Seems like this (see below) disabled the hdmi and sets the default to the second card device 0, which is my analog. Wish I could keep hdmi, but this is working.

options snd_hda_intel enable=1,0
options snd_hda_intel index=1

Offline

#12 2014-08-21 11:45:54

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: Issue setting up ALSA and getting sound

@jajacool you are still not using code tags, see my previous post for the link.

jajacool wrote:

Wish I could keep hdmi

Try:

options snd-hda-intel index=1,0
#or 
options snd-hda-intel index=1
options snd-hda-intel index=0
#or simply
options snd-hda-intel index=1

@headkease It will just take some time, since I wanted to rewrite the whole section anyway. I posted more on the issue here.

Offline

#13 2014-08-21 23:41:38

headkase
Member
Registered: 2011-12-06
Posts: 1,976

Re: Issue setting up ALSA and getting sound

emeres wrote:

@headkease It will just take some time, since I wanted to rewrite the whole section anyway. I posted more on the issue here.

Right on, thank you emeres.

Offline

#14 2014-08-22 04:03:12

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: Issue setting up ALSA and getting sound

headkase wrote:

Right on, thank you emeres.

You are welcome.

Offline

Board footer

Powered by FluxBB