Skip to content
This repository has been archived by the owner on Apr 17, 2024. It is now read-only.

Commit

Permalink
Fix line endings
Browse files Browse the repository at this point in the history
  • Loading branch information
MilkyDeveloper committed Jun 2, 2022
1 parent 749d18b commit 9f193f3
Showing 1 changed file with 55 additions and 55 deletions.
110 changes: 55 additions & 55 deletions bin/sof-setup-aux
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
#!/bin/bash

aplay -l | grep "no soundcards found" && {
echo "No soundcards found."
echo "Did you run sof-setup-audio or apl-sof-setup-audio?"
exit
}

echo "This command is intended to be ran after you run sof-setup-audio and reboot"
echo "Waiting for 10 seconds, you can abort this script before then by hitting CTRL+C"
wait 10

# Kill PulseAudio
# We need full control over raw ALSA devices
{
sudo systemctl --user stop pulseaudio.service
sudo systemctl --user stop pulseaudio.socket
} || sudo killall pulseaudio


echo "Proceeding to modify da7219 mixer settings"
{
# AlsaMixer stuff from u/nsx2brz
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
}

# Add devices 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
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
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

#!/bin/bash

aplay -l | grep "no soundcards found" && {
echo "No soundcards found."
echo "Did you run sof-setup-audio or apl-sof-setup-audio?"
exit
}

echo "This command is intended to be ran after you run sof-setup-audio and reboot"
echo "Waiting for 10 seconds, you can abort this script before then by hitting CTRL+C"
wait 10

# Kill PulseAudio
# We need full control over raw ALSA devices
{
sudo systemctl --user stop pulseaudio.service
sudo systemctl --user stop pulseaudio.socket
} || sudo killall pulseaudio


echo "Proceeding to modify da7219 mixer settings"
{
# AlsaMixer stuff from u/nsx2brz
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
}

# Add devices 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
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
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 "Reboot once more for a working audio jack"

0 comments on commit 9f193f3

Please sign in to comment.