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:

  1. --- /var/lib/alsa/asound.state- 2016-03-04 20:28:06.959665756 +0100
  2. +++ /var/lib/alsa/asound.state  2016-03-11 14:18:18.450834147 +0100
  3. @@ -169,6 +169,18 @@
  4.         }
  5.         control.14 {
  6.                 iface MIXER
  7. +               name 'Loopback Mixing'
  8. +               value Enabled
  9. +               comment {
  10. +                       access 'read write'
  11. +                       type ENUMERATED
  12. +                       count 1
  13. +                       item.0 Disabled
  14. +                       item.1 Enabled
  15. +               }
  16. +       }
  17. +       control.15 {
  18. +               iface MIXER
  19.                 name 'Front Mic Playback Volume'
  20.                 value.0 0
  21.                 value.1 0
  22. @@ -183,7 +195,7 @@
  23.                         dbvalue.1 -3450
  24.                 }
  25.         }
  26. -       control.15 {
  27. +       control.16 {
  28.                 iface MIXER
  29.                 name 'Front Mic Playback Switch'
  30.                 value.0 false
  31. @@ -194,7 +206,7 @@
  32.                         count 2
  33.                 }
  34.         }
  35. -       control.16 {
  36. +       control.17 {
  37.                 iface MIXER
  38.                 name 'Rear Mic Playback Volume'
  39.                 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...

Top of Page