[Bug 1179904] New: /usr/sbin/alsactl spuriously fails reloading saved settings
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904 Bug ID: 1179904 Summary: /usr/sbin/alsactl spuriously fails reloading saved settings Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: Sound Assignee: tiwai@suse.com Reporter: karl.mistelberger@nefkom.net QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- Upon boot sometimes the following error occurs: -- Reboot -- Dec 10 14:37:51 3400G systemd[1]: Starting Save/Restore Sound Card State... Dec 10 14:37:51 3400G alsactl[799]: /usr/sbin/alsactl: state_lock:125: file /var/lib/alsa/asound.state lock error: File exists Dec 10 14:37:51 3400G alsactl[799]: /usr/sbin/alsactl: load_state:1683: Cannot open /var/lib/alsa/asound.state for reading: File exists Dec 10 14:37:51 3400G alsactl[799]: alsa-lib parser.c:260:(error_node) UCM is not supported for this HDA model (HD-Audio Generic at 0xfcb88000 irq 72) Dec 10 14:37:51 3400G alsactl[799]: alsa-lib main.c:1014:(snd_use_case_mgr_open) error: failed to import hw:1 use case configuration -6 Dec 10 14:37:51 3400G alsactl[799]: Found hardware: "HDA-Intel" "ATI R6xx HDMI" "HDA:1002aa01,00aa0100,00100700" "0x1002" "0x15de" Dec 10 14:37:51 3400G alsactl[799]: Hardware is initialized using a generic method Dec 10 14:37:51 3400G systemd[1]: Finished Save/Restore Sound Card State. Dec 10 14:51:25 3400G systemd[1]: Stopping Save/Restore Sound Card State... Dec 10 14:51:25 3400G systemd[1]: alsa-restore.service: Succeeded. Dec 10 14:51:25 3400G systemd[1]: Stopped Save/Restore Sound Card State. According to journal Save always succeeds, but Restore fails on boot in a random manner. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904#c1
--- Comment #1 from Takashi Iwai
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904#c2
--- Comment #2 from Karl Mistelberger
This is likely no real bug, but the intended behavior. There are two paths calling alsactl-restore: one is directly via udev, another is via systemd. The latter case was "fixed" through your bug report, and I guess this will make both calls more concurrent. So one of them is skipped due to another being running at the same time.
I don't think so. alsactl fails to restore settings and uses defaults as indicated by the following line: alsactl[799]: Hardware is initialized using a generic method This is definitely not user intention. Users want to have restored their settings. Why should there exist two concurrent initialisations of the sound system? In my opinion initialization should be done exactly once. And it should work reliably. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904#c3
--- Comment #3 from Takashi Iwai
(In reply to Takashi Iwai from comment #1)
This is likely no real bug, but the intended behavior. There are two paths calling alsactl-restore: one is directly via udev, another is via systemd. The latter case was "fixed" through your bug report, and I guess this will make both calls more concurrent. So one of them is skipped due to another being running at the same time.
I don't think so. alsactl fails to restore settings and uses defaults as indicated by the following line:
alsactl[799]: Hardware is initialized using a generic method
This is definitely not user intention. Users want to have restored their settings.
Ah, it's a good point. It's the fallback mode in alsactl, and alsactl should skip the fallback if that's the locking. Will need to address in alsactl.
Why should there exist two concurrent initialisations of the sound system? In my opinion initialization should be done exactly once. And it should work reliably.
Please read /usr/lib/udev/rules.d/78-sound-card.rules. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904#c4
--- Comment #4 from Takashi Iwai
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904#c5
--- Comment #5 from Karl Mistelberger
The fixed alsa-utils package is being built in OBS home:tiwai:branches:openSUSE:Leap:15.2:Update/alsa-utils repo for Leap 15.2 and OBS home:tiwai:branches:multimedia:libs/alsa-utils repo for TW. The x86_64 build is still ongoing as of now. Please give it a try later and let me know if the spurious init is gone (while the lock error should remain).
Installed http://download.opensuse.org/repositories/home:/tiwai:/branches:/multimedia:... and got: 3400G:~ # journalctl -b -u alsa-restore.service -- Logs begin at Tue 2020-12-01 05:11:44 CET, end at Fri 2020-12-11 20:22:17 CET. -- Dec 11 20:16:47 3400G systemd[1]: sound.target: Found ordering cycle on sound-extra.service/start Dec 11 20:16:47 3400G systemd[1]: sound.target: Found dependency on alsa-restore.service/start Dec 11 20:16:47 3400G systemd[1]: sound.target: Found dependency on sound.target/start Dec 11 20:16:47 3400G systemd[1]: sound.target: Job sound-extra.service/start deleted to break ordering cycle starting with sound.target/start Dec 11 20:16:47 3400G systemd[1]: Starting Save/Restore Sound Card State... Dec 11 20:16:47 3400G systemd[1]: Finished Save/Restore Sound Card State. 3400G:~ # -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904#c6
--- Comment #6 from Takashi Iwai
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904#c7
--- Comment #7 from Karl Mistelberger
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904#c8
--- Comment #8 from Karl Mistelberger
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904#c9
--- Comment #9 from Takashi Iwai
More trouble:
3400G:~ # journalctl -b -u alsa-restore.service -o short-monotonic -- Logs begin at Tue 2020-12-01 05:11:44 CET, end at Sat 2020-12-12 07:28:38 CET. -- [ 5.423312] 3400G systemd[1]: Condition check resulted in Save/Restore Sound Card State being skipped. 3400G:~ # systemctl status alsa-restore.service ��� alsa-restore.service - Save/Restore Sound Card State Loaded: loaded (/usr/lib/systemd/system/alsa-restore.service; static) Active: inactive (dead) Condition: start condition failed at Sat 2020-12-12 07:28:03 CET; 1min 20s ago ������ ConditionPathExistsGlob=/dev/snd/control* was not met
Did you apply the workaround in /usr/lib/udev/rules.d/99-systemd.rules? You need both changes, one in alsactl (and alsa-restore.service) and the udev rules. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904#c10
--- Comment #10 from Karl Mistelberger
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904#c11
--- Comment #11 from Takashi Iwai
3400G:~ # cat /etc/udev/rules.d/sound.rules
Where did you have this file..? In anyway, please remove this and retest. This extra one might confuse systemd dependencies. Instead, make sure that you corrected /usr/lib/udev/rules.d/99-systemd.conf to replace "card*" with "controlC*". -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904#c12
--- Comment #12 from Karl Mistelberger
(In reply to Karl Mistelberger from comment #10)
3400G:~ # cat /etc/udev/rules.d/sound.rules
Where did you have this file..? In anyway, please remove this and retest. This extra one might confuse systemd dependencies. Instead, make sure that you corrected /usr/lib/udev/rules.d/99-systemd.conf to replace "card*" with "controlC*".
According to man udev /etc/udev/rules.d/sound.rules should work. And it does work, but not reliably! I am now testing with modified vendor file: 3400G:~ # grep sound /usr/lib/udev/rules.d/99-systemd.rules SUBSYSTEM=="sound", KERNEL=="controlC*", TAG+="systemd", ENV{SYSTEMD_WANTS}+="sound.target", ENV{SYSTEMD_USER_WANTS}+="sound.target" 3400G:~ # -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904#c13
--- Comment #13 from Takashi Iwai
(In reply to Takashi Iwai from comment #11)
(In reply to Karl Mistelberger from comment #10)
3400G:~ # cat /etc/udev/rules.d/sound.rules
Where did you have this file..? In anyway, please remove this and retest. This extra one might confuse systemd dependencies. Instead, make sure that you corrected /usr/lib/udev/rules.d/99-systemd.conf to replace "card*" with "controlC*".
According to man udev /etc/udev/rules.d/sound.rules should work. And it does work, but not reliably!
The point is that this rule is utterly superfluous with the recent alsa-utils package. alsa-utils package already provides the own alsactl invocation in /usr/lib/udev/90-alsa-restore.rules, and the systemd with sound.target symlinks in /usr/lib/systemd/system/sound.target.wants/*. No need (or even harmful) to add the extra rules. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904#c14
--- Comment #14 from Karl Mistelberger
The point is that this rule is utterly superfluous with the recent alsa-utils package. alsa-utils package already provides the own alsactl invocation in /usr/lib/udev/90-alsa-restore.rules, and the systemd with sound.target symlinks in /usr/lib/systemd/system/sound.target.wants/*. No need (or even harmful) to add the extra rules.
Deleted line: SUBSYSTEM=="sound", KERNEL=="controlC*", TAG+="systemd", ENV{SYSTEMD_WANTS}+="sound.target", ENV{SYSTEMD_USER_WANTS}+="sound.target" from /usr/lib/udev/rules.d/99-systemd.rules and rebooted: No sound! -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904#c15
--- Comment #15 from Takashi Iwai
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904#c16
--- Comment #16 from Karl Mistelberger
Of course it would break. I asked to delete an extra file you've added, /etc/udev/rules.d/sound.rules. This is the superfluous thing.
Being reluctant to modify a file owned by systemd I added the correct rule to /etc/udev/rules.d/sound.rules. That worked well on host erlangen. When making the same change on host 3400G I observed shaky behavior. That was caused by the original rule in file /usr/lib/udev/rules.d/99-systemd.rules. I commented the line out and everything was fine. No more double initialization as in comment #2: erlangen:~ # systemctl list-units '*sound*' UNIT LOAD ACTIVE SUB DESCRIPTION sys-devices-pci0000:00-0000:00:01.0-0000:01:00.1-sound-card1-controlC1.device loaded active plugged /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/controlC1 sys-devices-pci0000:00-0000:00:1f.3-sound-card0-controlC0.device loaded active plugged /sys/devices/pci0000:00/0000:00:1f.3/sound/card0/controlC0 sound.target loaded active active Sound Card erlangen:~ # alsa-utils-1.2.4-220.1.x86_64 now works reliably on both hosts! -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904#c17
--- Comment #17 from Takashi Iwai
(In reply to Takashi Iwai from comment #15)
Of course it would break. I asked to delete an extra file you've added, /etc/udev/rules.d/sound.rules. This is the superfluous thing.
Being reluctant to modify a file owned by systemd I added the correct rule to /etc/udev/rules.d/sound.rules. That worked well on host erlangen.
When making the same change on host 3400G I observed shaky behavior. That was caused by the original rule in file /usr/lib/udev/rules.d/99-systemd.rules. I commented the line out and everything was fine. No more double initialization as in comment #2:
erlangen:~ # systemctl list-units '*sound*' UNIT LOAD ACTIVE SUB DESCRIPTION
sys-devices-pci0000:00-0000:00:01.0-0000:01:00.1-sound-card1-controlC1. device loaded active plugged /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/controlC1 sys-devices-pci0000:00-0000:00:1f.3-sound-card0-controlC0.device loaded active plugged /sys/devices/pci0000:00/0000:00:1f.3/sound/card0/controlC0 sound.target loaded active active Sound Card
erlangen:~ #
alsa-utils-1.2.4-220.1.x86_64 now works reliably on both hosts!
Do you mean that alsa-utils-1.2.4-220.1 works as-is (with 99-systemd.rules change to replace with "controlC*"), or still need some other changes? If the current change in my branch is fine, I'm going to submit to TW and Leap 15.x. If anything else is mandatory, let me know exactly what change. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904#c18
--- Comment #18 from Karl Mistelberger
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904#c19
--- Comment #19 from Takashi Iwai
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904#c20
--- Comment #20 from Karl Mistelberger
As mentioned in comment 4, the Leap 15.2 package is found in another OBS repo, home:tiwai:branches:openSUSE:Leap:15.2:Update/alsa-utils
Installed http://download.opensuse.org/repositories/home:/tiwai:/branches:/openSUSE:/L... fixed /usr/lib/udev/rules.d/99-systemd.rules, rebooted and got what I expected: Leap:~ # systemctl list-units "*sound*" UNIT LOAD ACTIVE SUB DESCRIPTION sys-devices-pci0000:00-0000:00:08.1-0000:08:00.1-sound-card0-controlC0.device loaded active plugged /sys/devices/pci0000:00/0000:00:08.1/0000:08:00.1/sound/card0/controlC0 sys-devices-pci0000:00-0000:00:08.1-0000:08:00.6-sound-card1-controlC1.device loaded active plugged /sys/devices/pci0000:00/0000:00:08.1/0000:08:00.6/sound/card1/controlC1 sound.target loaded active active Sound Card Both Tumbleweed and Leap 15.2 are fine now! -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904
http://bugzilla.opensuse.org/show_bug.cgi?id=1179904#c21
Takashi Iwai
participants (1)
-
bugzilla_noreply@suse.com