2021-12-12 14:28:31 +00:00
|
|
|
SectionVerb {
|
|
|
|
EnableSequence [
|
2022-06-15 15:39:35 +00:00
|
|
|
# First of all, disable the internal speaker amplifier
|
|
|
|
cset "name='Internal Speaker Switch' off"
|
2021-12-12 14:28:31 +00:00
|
|
|
|
2022-06-15 15:39:35 +00:00
|
|
|
### Based on /codecs/rt5640/EnableSeq.conf ###
|
|
|
|
|
|
|
|
# Get audio only from the microphones, not the system
|
|
|
|
cset "name='DAC MIXL INF1 Switch' off"
|
|
|
|
cset "name='DAC MIXR INF1 Switch' off"
|
|
|
|
cset "name='DAC MIXL Stereo ADC Switch' on"
|
|
|
|
cset "name='DAC MIXR Stereo ADC Switch' on"
|
2021-12-12 14:28:31 +00:00
|
|
|
cset "name='Stereo DAC MIXL DAC L1 Switch' on"
|
|
|
|
cset "name='Stereo DAC MIXR DAC R1 Switch' on"
|
|
|
|
cset "name='Stereo DAC MIXL DAC L2 Switch' on"
|
|
|
|
cset "name='Stereo DAC MIXR DAC R2 Switch' on"
|
2022-06-15 15:39:35 +00:00
|
|
|
cset "name='OUT MIXL DAC L1 Switch' off"
|
|
|
|
cset "name='OUT MIXR DAC R1 Switch' off"
|
|
|
|
cset "name='SPK MIXL DAC L1 Switch' off"
|
|
|
|
cset "name='SPK MIXR DAC R1 Switch' off"
|
2021-12-12 14:28:31 +00:00
|
|
|
|
|
|
|
# uncomment to enable swap between AIF1 and AIF2
|
|
|
|
# warning: can only work with SSP0 firmware enabled
|
|
|
|
cset "name='SDI select' 0"
|
|
|
|
cset "name='DAI select' 0"
|
|
|
|
#cset "name='SDI select' 1"
|
|
|
|
#cset "name='DAI select' 1"
|
|
|
|
|
|
|
|
cset "name='DAC2 Playback Switch' on"
|
|
|
|
|
|
|
|
# Input Configuration
|
|
|
|
cset "name='Stereo ADC1 Mux' ADC"
|
|
|
|
cset "name='Stereo ADC2 Mux' DMIC1"
|
|
|
|
cset "name='ADC Capture Switch' on"
|
|
|
|
|
|
|
|
cset "name='Mono ADC L1 Mux' ADCL"
|
|
|
|
cset "name='Mono ADC R1 Mux' ADCR"
|
|
|
|
cset "name='Mono ADC L2 Mux' DMIC L1"
|
|
|
|
cset "name='Mono ADC R2 Mux' DMIC R1"
|
|
|
|
cset "name='Mono ADC Capture Switch' on"
|
|
|
|
|
2023-12-14 01:55:41 +00:00
|
|
|
# Set capture volume to 0dB (47) so modem audio doesn't overdrive the ADC
|
|
|
|
# Bobby: switch down to 0, mic is way to sensitive since kernel ~6.5
|
|
|
|
cset "name='ADC Capture Volume' 0"
|
|
|
|
cset "name='Mono ADC Capture Volume' 47"
|
2022-06-15 15:39:35 +00:00
|
|
|
|
2021-12-12 14:28:31 +00:00
|
|
|
# The second 'Mono ADC' path does not have a 'Boost Gain',
|
|
|
|
# set this to 0dB so that the volume of the AIF1 and AIF2 paths is equal.
|
|
|
|
cset "name='ADC Boost Gain' 0"
|
|
|
|
|
2022-06-15 15:39:35 +00:00
|
|
|
# Set IN1 internal mic boost to 8 (max)
|
2021-12-12 14:28:31 +00:00
|
|
|
# Set IN2 headset-mic boost to 1, headset mics are quite loud
|
2022-06-15 15:39:35 +00:00
|
|
|
# Set IN3 (modem audio) boost to 0 as it's already loud enough
|
2023-12-14 01:55:41 +00:00
|
|
|
cset "name='IN1 Boost' 0"
|
2021-12-12 14:28:31 +00:00
|
|
|
cset "name='IN2 Boost' 1"
|
2022-06-15 15:39:35 +00:00
|
|
|
cset "name='IN3 Boost' 0"
|
2021-12-12 14:28:31 +00:00
|
|
|
|
|
|
|
# Start with all controls which are used by the individual
|
|
|
|
# input/output Enable/DisableSequences off
|
|
|
|
|
|
|
|
cset "name='RECMIXL BST1 Switch' off"
|
|
|
|
cset "name='RECMIXR BST1 Switch' off"
|
2022-06-15 15:39:35 +00:00
|
|
|
# IN2 is headset mic, make sure its routed to the left channel
|
|
|
|
cset "name='RECMIXL BST2 Switch' on"
|
2021-12-12 14:28:31 +00:00
|
|
|
cset "name='RECMIXR BST2 Switch' off"
|
2022-06-15 15:39:35 +00:00
|
|
|
# IN3 is modem audio, route it to the right channel
|
2021-12-12 14:28:31 +00:00
|
|
|
cset "name='RECMIXL BST3 Switch' off"
|
2022-06-15 15:39:35 +00:00
|
|
|
cset "name='RECMIXR BST3 Switch' on"
|
2021-12-12 14:28:31 +00:00
|
|
|
|
|
|
|
cset "name='Stereo ADC MIXL ADC1 Switch' off"
|
|
|
|
cset "name='Stereo ADC MIXR ADC1 Switch' off"
|
|
|
|
cset "name='Stereo ADC MIXL ADC2 Switch' off"
|
|
|
|
cset "name='Stereo ADC MIXR ADC2 Switch' off"
|
|
|
|
cset "name='Mono ADC MIXL ADC1 Switch' off"
|
|
|
|
cset "name='Mono ADC MIXR ADC1 Switch' off"
|
|
|
|
cset "name='Mono ADC MIXL ADC2 Switch' off"
|
|
|
|
cset "name='Mono ADC MIXR ADC2 Switch' off"
|
|
|
|
|
|
|
|
# Limit amplification factor of earpiece amplifier so sound stays clear
|
|
|
|
cset "name='Class D SPK Ratio Control' 1.66x"
|
|
|
|
|
|
|
|
# Loopback IN3 to earpiece/speaker/headphones
|
|
|
|
cset "name='OUT MIXR REC MIXR Switch' on"
|
|
|
|
cset "name='SPK MIXR OUT MIXR Switch' on"
|
|
|
|
|
|
|
|
# Send the left channel (microphones) to the modem through DAC L1
|
|
|
|
cset "name='LOUT MIX DAC L1 Switch' on"
|
|
|
|
# Don't use DAC R1 nor the OUTVOL blocks as we use them for
|
|
|
|
# routing audio from the modem
|
|
|
|
cset "name='LOUT MIX DAC R1 Switch' off"
|
|
|
|
cset "name='LOUT MIX OUTVOL L Switch' off"
|
|
|
|
cset "name='LOUT MIX OUTVOL R Switch' off"
|
|
|
|
|
2022-06-15 15:39:35 +00:00
|
|
|
# Disable left channel for HP (speaker/headphones) output
|
|
|
|
# as we're only routing modem audio to the right channel
|
|
|
|
cset "name='HP L Playback Switch' off"
|
|
|
|
|
|
|
|
# Turn off playback switches by default, otherwise both Speaker
|
|
|
|
# and headphones are playing audio initially until headphones are
|
|
|
|
# re-inserted.
|
2021-12-12 14:28:31 +00:00
|
|
|
cset "name='HP L Playback Switch' off"
|
2022-06-15 15:39:35 +00:00
|
|
|
cset "name='HP R Playback Switch' off"
|
|
|
|
cset "name='Speaker L Playback Switch' off"
|
|
|
|
cset "name='Speaker R Playback Switch' off"
|
|
|
|
|
|
|
|
# MONO output is used as IN3 here, so make sure it's disabled
|
|
|
|
cset "name='Mono Playback Switch' off"
|
|
|
|
|
|
|
|
# Set playback volumes to 0dB
|
|
|
|
cset "name='HP Playback Volume' 31"
|
2023-12-14 01:55:41 +00:00
|
|
|
cset "name='Speaker Playback Volume' 48"
|
2021-12-12 14:28:31 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
DisableSequence [
|
2022-06-15 15:39:35 +00:00
|
|
|
# Turn off all output channels
|
|
|
|
cset "name='HP L Playback Switch' off"
|
|
|
|
cset "name='HP R Playback Switch' off"
|
|
|
|
cset "name='HP Channel Switch' off"
|
|
|
|
cset "name='Speaker L Playback Switch' off"
|
|
|
|
cset "name='Speaker R Playback Switch' off"
|
|
|
|
cset "name='Speaker Channel Switch' off"
|
|
|
|
|
2021-12-12 14:28:31 +00:00
|
|
|
# Reset output routing
|
|
|
|
cset "name='DAC MIXL Stereo ADC Switch' off"
|
|
|
|
cset "name='DAC MIXR Stereo ADC Switch' off"
|
|
|
|
cset "name='OUT MIXR REC MIXR Switch' off"
|
|
|
|
cset "name='SPK MIXR OUT MIXR Switch' off"
|
|
|
|
cset "name='LOUT MIX DAC L1 Switch' off"
|
|
|
|
|
|
|
|
# Reset ADC input routing
|
|
|
|
cset "name='RECMIXL BST2 Switch' off"
|
|
|
|
cset "name='RECMIXR BST3 Switch' off"
|
|
|
|
]
|
|
|
|
|
|
|
|
Value {
|
|
|
|
TQ "VoiceCall"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SectionDevice."Earpiece" {
|
|
|
|
Comment "Internal Earpiece"
|
|
|
|
|
|
|
|
ConflictingDevice [
|
2022-06-15 15:39:35 +00:00
|
|
|
"Headphones"
|
2021-12-12 14:28:31 +00:00
|
|
|
"Speaker"
|
|
|
|
]
|
|
|
|
|
|
|
|
EnableSequence [
|
2022-06-15 15:39:35 +00:00
|
|
|
cset "name='SPOL MIX SPKVOL L Switch' on"
|
2021-12-12 14:28:31 +00:00
|
|
|
# Send right channel to left as it's mono only
|
|
|
|
cset "name='SPOL MIX SPKVOL R Switch' on"
|
|
|
|
cset "name='Speaker Channel Switch' on"
|
|
|
|
cset "name='Speaker L Playback Switch' on"
|
|
|
|
]
|
|
|
|
|
|
|
|
DisableSequence [
|
|
|
|
cset "name='Speaker Channel Switch' off"
|
|
|
|
cset "name='Speaker L Playback Switch' off"
|
|
|
|
]
|
|
|
|
|
|
|
|
Value {
|
2022-06-15 15:39:35 +00:00
|
|
|
PlaybackPriority 200
|
2021-12-12 14:28:31 +00:00
|
|
|
PlaybackPCM "hw:${CardId}"
|
|
|
|
PlaybackMixerElem "Speaker"
|
|
|
|
PlaybackVolume "Speaker Playback Volume"
|
|
|
|
PlaybackMasterElem "DAC1"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SectionDevice."Speaker" {
|
|
|
|
Comment "Internal Speaker"
|
|
|
|
|
|
|
|
ConflictingDevice [
|
|
|
|
"Earpiece"
|
2022-06-15 15:39:35 +00:00
|
|
|
"Headphones"
|
2021-12-12 14:28:31 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
EnableSequence [
|
2022-06-15 15:39:35 +00:00
|
|
|
cset "name='HPO MIX HPVOL Switch' on"
|
2021-12-12 14:28:31 +00:00
|
|
|
cset "name='HP Channel Switch' on"
|
|
|
|
cset "name='HP R Playback Switch' on"
|
2022-06-15 15:39:35 +00:00
|
|
|
cset "name='Internal Speaker Switch' on"
|
2021-12-12 14:28:31 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
DisableSequence [
|
2022-06-15 15:39:35 +00:00
|
|
|
cset "name='Internal Speaker Switch' off"
|
2021-12-12 14:28:31 +00:00
|
|
|
cset "name='HP Channel Switch' off"
|
|
|
|
cset "name='HP R Playback Switch' off"
|
|
|
|
]
|
|
|
|
|
|
|
|
Value {
|
|
|
|
PlaybackPriority 100
|
|
|
|
PlaybackPCM "hw:${CardId}"
|
|
|
|
PlaybackMixerElem "HP"
|
|
|
|
PlaybackVolume "HP Playback Volume"
|
|
|
|
PlaybackMasterElem "DAC1"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-06-15 15:39:35 +00:00
|
|
|
SectionDevice."Headphones" {
|
|
|
|
Comment "Headphones"
|
|
|
|
|
|
|
|
ConflictingDevice [
|
|
|
|
"Earpiece"
|
|
|
|
"Speaker"
|
|
|
|
]
|
|
|
|
|
|
|
|
EnableSequence [
|
|
|
|
cset "name='HPO MIX HPVOL Switch' on"
|
|
|
|
cset "name='HP Channel Switch' on"
|
|
|
|
cset "name='HP R Playback Switch' on"
|
|
|
|
]
|
|
|
|
|
|
|
|
DisableSequence [
|
|
|
|
cset "name='HP Channel Switch' off"
|
|
|
|
cset "name='HP R Playback Switch' off"
|
|
|
|
]
|
|
|
|
|
|
|
|
Value {
|
|
|
|
PlaybackPriority 300
|
|
|
|
PlaybackPCM "hw:${CardId}"
|
|
|
|
JackControl "Headphones Jack"
|
|
|
|
PlaybackMixerElem "HP"
|
|
|
|
PlaybackVolume "HP Playback Volume"
|
|
|
|
PlaybackMasterElem "DAC1"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SectionDevice."Mic" {
|
2021-12-12 14:28:31 +00:00
|
|
|
Comment "Internal Microphone"
|
|
|
|
|
2022-06-15 15:39:35 +00:00
|
|
|
ConflictingDevice [
|
|
|
|
"Headset"
|
|
|
|
]
|
|
|
|
|
2021-12-12 14:28:31 +00:00
|
|
|
EnableSequence [
|
|
|
|
cset "name='Stereo ADC MIXL ADC2 Switch' on"
|
|
|
|
]
|
|
|
|
|
|
|
|
DisableSequence [
|
|
|
|
cset "name='Stereo ADC MIXL ADC2 Switch' off"
|
|
|
|
]
|
|
|
|
|
|
|
|
Value {
|
2022-06-15 15:39:35 +00:00
|
|
|
CapturePriority 100
|
2021-12-12 14:28:31 +00:00
|
|
|
CapturePCM "hw:${CardId}"
|
|
|
|
CaptureMixerElem "ADC"
|
|
|
|
CaptureVolume "ADC Capture Volume"
|
|
|
|
CaptureSwitch "ADC Capture Switch"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-06-15 15:39:35 +00:00
|
|
|
SectionDevice."Headset" {
|
2021-12-12 14:28:31 +00:00
|
|
|
Comment "Headset Microphone"
|
|
|
|
|
2022-06-15 15:39:35 +00:00
|
|
|
ConflictingDevice [
|
|
|
|
"Mic"
|
|
|
|
]
|
|
|
|
|
2021-12-12 14:28:31 +00:00
|
|
|
EnableSequence [
|
|
|
|
cset "name='Stereo ADC MIXL ADC1 Switch' on"
|
|
|
|
]
|
|
|
|
|
|
|
|
DisableSequence [
|
|
|
|
cset "name='Stereo ADC MIXL ADC1 Switch' off"
|
|
|
|
]
|
|
|
|
|
|
|
|
Value {
|
2022-06-15 15:39:35 +00:00
|
|
|
CapturePriority 200
|
2021-12-12 14:28:31 +00:00
|
|
|
CapturePCM "hw:${CardId}"
|
2022-06-15 15:39:35 +00:00
|
|
|
JackControl "Headphones Jack"
|
2021-12-12 14:28:31 +00:00
|
|
|
CaptureMixerElem "ADC"
|
|
|
|
CaptureVolume "ADC Capture Volume"
|
|
|
|
CaptureSwitch "ADC Capture Switch"
|
|
|
|
}
|
|
|
|
}
|