You are not logged in.

#1 2014-11-22 12:00:15

toni
Member
Registered: 2011-10-15
Posts: 437

Randomly lack of sound at startup using ALSA

I previously had some problems with alsa. My problem was that I had no sound. So I posted below topic a few days ago and I get a solution:

No sound in alsa

I solved that by setting below content in /etc/modprobe.d/alsa-base.conf file:

# Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller [8086:0c0c] (rev 06)
options snd_hda_intel index=1 model=auto vid=8086 pid=0c0c
# Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller [8086:8c20] (rev 04)
options snd_hda_intel index=0 model=auto vid=8086 pid=8c20

With this I tell arch to take into account the sound card I want (Well it is the same sound card but with different types of outputs HDMI and PCH, I want the analog one PCH, so I set it with index 0).

ALl was working ok until today that I have no sound again. I think the problem is that pulseaudio is being taken into account instead of alsa. Sound configuration tells me it is using PulseAudio and Pulseaudio (pavucontrol) is set only to HDMI output and there is no possibility to set in PCH analog output, so I think this is the problem.

So I think the best option is to force arch linux to use alsa and maybe uninstall completely pulseaudio.

Another solution would be probably to force pulseaudio to use analog PCH output instead of HDMI output and not uninstalling it.

What is the best option and how to do this?

My actual /etc/asound.conf is:

# Use PulseAudio by default
pcm.!default {
  type pulse
  fallback "sysdefault"
  hint {
    show on
    description "Default ALSA Output (currently PulseAudio Sound Server)"
  }
}

ctl.!default {
  type pulse
  fallback "sysdefault"
}

# vim:set ft=alsaconf:

I think this is the problem as here is specified pulseaudio as default. If I rename this file in order to pulseaudio to be not set by default, then it does not work, my sound card is set to HDMI output.
Also, instead of renaming this file, if I comment all the lines so pulseaudio is not set by default, Intel HDA PCH is taken into account (this is correct as I do not want HDMI) but still no sound.

Last edited by toni (2014-11-30 15:33:14)

Offline

#2 2014-11-22 13:54:15

toni
Member
Registered: 2011-10-15
Posts: 437

Re: Randomly lack of sound at startup using ALSA

toni wrote:

I previously had some problems with alsa. My problem was that I had no sound. So I posted below topic a few days ago and I get a solution:

No sound in alsa

I solved that by setting below content in /etc/modprobe.d/alsa-base.conf file:

# Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller [8086:0c0c] (rev 06)
options snd_hda_intel index=1 model=auto vid=8086 pid=0c0c
# Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller [8086:8c20] (rev 04)
options snd_hda_intel index=0 model=auto vid=8086 pid=8c20

With this I tell arch to take into account the sound card I want (Well it is the same sound card but with different types of outputs HDMI and PCH, I want the analog one PCH, so I set it with index 0).

ALl was working ok until today that I have no sound again. I think the problem is that pulseaudio is being taken into account instead of alsa. Sound configuration tells me it is using PulseAudio and Pulseaudio (pavucontrol) is set only to HDMI output and there is no possibility to set in PCH analog output, so I think this is the problem.

So I think the best option is to force arch linux to use alsa and maybe uninstall completely pulseaudio.

Another solution would be probably to force pulseaudio to use analog PCH output instead of HDMI output and not uninstalling it.

What is the best option and how to do this?

My actual /etc/asound.conf is:

# Use PulseAudio by default
pcm.!default {
  type pulse
  fallback "sysdefault"
  hint {
    show on
    description "Default ALSA Output (currently PulseAudio Sound Server)"
  }
}

ctl.!default {
  type pulse
  fallback "sysdefault"
}

# vim:set ft=alsaconf:

I think this is the problem as here is specified pulseaudio as default. If I rename this file in order to pulseaudio to be not set by default, then it does not work, my sound card is set to HDMI output.
Also, instead of renaming this file, if I comment all the lines so pulseaudio is not set by default, Intel HDA PCH is taken into account (this is correct as I do not want HDMI) but still no sound.

With "/etc/asound.conf" file all commented, I have just observed below behaviours:

1) If I set /etc/modprobe.d/alsa-base.conf  as below to point to the correct playback hardware device (now index 0 as it says aplay -l):

# Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller [8086:0c0c] (rev 06)
options snd_hda_intel index=1 model=auto vid=8086 pid=0c0c
# Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller [8086:8c20] (rev 04)
options snd_hda_intel index=0 model=auto vid=8086 pid=8c20

Then after rebooting system, aplay -l outputs:

**** 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: ALC284 Analog [ALC284 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

so after reboot I note that my sound card that was pointing to the correct playback hardware device before rebooting (with index 0), now after rebooting index is 1 and not 0 so it is not matching and still no sound.

2) However,  If I set /etc/modprobe.d/alsa-base.conf  as below to point to the correct playback hardware device (now index 1 as it says aplay -l):

# Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller [8086:0c0c] (rev 06)
options snd_hda_intel index=0 model=auto vid=8086 pid=0c0c
# Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller [8086:8c20] (rev 04)
options snd_hda_intel index=1 model=auto vid=8086 pid=8c20

Then after rebooting system, aplay -l outputs different results:

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

so after reboot I note that my sound card that was pointing to the correct playback hardware device before rebooting (with index 1), now after rebooting index is 0 and not 1 so it is not matching and still no sound.

Why aplay -l outputs different results depending on the index set in  /etc/modprobe.d/alsa-base.conf file? Shouldn't aplay output always the same result?

Last edited by toni (2014-11-22 14:30:59)

Offline

#3 2014-11-22 16:12:01

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,536

Re: Randomly lack of sound at startup using ALSA

There's a section on the wiki regarding similar problem. See if it will fix yours.


do it good first, it will be faster than do it twice the saint wink

Offline

#4 2014-11-22 17:02:05

toni
Member
Registered: 2011-10-15
Posts: 437

Re: Randomly lack of sound at startup using ALSA

TheSaint wrote:

There's a section on the wiki regarding similar problem. See if it will fix yours.

Yes, I know. This is what I did a few days ago in order to get it work.

I set /etc/modprobe.d/alsa-base.conf  as:

# Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller [8086:0c0c] (rev 06)
options snd_hda_intel index=1 model=auto vid=8086 pid=0c0c
# Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller [8086:8c20] (rev 04)
options snd_hda_intel index=0 model=auto vid=8086 pid=8c20

and it was working, but suddenly it has stopped working....

In the section you has said it is said to indicate the MODEL, but how can I know which is the model I have to put?

Also If I check its functionality with speakers-test, it is working but still no sound.

Last edited by toni (2014-11-22 17:03:30)

Offline

#5 2014-11-22 17:15:49

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,536

Re: Randomly lack of sound at startup using ALSA

It is said to use vid and pid.
Did you see it ?


do it good first, it will be faster than do it twice the saint wink

Offline

#6 2014-11-22 17:34:03

toni
Member
Registered: 2011-10-15
Posts: 437

Re: Randomly lack of sound at startup using ALSA

TheSaint wrote:

It is said to use vid and pid.
Did you see it ?

Yes, In my /etc/modprobe.d/alsa-base.conf file this is exactly what I am doing and leaving model as auto but it is not working.

Why is the result of aplay -l command being different on each reboot if I change index parameter in that file?

Last edited by toni (2014-11-22 17:35:23)

Offline

#7 2014-11-22 18:06:30

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,536

Re: Randomly lack of sound at startup using ALSA

So you should to set udev rule for a permanent name. (I'm afraid it won't work)
Maybe you should arrange in miniticpio to load your module at early stage.
What is your ~/.asoundrc ?


do it good first, it will be faster than do it twice the saint wink

Offline

#8 2014-11-22 21:03:50

toni
Member
Registered: 2011-10-15
Posts: 437

Re: Randomly lack of sound at startup using ALSA

TheSaint wrote:

So you should to set udev rule for a permanent name. (I'm afraid it won't work)
Maybe you should arrange in miniticpio to load your module at early stage.
What is your ~/.asoundrc ?

My ~/.asoundrc is:

[toni@toni ~]$ cat ~/.asoundrc
defaults.pcm.rate_converter "samplerate_best"

Offline

#9 2014-11-23 09:45:00

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,536

Re: Randomly lack of sound at startup using ALSA

I thought your ~/.asoundrc was in conflict with system wide configuration.


do it good first, it will be faster than do it twice the saint wink

Offline

#10 2014-12-08 14:27:06

toni
Member
Registered: 2011-10-15
Posts: 437

Re: Randomly lack of sound at startup using ALSA

I have not found any solution... so I highly appreciate If anyone can help me....

Offline

#11 2014-12-09 12:07:01

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,846

Re: Randomly lack of sound at startup using ALSA

Toni,

if you have no /etc/asound.conf (or everything in it is commented), then alsa will use it's own configuration methods .
Those result in the behaviour you want (analog output) .

If there is an /etc/asound.conf however, the settings in there override alsa's config methods and pulseaudio takes over.

Looks to me like you have 2 options :

- remove pulseaudio so you will be using pure alsa
- configure pulseaudio to work the way you want, this may be very hard

A few comments  :
If both pulseaudio & alsa are present, you can't force arch to use pure alsa afaik, pulseaudio takes over everything

if you remove pulseaudio , the packages libpulse & lib32-libpulse will likely remain as many programs require those as dependency.
Those 2 however don't interfere with alsa functionality.

Last edited by Lone_Wolf (2014-12-09 12:07:58)


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

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#12 2014-12-09 19:51:02

toni
Member
Registered: 2011-10-15
Posts: 437

Re: Randomly lack of sound at startup using ALSA

Lone_Wolf wrote:

Toni,

if you have no /etc/asound.conf (or everything in it is commented), then alsa will use it's own configuration methods .
Those result in the behaviour you want (analog output) .

If there is an /etc/asound.conf however, the settings in there override alsa's config methods and pulseaudio takes over.

Looks to me like you have 2 options :

- remove pulseaudio so you will be using pure alsa
- configure pulseaudio to work the way you want, this may be very hard

A few comments  :
If both pulseaudio & alsa are present, you can't force arch to use pure alsa afaik, pulseaudio takes over everything

if you remove pulseaudio , the packages libpulse & lib32-libpulse will likely remain as many programs require those as dependency.
Those 2 however don't interfere with alsa functionality.

Great explanation, so I have decided to remove completely pulseaudio, but could you indicate me how to do that? I have tried but I can't because pulseaudio has a few dependencies.
Many sites recommends to not uninstall pulseaudio.

Last edited by toni (2014-12-09 19:58:15)

Offline

#13 2014-12-09 20:49:36

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,846

Re: Randomly lack of sound at startup using ALSA

It depends on what you are running whether you can remove pulseaudio or not.

gnome-settings-deamon & cinnamon-settings-daemon have a hard dependency on pulseaudio, i think Mate has pulseaudio as an optional dependency.
Skype 4.3.x also has a hard dependency on pulseaudio, but that can be worked around.

The output of pactree -r pulseaudio will give a good idea which programs you got that really need pulseaudio.

Last edited by Lone_Wolf (2014-12-09 20:49:55)


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

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#14 2014-12-13 18:30:20

toni
Member
Registered: 2011-10-15
Posts: 437

Re: Randomly lack of sound at startup using ALSA

Finally, I have decide to not remove pulseaudio and I am trying to search for a solution in depth.

Using journalctl -b I have seen below messages:


snd_hda_intel: unknown parameter 'vid' ignored
snd_hda_intel: unknown parameter 'pid' ignored

I have found this thread regarding to it, in which it is said to add snoop=0. I will try and tell something here.

Also, I have a doubt... everybody talks about putting snd-hda-intel in the options line, but I have snd_hda_intel (with underscores).... Is it the same?

Offline

#15 2014-12-14 09:13:00

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,536

Re: Randomly lack of sound at startup using ALSA

You may verify your modules

$ lsmod |grep snd

do it good first, it will be faster than do it twice the saint wink

Offline

#16 2014-12-14 16:30:18

toni
Member
Registered: 2011-10-15
Posts: 437

Re: Randomly lack of sound at startup using ALSA

TheSaint wrote:

You may verify your modules

$ lsmod |grep snd

ok, correct for me is snd_hda_intel but I would like to know how to stop those messages to appear. I do not understand why parameters vid and pid are not recognized....

Offline

#17 2014-12-14 19:11:54

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,536

Re: Randomly lack of sound at startup using ALSA

With

$ modinfo snd_hda_intel |grep snoop
parm:           snoop:Enable/disable snooping (bool)

So you might try to add this parameter to the module and see.


do it good first, it will be faster than do it twice the saint wink

Offline

#18 2014-12-14 19:27:13

toni
Member
Registered: 2011-10-15
Posts: 437

Re: Randomly lack of sound at startup using ALSA

TheSaint wrote:

With

$ modinfo snd_hda_intel |grep snoop
parm:           snoop:Enable/disable snooping (bool)

So you might try to add this parameter to the module and see.

Yes, I have passed the parameter snoop using config file:

[toni@toni ~]$ cat /etc/modprobe.d/alsa-base.conf 
# Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller [8086:0c0c] (rev 06)
options snd_hda_intel index=0 model=auto vid=8086 pid=0c0c snoop=0
# Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller [8086:8c20] (rev 04)
options snd_hda_intel index=1 model=auto vid=8086 pid=8c20 snoop=0

but i notice the same behaviour. Once boot, sometimes works and sometimes not. So setting snoop=0 is not working for me and the same error messages saying pid and vid parameters are not recognized continue appearing.

Offline

#19 2014-12-15 05:52:12

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,536

Re: Randomly lack of sound at startup using ALSA

What says

$ lspci -vnn |grep 'High Definition Audio'

do it good first, it will be faster than do it twice the saint wink

Offline

#20 2014-12-15 21:19:19

toni
Member
Registered: 2011-10-15
Posts: 437

Re: Randomly lack of sound at startup using ALSA

TheSaint wrote:

What says

$ lspci -vnn |grep 'High Definition Audio'

Below the output:

$ lspci -vnn |grep 'High Definition Audio'
00:1b.0 Audio device [0403]: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller [8086:8c20] (rev 04)

Offline

#21 2014-12-16 07:50:54

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,536

Re: Randomly lack of sound at startup using ALSA

Try to set your /etc/modprobe.d/alsa-base.conf like this

# Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller [8086:8c20] (rev 04)
options snd_hda_intel index=1 model=auto vid=8086 pid=8c20 snoop=0

Problably you may comment out the second line of your actual alsa-base.conf.
It'll be a test to see whether you'll face warning again. Furthermore you may leave vid=8086 pid=8c20 out, entirely.


do it good first, it will be faster than do it twice the saint wink

Offline

Board footer

Powered by FluxBB