summaryrefslogtreecommitdiff
path: root/tools/h6-setup-amixer.sh
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2023-01-11 00:37:48 +0300
committerEvgeny Zinoviev <me@ch1p.io>2023-01-11 00:49:51 +0300
commitf3fcef5114b6f22dd01846f829cc87e7438051dc (patch)
treeb7bf32c12c4d62b6866a3bfc66f353a0a98e91b7 /tools/h6-setup-amixer.sh
parentbb32e56ca28bb43d5d5afef737f25e4725887725 (diff)
doc: document recording audio on allwinner h6 boards
Diffstat (limited to 'tools/h6-setup-amixer.sh')
-rw-r--r--tools/h6-setup-amixer.sh74
1 files changed, 74 insertions, 0 deletions
diff --git a/tools/h6-setup-amixer.sh b/tools/h6-setup-amixer.sh
new file mode 100644
index 0000000..ad789ea
--- /dev/null
+++ b/tools/h6-setup-amixer.sh
@@ -0,0 +1,74 @@
+#!/bin/bash
+
+amixer() {
+ /usr/bin/amixer "$@"
+}
+
+SWITCHES=(
+ "Left DAC Mixer ADCL"
+ "Left DAC Mixer I2SDACL"
+ "Left I2S Mixer ADCL"
+ "Left I2S Mixer I2SDACL"
+ "Left Input Mixer LINEINL"
+ "Left Input Mixer MIC1"
+ "Left Input Mixer MIC2"
+ "Left Input Mixer OMixerL"
+ "Left Input Mixer OMixerR"
+ "Left Input Mixer PhoneN"
+ "Left Input Mixer PhonePN"
+ "Left Output Mixer DACL"
+ "Left Output Mixer DACR"
+ "Left Output Mixer LINEINL"
+ "Left Output Mixer MIC1"
+ "Left Output Mixer MIC2"
+ "Left Output Mixer PhoneN"
+ "Left Output Mixer PhonePN"
+ "Right DAC Mixer ADCR"
+ "Right DAC Mixer I2SDACR"
+ "Right I2S Mixer ADCR"
+ "Right I2S Mixer I2SDACR"
+ "Right Input Mixer LINEINR"
+ "Right Input Mixer MIC1"
+ "Right Input Mixer MIC2"
+ "Right Input Mixer OMixerL"
+ "Right Input Mixer OMixerR"
+ "Right Input Mixer PhoneP"
+ "Right Input Mixer PhonePN"
+ "Right Output Mixer DACL"
+ "Right Output Mixer DACR"
+ "Right Output Mixer LINEINR"
+ "Right Output Mixer MIC1"
+ "Right Output Mixer MIC2"
+ "Right Output Mixer PhoneP"
+ "Right Output Mixer PhonePN"
+)
+
+for v in "${SWITCHES[@]}"; do
+ value=on
+ case "$v" in
+ *Input*)
+ value=on
+ ;;
+ *Output*)
+ value=off
+ ;;
+ esac
+ amixer set "$v" $value
+done
+
+amixer set "Master" "100%"
+amixer set "MIC1 Boost" "100%"
+amixer set "MIC2 Boost" "100%"
+amixer set "Line Out Mixer" "86%"
+amixer set "MIC Out Mixer" "71%"
+
+MUTE=(
+ "I2S Mixer ADC"
+ "I2S Mixer DAC"
+ "ADC Input"
+ "DAC Mixer ADC"
+ "DAC Mxier DAC" # this is not a typo
+)
+for v in "${MUTE[@]}"; do
+ amixer set "$v" "0%"
+done \ No newline at end of file