When you've found a decent set of mixer settings for a particular function you can save them with:
Restoring a saved set of settings is similar:
Some years ago freesmartphone.org had a dbus interface org.freesmartphone.Audio.Manager to look after audio state changes when phone calls arrived etc. What's the equivalent now?
Edit: It seems one option is alsaucm at the command line, or its API equivalent, for switching between use cases. I've not checked whether it's got push/pop capabilities for switching then reverting to whatever was there before.
Code:
alsactl -f /path/to/my/phone_mixer_settings.state store
Code:
alsactl -f /path/to/my/phone_mixer_settings.state restore
Edit: It seems one option is alsaucm at the command line, or its API equivalent, for switching between use cases. I've not checked whether it's got push/pop capabilities for switching then reverting to whatever was there before.