I've been having this weird error on boot (I use openrc) for a while now and I've decided to investigate it. At boot, it would always hang for a couple of seconds at "Restoring Mixer Levels" and spit this: "alsactl: unrecognized option '---'" After mangling with /etc/init.d/alsasound, it turns out that it's because of this line: local cards="$(sed -n -e 's/ *\([[:digit:]]*\) .*/\1/p' /proc/asound/cards)" At boot time, on my system, /proc/asound/cards contains "--- no soundcard ---" and this sed expression is to loose, so it captures "---"! On my system, I could fix the problem by changing the sed expression to 's/^ *\([[:digit:]]*\) .*/\1/p' By adding the "^", we ensure that it only matches lines that actually start with a space instead of starting the match at the first space character of the line.
Same error in one of my box (openRC), the troubleshooting was way out of my depth... A couple of days ago, I set up a new rig cloning the root partition of the affected machine and the new rig booted without errors; this puzzled me until I've read this bug report. Your fix worked for me too.
My commit was merged in https://github.com/gentoo/gentoo/commit/f79bf1ba54fd2cb5cb9b8fcbdc9e99fea1b9acc7 .