1#!/bin/bash 2 3adc=$1 4v=$2 5gain_type=digital 6 7if [ -n "$3" ] ; then 8 gain_type=$3 9fi 10 11echo "Set ADC MIC volume, Digital range 0-192, PGA range 0-8" 12 13case $adc in 14 0) 15 ch="Left" 16 ;; 17 *) 18 ch="Right" 19 ;; 20esac 21 22if [ "$gain_type" == "digital" ] ; then 23 ch="All" 24fi 25 26echo "Will set $ch $gain_type" 27 28if [ ! -n "$v" ] ; then 29 echo "ERR: please enter a volume" 30 echo "$0 0 192 digital" 31else 32 if [ "$gain_type" == "digital" ] ; then 33 amixer set "Capture Digital" $v 34 amixer get "Capture Digital" 35 else 36 content="$ch Channel" 37 amixer set "$content" $v 38 amixer get "$content" 39 fi 40fi 41