Skip to content

Instantly share code, notes, and snippets.

@unixabg
Created July 22, 2022 23:43
Show Gist options
  • Save unixabg/4ca86477b6ad0504d8b9486f1a160057 to your computer and use it in GitHub Desktop.
Save unixabg/4ca86477b6ad0504d8b9486f1a160057 to your computer and use it in GitHub Desktop.
Samsung Chromebook 4 alsa helper script for the glkda7219max
#!/bin/bash
echo Adding microphone to Pulseaudio
grep -qxF 'load-module module-alsa-source device=hw:0,99' /etc/pulse/default.pa || echo 'load-module module-alsa-source device=hw:0,99' >> /etc/pulse/default.pa
echo Adding headphone to Pulseaudio
grep -qxF 'load-module module-alsa-sink device=hw:0,1' /etc/pulse/default.pa || echo 'load-module module-alsa-sink device=hw:0,1' >> /etc/pulse/default.pa
echo Adding headset microphone to Pulseaudio
grep -qxF 'load-module module-alsa-source device=hw:0,1' /etc/pulse/default.pa || echo 'load-module module-alsa-source device=hw:0,1' >> /etc/pulse/default.pa
echo Installing alsa-ucm-conf from custom repository
git clone https://github.com/unixabg/alsa-ucm-conf.git
cd alsa-ucm-conf
git checkout chomebook/sof-glkda7219max
cp -R ucm2/Intel/sof-glkda7219max /usr/share/alsa/ucm2/Intel/
cp -R ucm2/conf.d/sof-glkda7219ma /usr/share/alsa/ucm2/conf.d/
cp -R ucm2/codecs/da7219 /usr/share/alsa/ucm2/codecs/
echo Configuring headphone/headset mixer
amixer cset name='Playback Digital Volume' 111
amixer cset name='Playback Digital Switch' 1
amixer cset name='Out DACL Mux' DAIL
amixer cset name='Out DACR Mux' DAIR
amixer cset name='Mixer Out FilterL DACL Switch' 1
amixer cset name='Mixer Out FilterR DACR Switch' 1
amixer cset name='ST Mixer Out FilterL Out FilterL Switch' 1
amixer cset name='ST Mixer Out FilterR Out FilterR Switch' 1
amixer cset name='Headphone Jack Switch' on
amixer cset name='Headset Mic Switch' on
amixer cset name='Mic Volume' 5
amixer cset name='Capture Digital Volume' 111
amixer cset name='Capture Digital Switch' 1
amixer cset name='Mixin Volume' 10
amixer cset name='Mixin Switch' 1
amixer cset name='Mixer In Mic Switch' 1
amixer cset name='Out DAIL Mux' ADC
amixer cset name='Out DAIR Mux' ADC
amixer cset name='Pin5-Port0 Mux' 1
amixer cset name='Pin5-Port1 Mux' 1
amixer cset name='Pin5-Port2 Mux' 1
amixer cset name='Pin6-Port0 Mux' 2
amixer cset name='Pin6-Port1 Mux' 2
amixer cset name='Pin6-Port2 Mux' 2
amixer cset name='Gain Ramp Rate' 1
echo Drop noisy mic PGA3.0
amixer set 'PGA3.0 3 Master' 0%
echo Increase quiet mic PGA4.0
amixer set 'PGA4.0 4 Master' 96%
echo Please reboot your computer!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment