distribution/packages/hardware/quirks/devices/ODROID-GO Advance/003-audio

112 lines
1.6 KiB
Text
Raw Normal View History

2023-05-15 21:06:18 +00:00
#!/bin/bash
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2023-present BrooksyTech (https://github.com/brooksytech)
. /etc/profile
### Set a custom device so we don't clobber it.
set-audio set "CUSTOM (UNMANAGED)"
set-audio esset "Master"
cat <<EOF >/storage/.config/asound.conf
pcm.!default {
type plug
slave.pcm "dmixer"
}
pcm.dmixer {
type dmix
ipc_key 1024
slave {
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 4096
rate 44100
}
bindings {
0 0
1 1
}
}
EOF
if [ ! -e "/storage/.config/asound.state" ]
then
cat <<EOF >/storage/.config/asound.state
state.rk817int {
control.1 {
iface CARD
name 'Headphones Jack'
value false
comment {
access read
type BOOLEAN
count 1
}
}
control.2 {
iface MIXER
name 'Master Playback Volume'
value.0 220
value.1 220
comment {
access 'read write'
type INTEGER
count 2
range '0 - 255'
dbmin -9500
dbmax 0
dbvalue.0 -1304
dbvalue.1 -1304
}
}
control.3 {
iface MIXER
name 'Master Capture Volume'
value.0 220
value.1 220
comment {
access 'read write'
type INTEGER
count 2
range '0 - 255'
dbmin -9500
dbmax 0
dbvalue.0 -1304
dbvalue.1 -1304
}
}
control.4 {
iface MIXER
name 'Mic Capture Gain'
value.0 6
value.1 6
comment {
access 'read write'
type INTEGER
count 2
range '0 - 15'
dbmin -1800
dbmax 2700
dbvalue.0 0
dbvalue.1 0
}
}
control.5 {
iface MIXER
name 'Playback Mux'
value SPK
comment {
access 'read write'
type ENUMERATED
count 1
item.0 HP
item.1 SPK
}
}
}
EOF
fi