How to ajust audio mic gain used codec rt5640

How to ajust audio mic gain used codec rt5640?
scala@localhost:~$ cat /proc/asound/cards
0 [tegrahda ]: tegra-hda - tegra-hda
tegra-hda at 0x70038000 irq 82
1 [tegrasndt210ref]: tegra-snd-t210r - tegra-snd-t210ref-mobile-rt565x

scala@localhost:~$ amixer controls
numid=1,iface=CARD,name=‘HDMI/DP,pcm=3 Jack’
numid=12,iface=MIXER,name=‘Playback Volume’
numid=8,iface=MIXER,name=‘d HDA Comfort Noise’
numid=6,iface=MIXER,name=‘d HDA Decode Capability’
numid=7,iface=MIXER,name=‘d HDA Maximum PCM Channels’
numid=2,iface=MIXER,name=‘d IEC958 Playback Con Mask’
numid=4,iface=MIXER,name=‘d IEC958 Playback Default’
numid=3,iface=MIXER,name=‘d IEC958 Playback Pro Mask’
numid=5,iface=MIXER,name=‘d IEC958 Playback Switch’
numid=10,iface=MIXER,name=‘d HDA Custom ELD’,device=2
numid=11,iface=PCM,name=‘Playback Channel Map’,device=3
numid=9,iface=PCM,name=‘d ELD’,device=3

Can you please dump all available mixer controls for card 1?

amixer -c 1 controls

What is the audio path you intend to use?
Check mixer controls specific to RT5640 codec and see if any gain controls are available.

amixer_controls.txt (36.1 KB)

we used IN1P and IN1N for MIC.
where to get mixer controls specific?

From your attached reference, following are the codec mixer controls.
numid=504,iface=MIXER,name=‘x ADC Boost Gain’
numid=501,iface=MIXER,name=‘x ADC Capture Switch’
numid=502,iface=MIXER,name=‘x ADC Capture Volume’
numid=506,iface=MIXER,name=‘x ADC IF1 Data Switch’
numid=508,iface=MIXER,name=‘x ADC IF2 Data Switch’
numid=505,iface=MIXER,name=‘x Class D SPK Ratio Control’
numid=507,iface=MIXER,name=‘x DAC IF1 Data Switch’
numid=509,iface=MIXER,name=‘x DAC IF2 Data Switch’
numid=711,iface=MIXER,name=‘x DAC L2 Mux’
numid=672,iface=MIXER,name=‘x DAC MIXL INF1 Switch’
numid=671,iface=MIXER,name=‘x DAC MIXL Stereo ADC Switch’
numid=674,iface=MIXER,name=‘x DAC MIXR INF1 Switch’
numid=673,iface=MIXER,name=‘x DAC MIXR Stereo ADC Switch’
numid=712,iface=MIXER,name=‘x DAC R2 Mux’
numid=496,iface=MIXER,name=‘x DAC1 Playback Volume’
numid=495,iface=MIXER,name=‘x DAC2 Playback Switch’
numid=669,iface=MIXER,name=‘x DAI select’
numid=681,iface=MIXER,name=‘x DIG MIXL DAC L1 Switch’
numid=682,iface=MIXER,name=‘x DIG MIXL DAC L2 Switch’
numid=683,iface=MIXER,name=‘x DIG MIXR DAC R1 Switch’
numid=684,iface=MIXER,name=‘x DIG MIXR DAC R2 Switch’
numid=490,iface=MIXER,name=‘x HP Channel Switch’
numid=709,iface=MIXER,name=‘x HP L Playback Switch’
numid=491,iface=MIXER,name=‘x HP Playback Volume’
numid=710,iface=MIXER,name=‘x HP R Playback Switch’
numid=735,iface=MIXER,name=‘x HPO MIX DAC1 Switch’
numid=734,iface=MIXER,name=‘x HPO MIX DAC2 Switch’
numid=736,iface=MIXER,name=‘x HPO MIX HPVOL Switch’
numid=500,iface=MIXER,name=‘x IN Capture Volume’
numid=497,iface=MIXER,name=‘x IN1 Boost’
numid=498,iface=MIXER,name=‘x IN2 Boost’
numid=499,iface=MIXER,name=‘x IN3 Boost’
numid=540,iface=MIXER,name=‘x Jack-state’
numid=703,iface=MIXER,name=‘x LOUT MIX DAC L1 Switch’
numid=704,iface=MIXER,name=‘x LOUT MIX DAC R1 Switch’
numid=705,iface=MIXER,name=‘x LOUT MIX OUTVOL L Switch’
numid=706,iface=MIXER,name=‘x LOUT MIX OUTVOL R Switch’
numid=503,iface=MIXER,name=‘x Mono ADC Capture Volume’
numid=658,iface=MIXER,name=‘x Mono ADC L1 Mux’
numid=657,iface=MIXER,name=‘x Mono ADC L2 Mux’
numid=665,iface=MIXER,name=‘x Mono ADC MIXL ADC1 Switch’
numid=666,iface=MIXER,name=‘x Mono ADC MIXL ADC2 Switch’
numid=667,iface=MIXER,name=‘x Mono ADC MIXR ADC1 Switch’
numid=668,iface=MIXER,name=‘x Mono ADC MIXR ADC2 Switch’
numid=659,iface=MIXER,name=‘x Mono ADC R1 Mux’
numid=660,iface=MIXER,name=‘x Mono ADC R2 Mux’
numid=675,iface=MIXER,name=‘x Mono DAC MIXL DAC L1 Switch’
numid=676,iface=MIXER,name=‘x Mono DAC MIXL DAC L2 Switch’
numid=677,iface=MIXER,name=‘x Mono DAC MIXL DAC R2 Switch’
numid=680,iface=MIXER,name=‘x Mono DAC MIXR DAC L2 Switch’
numid=678,iface=MIXER,name=‘x Mono DAC MIXR DAC R1 Switch’
numid=679,iface=MIXER,name=‘x Mono DAC MIXR DAC R2 Switch’
numid=487,iface=MIXER,name=‘x Mono DAC Playback Volume’
numid=741,iface=MIXER,name=‘x Mono MIX BST1 Switch’
numid=738,iface=MIXER,name=‘x Mono MIX DAC L2 Switch’
numid=737,iface=MIXER,name=‘x Mono MIX DAC R2 Switch’
numid=740,iface=MIXER,name=‘x Mono MIX OUTVOL L Switch’
numid=739,iface=MIXER,name=‘x Mono MIX OUTVOL R Switch’
numid=486,iface=MIXER,name=‘x Mono Playback Switch’
numid=493,iface=MIXER,name=‘x OUT Channel Switch’
numid=720,iface=MIXER,name=‘x OUT MIXL BST1 Switch’
numid=725,iface=MIXER,name=‘x OUT MIXL DAC L1 Switch’
numid=724,iface=MIXER,name=‘x OUT MIXL DAC L2 Switch’
numid=723,iface=MIXER,name=‘x OUT MIXL DAC R2 Switch’
numid=721,iface=MIXER,name=‘x OUT MIXL INL Switch’
numid=722,iface=MIXER,name=‘x OUT MIXL REC MIXL Switch’
numid=719,iface=MIXER,name=‘x OUT MIXL SPK MIXL Switch’
numid=728,iface=MIXER,name=‘x OUT MIXR BST1 Switch’
numid=727,iface=MIXER,name=‘x OUT MIXR BST2 Switch’
numid=731,iface=MIXER,name=‘x OUT MIXR DAC L2 Switch’
numid=733,iface=MIXER,name=‘x OUT MIXR DAC R1 Switch’
numid=732,iface=MIXER,name=‘x OUT MIXR DAC R2 Switch’
numid=729,iface=MIXER,name=‘x OUT MIXR INR Switch’
numid=730,iface=MIXER,name=‘x OUT MIXR REC MIXR Switch’
numid=726,iface=MIXER,name=‘x OUT MIXR SPK MIXR Switch’
numid=492,iface=MIXER,name=‘x OUT Playback Switch’
numid=494,iface=MIXER,name=‘x OUT Playback Volume’
numid=647,iface=MIXER,name=‘x RECMIXL BST1 Switch’
numid=646,iface=MIXER,name=‘x RECMIXL BST2 Switch’
numid=645,iface=MIXER,name=‘x RECMIXL BST3 Switch’
numid=643,iface=MIXER,name=‘x RECMIXL HPOL Switch’
numid=644,iface=MIXER,name=‘x RECMIXL INL Switch’
numid=648,iface=MIXER,name=‘x RECMIXL OUT MIXL Switch’
numid=653,iface=MIXER,name=‘x RECMIXR BST1 Switch’
numid=652,iface=MIXER,name=‘x RECMIXR BST2 Switch’
numid=651,iface=MIXER,name=‘x RECMIXR BST3 Switch’
numid=649,iface=MIXER,name=‘x RECMIXR HPOR Switch’
numid=650,iface=MIXER,name=‘x RECMIXR INR Switch’
numid=654,iface=MIXER,name=‘x RECMIXR OUT MIXR Switch’
numid=670,iface=MIXER,name=‘x SDI select’
numid=687,iface=MIXER,name=‘x SPK MIXL DAC L1 Switch’
numid=688,iface=MIXER,name=‘x SPK MIXL DAC L2 Switch’
numid=686,iface=MIXER,name=‘x SPK MIXL INL Switch’
numid=689,iface=MIXER,name=‘x SPK MIXL OUT MIXL Switch’
numid=685,iface=MIXER,name=‘x SPK MIXL REC MIXL Switch’
numid=692,iface=MIXER,name=‘x SPK MIXR DAC R1 Switch’
numid=693,iface=MIXER,name=‘x SPK MIXR DAC R2 Switch’
numid=691,iface=MIXER,name=‘x SPK MIXR INR Switch’
numid=694,iface=MIXER,name=‘x SPK MIXR OUT MIXR Switch’
numid=690,iface=MIXER,name=‘x SPK MIXR REC MIXR Switch’
numid=699,iface=MIXER,name=‘x SPOL MIX BST1 Switch’
numid=696,iface=MIXER,name=‘x SPOL MIX DAC L1 Switch’
numid=695,iface=MIXER,name=‘x SPOL MIX DAC R1 Switch’
numid=698,iface=MIXER,name=‘x SPOL MIX SPKVOL L Switch’
numid=697,iface=MIXER,name=‘x SPOL MIX SPKVOL R Switch’
numid=702,iface=MIXER,name=‘x SPOR MIX BST1 Switch’
numid=700,iface=MIXER,name=‘x SPOR MIX DAC R1 Switch’
numid=701,iface=MIXER,name=‘x SPOR MIX SPKVOL R Switch’
numid=488,iface=MIXER,name=‘x Speaker Channel Switch’
numid=707,iface=MIXER,name=‘x Speaker L Playback Switch’
numid=489,iface=MIXER,name=‘x Speaker Playback Volume’
numid=708,iface=MIXER,name=‘x Speaker R Playback Switch’
numid=661,iface=MIXER,name=‘x Stereo ADC MIXL ADC1 Switch’
numid=662,iface=MIXER,name=‘x Stereo ADC MIXL ADC2 Switch’
numid=663,iface=MIXER,name=‘x Stereo ADC MIXR ADC1 Switch’
numid=664,iface=MIXER,name=‘x Stereo ADC MIXR ADC2 Switch’
numid=656,iface=MIXER,name=‘x Stereo ADC1 Mux’
numid=655,iface=MIXER,name=‘x Stereo ADC2 Mux’
numid=715,iface=MIXER,name=‘x Stereo DAC MIXL ANC Switch’
numid=713,iface=MIXER,name=‘x Stereo DAC MIXL DAC L1 Switch’
numid=714,iface=MIXER,name=‘x Stereo DAC MIXL DAC L2 Switch’
numid=718,iface=MIXER,name=‘x Stereo DAC MIXR ANC Switch’
numid=716,iface=MIXER,name=‘x Stereo DAC MIXR DAC R1 Switch’
numid=717,iface=MIXER,name=‘x Stereo DAC MIXR DAC R2 Switch’

You can check if any of the following mixer controls work.

numid=504,iface=MIXER,name='x ADC Boost Gain'
numid=502,iface=MIXER,name='x ADC Capture Volume'
numid=500,iface=MIXER,name='x IN Capture Volume'
numid=497,iface=MIXER,name='x IN1 Boost'
numid=498,iface=MIXER,name='x IN2 Boost'
numid=499,iface=MIXER,name='x IN3 Boost'

For specific settings, you can check with the codec vendor (Realtek) itself.

Thank you , we had got it!

For reference, can you paste here the controls that worked for you.
It can be helpful for future reference.

we used “amixer -c 1 cget numid=502,iface=MIXER,name=‘x ADC Capture Volume’”

Thanks. Marked this as solution.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.