Comment 4 for bug 9365

Revision history for this message
Ruben Vermeersch (ruben) wrote :

If I rmmod snd_intel8x0 first, it gives no cracking noise at all.

Here is how Gentoo handles this:

unload_modules() {
    LOADED_MODULES="$(/sbin/lsmod | grep -E "^snd" | awk '{print $1}')"
    for MODULE in ${LOADED_MODULES}
    do
        /sbin/rmmod ${MODULE} >& /dev/null
    done
    /sbin/rmmod soundcore >& /dev/null
    /sbin/rmmod gameport >& /dev/null

    # Return success if the modules are unloaded
    test -z "$(/sbin/lsmod | grep -E "^snd" | awk '{print $1}')"
}

This is being executed at the end of alsa shutdown, after the mixer settings
have been stored