You are not logged in.

#1 2014-08-24 16:41:03

z0ttel
Member
Registered: 2014-08-24
Posts: 4

[SOLVED] Volume of speakers set to 0 after reboot

Hi!

My name's Oliver and I'm using Arch Linux on my Nokia 3G Booklet.

Basically, it is running fine but I have some problems with the onboard sound card / the integrated speakers.

First of all, I already read "https://wiki.archlinux.org/index.php/Ad … chitecture" and "https://wiki.archlinux.org/index.php/PulseAudio" very careful, but I couldn't find a solution to my issue:

After a fresh power up (or an ordinary reboot), the output volume of the integrated speakers is set to 0.
I either need to run alsamixer or to call 'alsactl restore' from the shell. After reading the beforementioned articles I would expect that the current settings of alsamixer get stored on power down and restored after startup (https://wiki.archlinux.de/title/Alsa#Al … herstellen) automatically.

I checked the current configuration by

$ systemctl is-enabled alsa-store.service alsa-restore.service
static
static

and

$ ls -l /usr/lib/systemd/system/*/alsa*
lrwxrwxrwx 1 root root 23 18. Jun 08:08 /usr/lib/systemd/system/basic.target.wants/alsa-restore.service -> ../alsa-restore.service
lrwxrwxrwx 1 root root 21 18. Jun 08:08 /usr/lib/systemd/system/basic.target.wants/alsa-state.service -> ../alsa-state.service
lrwxrwxrwx 1 root root 21 18. Jun 08:08 /usr/lib/systemd/system/shutdown.target.wants/alsa-store.service -> ../alsa-store.service

What I also noticed, when calling 'alsactl restore' from the shell, some messages appear

$ alsactl restore
alsactl: state_lock:114: file /var/lib/alsa/asound.state lock error: File exists
alsactl: load_state:1677: Cannot open /var/lib/alsa/asound.state for reading: File exists
Found hardware: "HDA-Intel" "Silicon Image SiI1392 HDMI" "HDA:10ec0269,13b80001,00100004 HDA:10951392,ffffffff,00100000" "0x13b8" "0x0001"
Hardware is initialized using a generic method

and the volume gets set back to a default level and not the level I did choose the last time. I can't explain it any better but for me it looks like the current alsamixer settings are not getting saved.

Last edited by z0ttel (2014-08-25 05:24:24)

Offline

#2 2014-08-24 16:51:58

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

Re: [SOLVED] Volume of speakers set to 0 after reboot

Does the /var/lib/alsa/asound.state file exist or not and with what permissions? Set up your sound cards in alsamixer to appropriate values and run:

# alsactl store # means run it as root
alsactl -f "$HOME/.asound.state" store # just to have a fallback

There are two schemes how those alsa services work, one stores settings upon exits, the other restores saved settings depending upon if the /etc/alsa/state-daemon.conf exists or not.

Then there is the issue with pulseaudio. This might be of interest, especially this part, which refers to here.

Edit: For further explanation on services read them

cat /usr/lib/systemd/system/alsa-state.service
cat /usr/lib/systemd/system/alsa-store.service
cat /usr/lib/systemd/system/alsa-restore.service

Last edited by emeres (2014-08-24 16:57:48)

Offline

#3 2014-08-24 17:15:29

z0ttel
Member
Registered: 2014-08-24
Posts: 4

Re: [SOLVED] Volume of speakers set to 0 after reboot

Hello emeres,

thank you very much for your fast response!

asound.state did already exist,

$ ls -l /var/lib/alsa/
-rw-r--r-- 1 root root 4796 24. Aug 19:04 asound.state

but I repeated the mentioned steps to be sure I did everything right - this didn't solve the issue.

The path /etc/alsa doesn't exist - should I create it (and the state-demon.conf) manually or is it useless?


I noticed (thanks to your first link), that the problem seems to be related to the headphone output jack. After reboot, there is no output on neither the headphones nor the speakers. If I plug the headphones into the laptop, still there is no sound. After pulling the jack from the laptop, the speakers are activated. If I plug the headphones into the laptop again, the speakers get muted, but the headphones also stay silent.

For your information, the codec is a hda-codec:

$ lsmod | grep snd
snd_hda_codec_hdmi     37156  1 
snd_hda_codec_realtek    48791  1 
snd_hda_codec_generic    50352  1 snd_hda_codec_realtek
snd_hda_intel          19379  5 
snd_hda_controller     19667  1 snd_hda_intel
snd_hda_codec          91154  5 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_intel,snd_hda_controller
snd_hwdep               5162  1 snd_hda_codec
snd_pcm                68932  4 snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel,snd_hda_controller
snd_timer              15678  1 snd_pcm
snd                    46845  18 snd_hda_codec_realtek,snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_hda_codec_generic,snd_hda_codec,snd_hda_intel
soundcore               4455  2 snd,snd_hda_codec

Offline

#4 2014-08-24 17:26:59

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

Re: [SOLVED] Volume of speakers set to 0 after reboot

Read the service files, depending on the scheme you want, it can be created. For the jack issue, post amixers output:

amixer -c 0; amixer -c 1

There probably is an auto-mute control enabled, which can be disabled or the hdajackretask from alsa-tools package can disable jack sensing for the relevant port.

Edit: You could also follow brebs suggestion to use amixer, but I consider this a workaround. Alsactl should work fine. One important information is missing and you missed my hint: do you use pulseaudio? Because, that adds complexity to the issue right now.

Last edited by emeres (2014-08-24 17:30:01)

Offline

#5 2014-08-24 17:49:38

z0ttel
Member
Registered: 2014-08-24
Posts: 4

Re: [SOLVED] Volume of speakers set to 0 after reboot

emeres wrote:

Read the service files, depending on the scheme you want, it can be created.

I created that file, performed a reboot, but it didn't solve the issue.

emeres wrote:

For the jack issue, post amixers output:

amixer -c 0; amixer -c 1

There probably is an auto-mute control enabled, which can be disabled or the hdajackretask from alsa-tools package can disable jack sensing for the relevant port.

'amixer -c 0' (-c 1 is not available) shows:

$ amixer -c 0
Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 64
  Mono: Playback 49 [77%] [-15.00dB] [on]
Simple mixer control 'Headphone',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 64
  Mono:
  Front Left: Playback 0 [0%] [-63.00dB] [off]
  Front Right: Playback 0 [0%] [-63.00dB] [off]
Simple mixer control 'Speaker',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 64
  Mono:
  Front Left: Playback 63 [98%] [0.00dB] [on]
  Front Right: Playback 63 [98%] [0.00dB] [on]
Simple mixer control 'PCM',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 255
  Mono:
  Front Left: Playback 255 [100%] [0.00dB]
  Front Right: Playback 255 [100%] [0.00dB]
Simple mixer control 'IEC958',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 46
  Front Left: Capture 29 [63%] [12.00dB] [on]
  Front Right: Capture 29 [63%] [12.00dB] [on]
Simple mixer control 'Auto-Mute Mode',0
  Capabilities: enum
  Items: 'Disabled' 'Enabled'
  Item0: 'Disabled'

Automute is shown as 'Disabled' in alsamixer

emeres wrote:

Edit: You could also follow brebs suggestion to use amixer, but I consider this a workaround. Alsactl should work fine. One important information is missing and you missed my hint: do you use pulseaudio? Because, that adds complexity to the issue right now.

Sorry, I think I have missed this. Yes, pulseaudio is installed.

Offline

#6 2014-08-24 17:58:07

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

Re: [SOLVED] Volume of speakers set to 0 after reboot

z0ttel wrote:

Yes, pulseaudio is installed.

Is it running? If so, refer back to my first post. Do the services get launched?

systemctl status alsa-{re,}store alsa-state

Offline

#7 2014-08-24 19:17:02

z0ttel
Member
Registered: 2014-08-24
Posts: 4

Re: [SOLVED] Volume of speakers set to 0 after reboot

Pulseaudio is running, alsa-state is running, alsa-[re]store have been loaded and are inactive:

$ sudo ps -A | grep -i pulse
  514 ?        00:00:00 pulseaudio
[oliver@Nokia3G ~]$ systemctl status alsa-state
● alsa-state.service - Manage Sound Card State (restore and store)
   Loaded: loaded (/usr/lib/systemd/system/alsa-state.service; static)
   Active: active (running) since So 2014-08-24 21:04:03 CEST; 8min ago
 Main PID: 274 (alsactl)
   CGroup: /system.slice/alsa-state.service
           └─274 /usr/bin/alsactl -s -n 19 -c rdaemon

Aug 24 21:04:03 Nokia3G alsactl[274]: alsactl 1.0.28 daemon started
[oliver@Nokia3G ~]$ systemctl status alsa-store
● alsa-store.service - Store Sound Card State
   Loaded: loaded (/usr/lib/systemd/system/alsa-store.service; static)
   Active: inactive (dead)
[oliver@Nokia3G ~]$ systemctl status alsa-restore
● alsa-restore.service - Restore Sound Card State
   Loaded: loaded (/usr/lib/systemd/system/alsa-restore.service; static)
   Active: inactive (dead)
           start condition failed at So 2014-08-24 21:04:03 CEST; 8min ago
           ConditionPathExists=!/etc/alsa/state-daemon.conf was not met

Update 1
Hmm, one maybe stupid question: I'm asking myself for what PulseAudio is needed. It seems that it is intended to be used in a GNOME/KDE environment, but I'm running XFCE4. I think I installed PA unintended somehow.


Update 2
I'm just reading through the mentioned thread. How do I exactly disable the modules like you have recommended in https://bbs.archlinux.org/viewtopic.php … 8#p1449388 ?
Is this done in /etc/pulse/default.pa ?

Update 3
I disabled the modules

* module-default-device-restore
* module-card-restore
* module-device-restore
* module-stream-restore

in /etc/pulse/default.pa (one by one with reboots in between) -- but without success.

Update 4 (the last for today wink )
IT'S WORKING!! After deactivation of the modules (Update: it's sufficient to disable module-device-restore), I had to run alsamixer once again to unmute the outputs (speakers and headphones). Now everything is working like a charm: the speakers are active after reboot and the headphones are active if they are plugged in. I need to check if the current volume settings are stored over reboot, but this is only a minor issue (Update: the volume setting is saved!).

What keeps me wondering are the deactivated PA-modules: I have to deactivate them to get the desired functionality, but does PA somehow rely on them for proper operation? Or do I have to expect other issues due to the current configuration?


@emeres: Thank you very much for your help so far!!

Last edited by z0ttel (2014-08-24 20:43:26)

Offline

#8 2014-08-24 21:52:17

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

Re: [SOLVED] Volume of speakers set to 0 after reboot

You are welcome. No, I do not think it will create problems, since their description seems pretty unambigous and should not interfere with normal functionality. However I would recommend to reduce the changes to module-device-restore, since you stated it is the critical one. Should you encounter problems, please report.

Should you consider this issue solved, then please mark the thread as such.

Offline

Board footer

Powered by FluxBB