What does it mean when 'alsactl restore' talks invalid sysfs?
alsactl: sysfs_init:48: sysfs path '/sys' is invalid
Found hardware: "HDA-Intel" "Analog Devices AD1989B" "HDA:11d4989b,10438311,00100300" "0x1043" "0x8311"
Hardware is initialized using a generic method
This is what I could read on boot after a recent kernel upgrade (4.4.1-2 ->
4.4.3-1, to be exact), as a result of running alsactl restore
Now, the good
thing is my audio didn't stop working, but that's still not right (and my
settings (e.g. volume levels) weren't restored as they should have been).
So, what does this cryptic mention of an invalid sysfs path mean? No clue, and
doing some research didn't really provide much information to be honest. After
looking in the source code, as others had done, all that was found out was that
it seemed to be somehow related to a missing file: /sys/kernel/uevent_helper
No idea what that file is supposed to be, or why it matters so much to
alsactl
, but indeed I don't have such a file. Here's the interesting part
though: I did not have it either back with the previous 4.4.1 kernel. What
gives?
Invalid sysfs path, or just non-matching state?
This is what led me to believe that maybe this weird error wasn't directly the
source of the problem, but occurred as a new code path was executed for some
reason. I thought, maybe my audio card is now identified with a different ID or
something, so the content of the asound.state
file doesn't match, thus (with a
bit of black magic) an invalid sysfs path.
So I tried:
mv /var/lib/alsa/asound.state{,-}
alsactl store
alsactl restore
And guess what? No more errors. And running a diff on the old & new state file led not to a different id, but the addition of a new MIXER ("Loopback Mixing"), which also resulted in a shift of all subsequent indices.
Here's a sample of the diff, to give you an idea of what I mean:
- --- /var/lib/alsa/asound.state- 2016-03-04 20:28:06.959665756 +0100
- +++ /var/lib/alsa/asound.state 2016-03-11 14:18:18.450834147 +0100
- @@ -169,6 +169,18 @@
- }
- control.14 {
- iface MIXER
- + name 'Loopback Mixing'
- + value Enabled
- + comment {
- + access 'read write'
- + type ENUMERATED
- + count 1
- + item.0 Disabled
- + item.1 Enabled
- + }
- + }
- + control.15 {
- + iface MIXER
- name 'Front Mic Playback Volume'
- value.0 0
- value.1 0
- @@ -183,7 +195,7 @@
- dbvalue.1 -3450
- }
- }
- - control.15 {
- + control.16 {
- iface MIXER
- name 'Front Mic Playback Switch'
- value.0 false
- @@ -194,7 +206,7 @@
- count 2
- }
- }
- - control.16 {
- + control.17 {
- iface MIXER
- name 'Rear Mic Playback Volume'
- value.0 0
So then we're in a classic merge situation: simply update the new asound.state
file to get all the actual values back under the new indices, and now alcactl
restore
works again as expected. Simple as that.
So what does the invalid sysfs mean?
Oh, right. Well, turns out the title of this post might be a bit misleading,
because I still have no idea what that cryptic error message means, or why the
/sys/kernel/uevent_helper
file matters (or if I ever had such a file on my
system).
But if you're in a similar situation as mine, this post might give you a hint as to how to get everything working again. And as far as the meaning of an invalid sysfs path, the mystery remains...