summaryrefslogtreecommitdiff
path: root/tools/h6-setup-amixer.sh
blob: ad789eae5dba82966b833e1fe260d2278a06a540 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
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