Using sudo alsamixer (a GUI interface) followed by sudo alsactl, I have been able to adjust an external USB microphone gain (volume). Whenever the USB microphone is removed, the whole procedure must be repeated. amixer is a text shell based command that has the same results as alsamixer so that I could write a shell script to execute each time the external USB microphone is plugged-in. I have read man amixer; amixer -c 1 sset Line,0 80%,40% unmute cap from man is the closest to what I need but the syntax is not that clear. I have read https://www.geeksforgeeks.org/amixer-command-in-linux-with-examples/ but that too is not that clear. I assume there is no alsamixer setting to produce the equivalent amixer command. Any assistance would be appreciated. Take care. Stay safe.
Asked
Active
Viewed 2,717 times
1 Answers
0
From:
Howto save AlsaMixer settings?
ou could also save the mixer settings into a custom file with alsactl:
alsactl --file ~/.config/asound.state store
Reloading:
alsactl --file ~/.config/asound.state restore
Note that until some posts a how-to or I can track it down, the above alsactl ... restore needs to be done each time the USB microphone is plugged into the computer. Presumably, there is some USB mounting/opening/attaching initiation configuration file to the USB function that actually identifies the USB microphone as what alsamixer claims to be a "sound card"; modifying that file should make the restore unnecessary as the fix would be permanent to the system and used for every instance of the USB microphone.
Yasha Karant
- 1,193