I found a simple solution. Tested on Ubuntu 20.04.1 (and Fedora 31).
1. Open alsamixer
alsamixer
2. Choose your soundcard
F6
Sound BlasterX G6
Hit Enter to select the card
3. Activate 'Capture' for 'Line In' and 'External Mic'
F4
Use left-right arrows to navigate to the 'Line In'.
Use Space to activate the 'Capture'
Use left-right arrows to navigate to 'External Mic'
Use Space to activate the 'Capture'
4. Configure PCM Capture Source
F3
Use left-right arrows to navigate to 'PCM Capture Source'
Use up-down arrows to select 'External Mic'
Press ESC to save
5. Record a WAV to test the microphone
arecord -f dat -d 2 /tmp/test-mic.wav -vvv
6. Playback the WAV
aplay /tmp/test-mic.wav
7. Make the change persistent (fail)
After a reboot, The 'PCM Capture Source' keept going back to 'Line In'. I tried a systemd unit file (After=sound.target dbus.service) or a startup script in .zprofile
... nothing worked. I think this is because the card takes some time to startup. So I came up with this workaround :
vim ~/bin/setmic
And add this:
#!/usr/bin/env bash
cardNumber=$(aplay -l|grep 'Sound BlasterX G6'|cut -d' ' -f 2 |tr -d ':')
amixer -c "$cardNumber" -q set "PCM Capture Source" "External Mic"
if [ $? -eq 0 ]; then
echo "PCM Capture Source successfully changed to 'External Mic'"
else
echo "Failed to configure PCM Capture source for Sound BlasterX G6"
fi
amixer -c "$cardNumber" -q sset 'Input Gain Control' 3
if [ $? -eq 0 ]; then
echo "Input Gain Control set to 3"
else
echo "Failed to activate mic Boost for Sound BlasterX G6"
fi
~/bin beeing in my PATH:
chmod u+x ~/bin/setmic
setmic
> PCM Capture Source successfully changed to 'External Mic'
> Input Gain Control set to 3