codecs/es8316: Fix capture settings
PATCH 1/3 codecs/es8316: Fix capture settings
Fix the following issues with the capture settings:
1. Disable ALC / Auto Level Control, it tries to always get an input signal even when the user is not talking into the mic leading to it cranking up the volume till there is noise at the same level as the user talking.
2. The 'ADC PGA Gain Volume' volume control is not the main 'ADC vol' control, it is the mic amplifier control and setting it to 10 sets it to 24dB not 0dB.
Adjust the comment and set it to 7 which is 16dB which gives a good microphone signal strength without introducing too much noise (with 'ADC Capture Volume' set to 0dB).
3. There actually is a main 'ADC vol' control which goes from -96 to 0dB which is simply called the 'ADC Capture Volume' and when disabling ALC it defaults to -96 dB. Add a line setting it to 0dB.
--- ucm2/codecs/es8316/EnableSeq.conf | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
ucm2/codecs/es8316/EnableSeq.conf +7 -3
@@ -11,11 +11,15 @@ EnableSequence [ cset "name='Headphone Mixer Volume' 4" # Set DAC vol to 0 dB (192/192) cset "name='DAC Playback Volume' 192" - # Set ADC vold to 0 dB (10/10) - cset "name='ADC PGA Gain Volume' 10" + + # Disable Auto Level Control + cset "name='ALC Capture Switch' off" + # Set ADC vol to 0 dB (192/192) + cset "name='ADC Capture Volume' 192" + # Set Mic amplifier to +16 dB + cset "name='ADC PGA Gain Volume' 7" # Setup muxes / switches cset "name='Left Headphone Mixer Left DAC Switch' on" cset "name='Right Headphone Mixer Right DAC Switch' on" - cset "name='ALC Capture Switch' on" ]
Signature · 1 line
2.30.1
PATCH 2/3 codecs/es8316: Fix 'HP Mixer Volume' setting
The 'HP Mixer Volume' control is interesting in that it has a hole in its range which should not be used (described in the tlv table), valid values are 0-4 and 8-11
I assume that the "Set HP mixer vol to -6 dB (4/7) louder does not work" comment which this patch changes comes from attempts to use values in that hole in the range (also notice the wrong max value in the comment).
Setting the HP mixer to -6 dB causes the sound to be significantly softer then under Windows. This commit fixes this by initializing the HP mixer control to 11 / 0 dB.
--- ucm2/codecs/es8316/EnableSeq.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
ucm2/codecs/es8316/EnableSeq.conf +2 -2
@@ -7,8 +7,8 @@ EnableSequence [ # Set HP vol to 0 dB (3/3) cset "name='Headphone Playback Volume' 3" - # Set HP mixer vol to -6 dB (4/7) louder does not work - cset "name='Headphone Mixer Volume' 4" + # Set HP mixer vol to 0 dB + cset "name='Headphone Mixer Volume' 11" # Set DAC vol to 0 dB (192/192) cset "name='DAC Playback Volume' 192"
Signature · 1 line
2.30.1
PATCH 3/3 codecs/es8316: Add hardware volume-control support
In reply to Hans de GoedeAdd hardware volume-control support for the es8316 codec.
--- ucm2/codecs/es8316/HeadPhones.conf | 2 ++ ucm2/codecs/es8316/IN1-HeadsetMic.conf | 2 ++ ucm2/codecs/es8316/IN1-InternalMic.conf | 2 ++ ucm2/codecs/es8316/IN2-HeadsetMic.conf | 2 ++ ucm2/codecs/es8316/IN2-InternalMic.conf | 2 ++ ucm2/codecs/es8316/MonoSpeaker.conf | 4 ++++ ucm2/codecs/es8316/Speaker.conf | 4 ++++ 7 files changed, 18 insertions(+)
ucm2/codecs/es8316/HeadPhones.conf +2 -0
@@ -16,6 +16,8 @@ SectionDevice."Headphones" { Value { PlaybackPriority 200 PlaybackPCM "hw:${CardId}" + PlaybackMixerElem "Headphone Mixer" + PlaybackMasterElem "DAC" JackControl "Headphone Jack" JackHWMute "Speaker" }
ucm2/codecs/es8316/IN1-HeadsetMic.conf +2 -0
@@ -17,6 +17,8 @@ SectionDevice."Headset" { Value { CapturePriority 200 CapturePCM "hw:${CardId}" + CaptureMixerElem "ADC PGA Gain" + CaptureMasterElem "ADC" JackControl "Headset Mic Jack" } }
ucm2/codecs/es8316/IN1-InternalMic.conf +2 -0
@@ -17,5 +17,7 @@ SectionDevice."Mic" { Value { CapturePriority 100 CapturePCM "hw:${CardId}" + CaptureMixerElem "ADC PGA Gain" + CaptureMasterElem "ADC" } }
ucm2/codecs/es8316/IN2-HeadsetMic.conf +2 -0
@@ -17,6 +17,8 @@ SectionDevice."Headset" { Value { CapturePriority 200 CapturePCM "hw:${CardId}" + CaptureMixerElem "ADC PGA Gain" + CaptureMasterElem "ADC" JackControl "Headset Mic Jack" } }
ucm2/codecs/es8316/IN2-InternalMic.conf +2 -0
@@ -17,5 +17,7 @@ SectionDevice."Mic" { Value { CapturePriority 100 CapturePCM "hw:${CardId}" + CaptureMixerElem "ADC PGA Gain" + CaptureMasterElem "ADC" } }
ucm2/codecs/es8316/MonoSpeaker.conf +4 -0
@@ -33,5 +33,9 @@ SectionDevice."Speaker" { Value { PlaybackPriority 100 PlaybackPCM "hw:${CardId}" + # The es8316 only has a HP-amp which is muxed to the speaker + # or to the headpones output + PlaybackMixerElem "Headphone Mixer" + PlaybackMasterElem "DAC" } }
ucm2/codecs/es8316/Speaker.conf +4 -0
@@ -16,5 +16,9 @@ SectionDevice."Speaker" { Value { PlaybackPriority 100 PlaybackPCM "hw:${CardId}" + # The es8316 only has a HP-amp which is muxed to the speaker + # or to the headpones output + PlaybackMixerElem "Headphone Mixer" + PlaybackMasterElem "DAC" } }
Signature · 1 line
2.30.1
Dne 07. 03. 21 v 21:03 Hans de Goede napsal(a):
Quoted 14 lines
Fix the following issues with the capture settings:
1. Disable ALC / Auto Level Control, it tries to always get an input signal even when the user is not talking into the mic leading to it cranking up the volume till there is noise at the same level as the user talking.
2. The 'ADC PGA Gain Volume' volume control is not the main 'ADC vol' control, it is the mic amplifier control and setting it to 10 sets it to 24dB not 0dB.
Adjust the comment and set it to 7 which is 16dB which gives a good microphone signal strength without introducing too much noise (with 'ADC Capture Volume' set to 0dB).
Quoted 5 lines
3. There actually is a main 'ADC vol' control which goes from -96 to 0dB which is simply called the 'ADC Capture Volume' and when disabling ALC it defaults to -96 dB. Add a line setting it to 0dB.
Signed-off-by Hans de Goede <[email protected]>
Thank you. I applied all three patches from the set.
Note that it may be better to move the static control presets to the BootSequence, so the user can eventually fine tune them.
Jaroslav
Signature · 2 lines
Jaroslav Kysela <[email protected]> Linux Sound Maintainer; ALSA Project; Red Hat, Inc.