Fix: service configuration error for asound.conf

This commit is contained in:
Peter.Yang 2018-02-11 14:29:10 +00:00
parent 12d155f6ea
commit e2266a2791
3 changed files with 58 additions and 826 deletions

View file

@ -68,202 +68,106 @@ state.ALSA {
state.seeed4micvoicec {
control.1 {
iface MIXER
name 'OUT1 Mute'
value false
name 'CH1 digital volume'
value 172
comment {
access 'read write'
type BOOLEAN
type INTEGER
count 1
range '0 - 255'
dbmin -11925
dbmax 7200
dbvalue.0 975
}
}
control.2 {
iface MIXER
name 'OUT2 Mute'
value true
name 'CH2 digital volume'
value 172
comment {
access 'read write'
type BOOLEAN
type INTEGER
count 1
range '0 - 255'
dbmin -11925
dbmax 7200
dbvalue.0 975
}
}
control.3 {
iface MIXER
name 'TX1 Channel1~8 enable'
value '1-4 channels '
name 'CH3 digital volume'
value 172
comment {
access 'read write'
type ENUMERATED
type INTEGER
count 1
item.0 'disable all'
item.1 '1-1 channels '
item.2 '1-2 channels '
item.3 '1-3 channels '
item.4 '1-4 channels '
item.5 '1-5 channels '
item.6 '1-6 channels '
item.7 '1-7 channels '
item.8 '1-8 channels '
range '0 - 255'
dbmin -11925
dbmax 7200
dbvalue.0 975
}
}
control.4 {
iface MIXER
name 'TX1 Channel9~16 enable'
value 'disable all'
name 'CH4 digital volume'
value 172
comment {
access 'read write'
type ENUMERATED
type INTEGER
count 1
item.0 'disable all'
item.1 '8-9 channels '
item.2 '8-10 channels '
item.3 '8-11 channels '
item.4 '8-12 channels '
item.5 '8-13 channels '
item.6 '8-14 channels '
item.7 '8-15 channels '
item.8 '8-16 channels '
range '0 - 255'
dbmin -11925
dbmax 7200
dbvalue.0 975
}
}
control.5 {
iface MIXER
name 'TX2 Channel1~8 enable'
value 'disable all'
name 'ADC1 PGA gain'
value 31
comment {
access 'read write'
type ENUMERATED
type INTEGER
count 1
item.0 'disable all'
item.1 '1-1 channels '
item.2 '1-2 channels '
item.3 '1-3 channels '
item.4 '1-4 channels '
item.5 '1-5 channels '
item.6 '1-6 channels '
item.7 '1-7 channels '
item.8 '1-8 channels '
range '0 - 31'
dbmin 0
dbmax 3100
dbvalue.0 3100
}
}
control.6 {
iface MIXER
name 'TX2 Channel9~16 enable'
value 'disable all'
name 'ADC2 PGA gain'
value 31
comment {
access 'read write'
type ENUMERATED
type INTEGER
count 1
item.0 'disable all'
item.1 '8-9 channels '
item.2 '8-10 channels '
item.3 '8-11 channels '
item.4 '8-12 channels '
item.5 '8-13 channels '
item.6 '8-14 channels '
item.7 '8-15 channels '
item.8 '8-16 channels '
range '0 - 31'
dbmin 0
dbmax 3100
dbvalue.0 3100
}
}
control.7 {
iface MIXER
name 'CH1 digital volume'
value 181
name 'ADC3 PGA gain'
value 31
comment {
access 'read write'
type INTEGER
count 1
range '0 - 255'
dbmin -11925
dbmax 7200
dbvalue.0 1650
range '0 - 31'
dbmin 0
dbmax 3100
dbvalue.0 3100
}
}
control.8 {
iface MIXER
name 'CH2 digital volume'
value 181
comment {
access 'read write'
type INTEGER
count 1
range '0 - 255'
dbmin -11925
dbmax 7200
dbvalue.0 1650
}
}
control.9 {
iface MIXER
name 'CH3 digital volume'
value 181
comment {
access 'read write'
type INTEGER
count 1
range '0 - 255'
dbmin -11925
dbmax 7200
dbvalue.0 1650
}
}
control.10 {
iface MIXER
name 'CH4 digital volume'
value 181
comment {
access 'read write'
type INTEGER
count 1
range '0 - 255'
dbmin -11925
dbmax 7200
dbvalue.0 1650
}
}
control.11 {
iface MIXER
name 'ADC1 PGA gain'
value 27
comment {
access 'read write'
type INTEGER
count 1
range '0 - 31'
dbmin 0
dbmax 3100
dbvalue.0 2700
}
}
control.12 {
iface MIXER
name 'ADC2 PGA gain'
value 27
comment {
access 'read write'
type INTEGER
count 1
range '0 - 31'
dbmin 0
dbmax 3100
dbvalue.0 2700
}
}
control.13 {
iface MIXER
name 'ADC3 PGA gain'
value 27
comment {
access 'read write'
type INTEGER
count 1
range '0 - 31'
dbmin 0
dbmax 3100
dbvalue.0 2700
}
}
control.14 {
iface MIXER
name 'ADC4 PGA gain'
value 27
value 31
comment {
access 'read write'
type INTEGER
@ -271,683 +175,7 @@ state.seeed4micvoicec {
range '0 - 31'
dbmin 0
dbmax 3100
dbvalue.0 2700
}
}
control.15 {
iface MIXER
name 'Tx1 Channels'
value '4 channels '
comment {
access 'read write'
type ENUMERATED
count 1
item.0 '1 channels '
item.1 '2 channels '
item.2 '3 channels '
item.3 '4 channels '
item.4 '5 channels '
item.5 '6 channels '
item.6 '7 channels '
item.7 '8 channels '
item.8 '9 channels '
item.9 '10 channels '
item.10 '11 channels '
item.11 '12 channels '
item.12 '13 channels '
item.13 '14 channels '
item.14 '15 channels '
item.15 '16 channels '
}
}
control.16 {
iface MIXER
name 'Tx2 Channels'
value '1 channels '
comment {
access 'read write'
type ENUMERATED
count 1
item.0 '1 channels '
item.1 '2 channels '
item.2 '3 channels '
item.3 '4 channels '
item.4 '5 channels '
item.5 '6 channels '
item.6 '7 channels '
item.7 '8 channels '
item.8 '9 channels '
item.9 '10 channels '
item.10 '11 channels '
item.11 '12 channels '
item.12 '13 channels '
item.13 '14 channels '
item.14 '15 channels '
item.15 '16 channels '
}
}
control.17 {
iface MIXER
name 'Tx1 Channels 1 MAP'
value '1st adc sample'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 '1st adc sample'
item.1 '2st adc sample'
item.2 '3st adc sample'
item.3 '4st adc sample'
}
}
control.18 {
iface MIXER
name 'Tx1 Channels 2 MAP'
value '2st adc sample'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 '1st adc sample'
item.1 '2st adc sample'
item.2 '3st adc sample'
item.3 '4st adc sample'
}
}
control.19 {
iface MIXER
name 'Tx1 Channels 3 MAP'
value '3st adc sample'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 '1st adc sample'
item.1 '2st adc sample'
item.2 '3st adc sample'
item.3 '4st adc sample'
}
}
control.20 {
iface MIXER
name 'Tx1 Channels 4 MAP'
value '4st adc sample'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 '1st adc sample'
item.1 '2st adc sample'
item.2 '3st adc sample'
item.3 '4st adc sample'
}
}
control.21 {
iface MIXER
name 'Tx1 Channels 5 MAP'
value '1st adc sample'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 '1st adc sample'
item.1 '2st adc sample'
item.2 '3st adc sample'
item.3 '4st adc sample'
}
}
control.22 {
iface MIXER
name 'Tx1 Channels 6 MAP'
value '1st adc sample'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 '1st adc sample'
item.1 '2st adc sample'
item.2 '3st adc sample'
item.3 '4st adc sample'
}
}
control.23 {
iface MIXER
name 'Tx1 Channels 7 MAP'
value '1st adc sample'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 '1st adc sample'
item.1 '2st adc sample'
item.2 '3st adc sample'
item.3 '4st adc sample'
}
}
control.24 {
iface MIXER
name 'Tx1 Channels 8 MAP'
value '1st adc sample'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 '1st adc sample'
item.1 '2st adc sample'
item.2 '3st adc sample'
item.3 '4st adc sample'
}
}
control.25 {
iface MIXER
name 'Tx1 Channels 9 MAP'
value '1st adc sample'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 '1st adc sample'
item.1 '2st adc sample'
item.2 '3st adc sample'
item.3 '4st adc sample'
}
}
control.26 {
iface MIXER
name 'Tx1 Channels 10 MAP'
value '1st adc sample'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 '1st adc sample'
item.1 '2st adc sample'
item.2 '3st adc sample'
item.3 '4st adc sample'
}
}
control.27 {
iface MIXER
name 'Tx1 Channels 11 MAP'
value '1st adc sample'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 '1st adc sample'
item.1 '2st adc sample'
item.2 '3st adc sample'
item.3 '4st adc sample'
}
}
control.28 {
iface MIXER
name 'Tx1 Channels 12 MAP'
value '1st adc sample'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 '1st adc sample'
item.1 '2st adc sample'
item.2 '3st adc sample'
item.3 '4st adc sample'
}
}
control.29 {
iface MIXER
name 'Tx1 Channels 13 MAP'
value '1st adc sample'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 '1st adc sample'
item.1 '2st adc sample'
item.2 '3st adc sample'
item.3 '4st adc sample'
}
}
control.30 {
iface MIXER
name 'Tx1 Channels 14 MAP'
value '1st adc sample'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 '1st adc sample'
item.1 '2st adc sample'
item.2 '3st adc sample'
item.3 '4st adc sample'
}
}
control.31 {
iface MIXER
name 'Tx1 Channels 15 MAP'
value '1st adc sample'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 '1st adc sample'
item.1 '2st adc sample'
item.2 '3st adc sample'
item.3 '4st adc sample'
}
}
control.32 {
iface MIXER
name 'Tx1 Channels 16 MAP'
value '1st adc sample'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 '1st adc sample'
item.1 '2st adc sample'
item.2 '3st adc sample'
item.3 '4st adc sample'
}
}
control.33 {
iface MIXER
name 'Tx2 Channels 1 MAP'
value '1st adc sample'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 '1st adc sample'
item.1 '2st adc sample'
item.2 '3st adc sample'
item.3 '4st adc sample'
}
}
control.34 {
iface MIXER
name 'Tx2 Channels 2 MAP'
value '1st adc sample'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 '1st adc sample'
item.1 '2st adc sample'
item.2 '3st adc sample'
item.3 '4st adc sample'
}
}
control.35 {
iface MIXER
name 'Tx2 Channels 3 MAP'
value '1st adc sample'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 '1st adc sample'
item.1 '2st adc sample'
item.2 '3st adc sample'
item.3 '4st adc sample'
}
}
control.36 {
iface MIXER
name 'Tx2 Channels 4 MAP'
value '1st adc sample'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 '1st adc sample'
item.1 '2st adc sample'
item.2 '3st adc sample'
item.3 '4st adc sample'
}
}
control.37 {
iface MIXER
name 'Tx2 Channels 5 MAP'
value '1st adc sample'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 '1st adc sample'
item.1 '2st adc sample'
item.2 '3st adc sample'
item.3 '4st adc sample'
}
}
control.38 {
iface MIXER
name 'Tx2 Channels 6 MAP'
value '1st adc sample'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 '1st adc sample'
item.1 '2st adc sample'
item.2 '3st adc sample'
item.3 '4st adc sample'
}
}
control.39 {
iface MIXER
name 'Tx2 Channels 7 MAP'
value '1st adc sample'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 '1st adc sample'
item.1 '2st adc sample'
item.2 '3st adc sample'
item.3 '4st adc sample'
}
}
control.40 {
iface MIXER
name 'Tx2 Channels 8 MAP'
value '1st adc sample'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 '1st adc sample'
item.1 '2st adc sample'
item.2 '3st adc sample'
item.3 '4st adc sample'
}
}
control.41 {
iface MIXER
name 'Tx2 Channels 9 MAP'
value '1st adc sample'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 '1st adc sample'
item.1 '2st adc sample'
item.2 '3st adc sample'
item.3 '4st adc sample'
}
}
control.42 {
iface MIXER
name 'Tx2 Channels 10 MAP'
value '1st adc sample'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 '1st adc sample'
item.1 '2st adc sample'
item.2 '3st adc sample'
item.3 '4st adc sample'
}
}
control.43 {
iface MIXER
name 'Tx2 Channels 11 MAP'
value '1st adc sample'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 '1st adc sample'
item.1 '2st adc sample'
item.2 '3st adc sample'
item.3 '4st adc sample'
}
}
control.44 {
iface MIXER
name 'Tx2 Channels 12 MAP'
value '1st adc sample'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 '1st adc sample'
item.1 '2st adc sample'
item.2 '3st adc sample'
item.3 '4st adc sample'
}
}
control.45 {
iface MIXER
name 'Tx2 Channels 13 MAP'
value '1st adc sample'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 '1st adc sample'
item.1 '2st adc sample'
item.2 '3st adc sample'
item.3 '4st adc sample'
}
}
control.46 {
iface MIXER
name 'Tx2 Channels 14 MAP'
value '1st adc sample'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 '1st adc sample'
item.1 '2st adc sample'
item.2 '3st adc sample'
item.3 '4st adc sample'
}
}
control.47 {
iface MIXER
name 'Tx2 Channels 15 MAP'
value '1st adc sample'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 '1st adc sample'
item.1 '2st adc sample'
item.2 '3st adc sample'
item.3 '4st adc sample'
}
}
control.48 {
iface MIXER
name 'Tx2 Channels 16 MAP'
value '1st adc sample'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 '1st adc sample'
item.1 '2st adc sample'
item.2 '3st adc sample'
item.3 '4st adc sample'
}
}
control.49 {
iface MIXER
name 'ADC4 Source'
value 'Analog ADC4'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 'Analog ADC1'
item.1 'Analog ADC2'
item.2 'Analog ADC3'
item.3 'Analog ADC4'
}
}
control.50 {
iface MIXER
name 'ADC3 Source'
value 'Analog ADC3'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 'Analog ADC1'
item.1 'Analog ADC2'
item.2 'Analog ADC3'
item.3 'Analog ADC4'
}
}
control.51 {
iface MIXER
name 'ADC2 Source'
value 'Analog ADC2'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 'Analog ADC1'
item.1 'Analog ADC2'
item.2 'Analog ADC3'
item.3 'Analog ADC4'
}
}
control.52 {
iface MIXER
name 'ADC1 Source'
value 'Analog ADC1'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 'Analog ADC1'
item.1 'Analog ADC2'
item.2 'Analog ADC3'
item.3 'Analog ADC4'
}
}
control.53 {
iface MIXER
name 'ADC1 Digital Mixer gc'
value 'disable all'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 'disable all'
item.1 'ADC1 data'
item.2 'ADC2 data'
item.3 'ADC3 data'
item.4 'ADC4 data'
}
}
control.54 {
iface MIXER
name 'ADC1 Digital Mixer src'
value 'ADC1 data'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 'disable all'
item.1 'ADC1 data'
item.2 'ADC2 data'
item.3 'ADC3 data'
item.4 'ADC4 data'
}
}
control.55 {
iface MIXER
name 'ADC2 Digital Mixer gc'
value 'disable all'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 'disable all'
item.1 'ADC1 data'
item.2 'ADC2 data'
item.3 'ADC3 data'
item.4 'ADC4 data'
}
}
control.56 {
iface MIXER
name 'ADC2 Digital Mixer src'
value 'ADC2 data'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 'disable all'
item.1 'ADC1 data'
item.2 'ADC2 data'
item.3 'ADC3 data'
item.4 'ADC4 data'
}
}
control.57 {
iface MIXER
name 'ADC3 Digital Mixer gc'
value 'disable all'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 'disable all'
item.1 'ADC1 data'
item.2 'ADC2 data'
item.3 'ADC3 data'
item.4 'ADC4 data'
}
}
control.58 {
iface MIXER
name 'ADC3 Digital Mixer src'
value 'ADC3 data'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 'disable all'
item.1 'ADC1 data'
item.2 'ADC2 data'
item.3 'ADC3 data'
item.4 'ADC4 data'
}
}
control.59 {
iface MIXER
name 'ADC4 Digital Mixer gc'
value 'disable all'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 'disable all'
item.1 'ADC1 data'
item.2 'ADC2 data'
item.3 'ADC3 data'
item.4 'ADC4 data'
}
}
control.60 {
iface MIXER
name 'ADC4 Digital Mixer src'
value 'ADC4 data'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 'disable all'
item.1 'ADC1 data'
item.2 'ADC2 data'
item.3 'ADC3 data'
item.4 'ADC4 data'
dbvalue.0 3100
}
}
}

View file

@ -22,5 +22,5 @@ pcm.dmixed {
pcm.ac108 {
type plug
slave.pcm "hw:1,0"
ac108-slavepcm "hw:1,0"
}

View file

@ -20,6 +20,10 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
set -x
exec 1>/var/log/$(basename $0).log 2>&1
is_1a=$(i2cdetect -y 1 0x1a 0x1a | grep 1a | awk '{print $2}')
is_35=$(i2cdetect -y 1 0x35 0x35 | grep 35 | awk '{print $2}')
is_3b=$(i2cdetect -y 1 0x3b 0x3b | grep 3b | awk '{print $2}')
@ -50,13 +54,13 @@ if [ "x${is_3b}" == "x3b" ] && [ "x${is_35}" == "x" ] ; then
cp /etc/voicecard/asound_4mic.conf /etc/asound.conf
echo "get slavepcm line number"
line=$(grep -n slavepcm /etc/asound.conf | awk '{print $1}' | sed 's/://')
line=$(grep -n ac108-slavepcm /etc/asound.conf | awk '{print $1}' | sed 's/://')
echo "delete ${line} slavepcm hw number"
sed -i -e "${line}d" /etc/asound.conf
echo "inset slavepcm hw:${hw},0"
sed -i "${line}i slavepcm \"hw:${hw},0\"" /etc/asound.conf
echo "insert slavepcm hw:${hw},0"
sed -i "${line}i slave.pcm \"hw:${hw},0\"" /etc/asound.conf
cp /etc/voicecard/ac108_asound.state /var/lib/alsa/asound.state
fi