I didn't do the fix as reported by Daniel, because I my case the bug is surely in another part of the script. In my case it's in mute_and_zero_levels_on_card() called during mute_and_zero_levels. I've added debugging to test.
In the for loop all kind of devices are muted and almost all entries take a few seconds. The error I get is "amixer: Unable to find simple control '....', 0". The first error I get is "Synth", so amixer works fine for Master, PCM etc which are first in the list. For non working devices, amixer wait a couple of seconds and the whole for loop takes ages.
So, (in my case) the real problem is that amixer is too slow if non-existing devices are muted. By the way, the step store_levels() takes only a few seconds.
I didn't do the fix as reported by Daniel, because I my case the bug is surely in another part of the script. In my case it's in mute_and_ zero_levels_ on_card( ) called during mute_and_ zero_levels. I've added debugging to test.
In the for loop all kind of devices are muted and almost all entries take a few seconds. The error I get is "amixer: Unable to find simple control '....', 0". The first error I get is "Synth", so amixer works fine for Master, PCM etc which are first in the list. For non working devices, amixer wait a couple of seconds and the whole for loop takes ages.
So, (in my case) the real problem is that amixer is too slow if non-existing devices are muted. By the way, the step store_levels() takes only a few seconds.