From f3fcef5114b6f22dd01846f829cc87e7438051dc Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Wed, 11 Jan 2023 00:37:48 +0300 Subject: doc: document recording audio on allwinner h6 boards --- doc/arecord_orange_pi.md | 9 ++++++ tools/h6-setup-amixer.sh | 74 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 tools/h6-setup-amixer.sh diff --git a/doc/arecord_orange_pi.md b/doc/arecord_orange_pi.md index 923d526..da32a11 100644 --- a/doc/arecord_orange_pi.md +++ b/doc/arecord_orange_pi.md @@ -28,4 +28,13 @@ done for k in "Mic1 Boost" "Line In" "Mic1" "Mic2 Boost" "Mic2"; do /usr/bin/amixer set "$k" "86%" done +``` + + +## Orange Pi 3 LTS (Allwinner H6) + +See [script](../tools/h6-setup-amixer.sh). + +``` +arecord -v -f S32 -r 44100 test.wav ``` \ No newline at end of file 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 -- cgit v1.2.3