thesofproject / linux

Linux kernel source tree
Other
91 stars 131 forks source link

Dell Latitude machine audio can't work -> Internal Mic Recording volume is low #2544

Closed KaiChuan-Hsieh closed 3 years ago

KaiChuan-Hsieh commented 4 years ago

I am checking the audio function with the latest sof-dev kernel which is based on 5.10-rc1. It seems the codec can't probe successfully.

Oct 30 04:04:17 ANDW-DVT1-C1 kernel: soundwire sdw:3:25d:714:1: Probe not complete, timed out Oct 30 04:04:17 ANDW-DVT1-C1 kernel: soundwire sdw-master-3: Update Slave status failed:-110 Oct 30 04:04:17 ANDW-DVT1-C1 kernel: soundwire sdw:2:25d:1316:1: Probe not complete, timed out Oct 30 04:04:17 ANDW-DVT1-C1 kernel: soundwire sdw-master-2: Update Slave status failed:-110 Oct 30 04:04:17 ANDW-DVT1-C1 kernel: soundwire sdw:0:25d:711:1: Probe not complete, timed out Oct 30 04:04:17 ANDW-DVT1-C1 kernel: soundwire sdw-master-0: Update Slave status failed:-110 Oct 30 04:04:17 ANDW-DVT1-C1 kernel: soundwire sdw:1:25d:1316:1: Probe not complete, timed out Oct 30 04:04:17 ANDW-DVT1-C1 kernel: soundwire sdw-master-1: Update Slave status failed:-110

Some info about the hardware: ACPI device info:

_SB.PC00.HDAS.SNDW.SWD0 0x000030025d071101 _SB.PC00.HDAS.SNDW.SWD1 0x000131025d131601 _SB.PC00.HDAS.SNDW.SWD2 0x000230025d131601 _SB.PC00.HDAS.SNDW.SWD3 0x000330025d071401

Audio device info: 00:1f.3 Multimedia audio controller [0401]: Intel Corporation Device [8086:a0c8] (rev 20) Subsystem: Dell Device [1028:0a32] Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+ Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- SERR- <PERR- INTx- Latency: 64 Interrupt: pin A routed to IRQ 176 Region 0: Memory at 603e1d8000 (64-bit, non-prefetchable) [size=16K] Region 4: Memory at 603e000000 (64-bit, non-prefetchable) [size=1M] Capabilities: Kernel driver in use: sof-audio-pci Kernel modules: snd_hda_intel, snd_sof_pci 00: 86 80 c8 a0 06 04 10 00 20 00 01 04 00 40 00 00 10: 04 80 1d 3e 60 00 00 00 00 00 00 00 00 00 00 00 20: 04 00 00 3e 60 00 00 00 00 00 00 00 28 10 32 0a 30: 00 00 00 00 50 00 00 00 00 00 00 00 ff 01 00 00

The full kernel log, sof-dev-kernel.log

plbossart commented 4 years ago

@KaiChuan-Hsieh did you change the Kconfig to enable those codecs? You need

CONFIG_SND_SOC_RT711_SDCA_SDW=m CONFIG_SND_SOC_RT1316_SDW=m CONFIG_SND_SOC_RT715_SDCA_SDW=m

KaiChuan-Hsieh commented 4 years ago

@plbossart

Thanks for your reply, indeed, the config is not enabled. After enable the config, found this error. Oct 31 00:46:36 ANDW-DVT1-C1 kernel: sof-audio-pci 0000:00:1f.3: ASoC: Parent card not yet available, widget card binding deferred Oct 31 00:46:36 ANDW-DVT1-C1 kernel: sof_sdw sof_sdw: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 3 Oct 31 00:46:36 ANDW-DVT1-C1 kernel: sof_sdw sof_sdw: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 4 Oct 31 00:46:36 ANDW-DVT1-C1 kernel: sof_sdw sof_sdw: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 5 Oct 31 00:46:36 ANDW-DVT1-C1 kernel: sof_sdw sof_sdw: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 6 Oct 31 00:46:36 ANDW-DVT1-C1 kernel: sof_sdw sof_sdw: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 7 Oct 31 00:46:36 ANDW-DVT1-C1 kernel: sof_sdw sof_sdw: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 8

Do you have other clue what might be wrong?

Here is the full log sof-dev-HDMI-converter.logOct 31 00:46:36

KaiChuan-Hsieh commented 4 years ago

When I try to run BootSequence by "alsaucm set _boot """, I get the error.

ALSA lib utils.c:335:(uc_mgr_config_load) could not open configuration file /usr/share/alsa/ucm2//sof-soundwire/rt1316-4.conf ALSA lib parser.c:95:(uc_mgr_config_load_file) error: failed to open file /usr/share/alsa/ucm2//sof-soundwire/rt1316-4.conf : -2 ALSA lib main.c:983:(snd_use_case_mgr_open) error: failed to import hw:0 use case configuration -2 alsaucm: error failed to open sound card hw:0: No such file or directory

it seems the initial config file doesn't exist in /usr/share/alsa/ucm2, should I open a bug to alsa-ucm-config repo?

libinyang commented 4 years ago

@KaiChuan-Hsieh Please try the ucm: https://github.com/thesofproject/alsa-ucm-conf/pull/45

KaiChuan-Hsieh commented 4 years ago

Hello, After applying config thesofproject/alsa-ucm-conf#45, here is the test result

  1. internal speaker/mic works ok
  2. headset input/output works ok
  3. HDMI output works ok

But the internal mic volume is a bit low even tough I enlarge the volume.

Thanks,

plbossart commented 4 years ago

Thanks @KaiChuan-Hsieh for testing. The mic settings were provided by @jack-cy-yu I don't know if they can be tweaked?

jack-cy-yu commented 4 years ago

@KaiChuan-Hsieh What mic volume values do you use to record? If "values=47,47" which means 0dB, the max values would be "values=127,127", 0.375dB for each volume step. You can enlarge these two 'rt714 FU02 1_2 Capture Volume'/ 'rt714 FU02 3_4 Capture Volume'and try recording again. Thanks.

KaiChuan-Hsieh commented 4 years ago

@jack-cy-yu Thanks for your reply, indeed, you are correct, I found no matter how I adjust capture volume from gnome-volume-control, it only impacts numid=75,iface=MIXER,name='PGA5.0 5 Master Capture Volume' ; type=INTEGER,access=rw---R--,values=2,min=0,max=80,step=0 : values=51,51 | dBscale-min=-50.00dB,step=1.00dB,mute=1

The amixer interface 'rt714 FU02 1_2 Capture Volume' and 'rt714 FU02 3_4 Capture Volume' are always 48. u@ANDW-DVT1-C1:~$ amixer cget numid=30 numid=30,iface=MIXER,name='rt714 FU02 1_2 Capture Volume' ; type=INTEGER,access=rw---R--,values=2,min=0,max=127,step=0 : values=48,48 | dBscale-min=-176.25dB,step=3.75dB,mute=0

u@ANDW-DVT1-C1:~$ amixer cget numid=31 numid=31,iface=MIXER,name='rt714 FU02 3_4 Capture Volume' ; type=INTEGER,access=rw---R--,values=2,min=0,max=127,step=0 : values=48,48 | dBscale-min=-176.25dB,step=3.75dB,mute=0

Do you know if this is bug of gnome-volume-control or there should be a way for ucm config to make the Master Capture Volume impacts the interface 'rt714 FU02 1_2 Capture Volume' and 'rt714 FU02 3_4 Capture Volume'?

jack-cy-yu commented 4 years ago

@KaiChuan-Hsieh I don't know if there is bug of gnome-volume-control, but I think 'PGA5.0 5 Master Capture Volume' should be configurable somewhere in ucm. Maybe @plbossart can help you ?

plbossart commented 4 years ago

@KaiChuan-Hsieh this is a bug in the UCM config, we use SOF controls for RT715 volume which makes no sense.

see https://github.com/thesofproject/alsa-ucm-conf/pull/45/commits/194d1d6cd7cca53ad7059c1f499be87b1e2cdc70#diff-85cf5691dfed75e5476a36428fbef53064667af2e8f612868333e0c85c7a7b5bR18

I think Capture Switch and Capture Volume should point to an RT715-sdca control, not use the SOF firmware controls. that's also true for the regular RT715, That's not good either: https://github.com/thesofproject/alsa-ucm-conf/blob/master/ucm2/sof-soundwire/rt715.conf#L17

@jack-cy-yu can you suggest controls for mute and hardware volume for the two versions of RT715? Thanks!

jack-cy-yu commented 3 years ago

@KaiChuan-Hsieh Regarding to sdca version of RT715, rt714 FU02 1_2 Capture Switch/ rt714 FU02 3_4 Capture Switch for mute/unmute, rt714 FU02 1_2 Capture Volume/ rt714 FU02 3_4 Capture Volume for volume control. As for non-sdca version of RT715, ADC 07 Capture Switch/ ADC 27 Capture Switch for mute/ unmute, and ADC 07 Capture Volume/ ADC 27 Capture Volume for volume control.

plbossart commented 3 years ago

@KaiChuan-Hsieh Regarding to sdca version of RT715, rt714 FU02 1_2 Capture Switch/ rt714 FU02 3_4 Capture Switch for mute/unmute, rt714 FU02 1_2 Capture Volume/ rt714 FU02 3_4 Capture Volume for volume control. As for non-sdca version of RT715, ADC 07 Capture Switch/ ADC 27 Capture Switch for mute/ unmute, and ADC 07 Capture Volume/ ADC 27 Capture Volume for volume control.

Sorry, not getting the picture @jack-cy-yu. Are you saying there are two mute controls, one per microphone pair?

@juimonen @libinyang in the UCM syntax, is it ok to have multiple CaptureSwitch and CaptureVolume definitions?

libinyang commented 3 years ago

@plbossart It seems UCM doesn't support the usage of multiple CaptureSwitch and CaptureVolume. In the get_value() in alsa-lib, it will only get one value.

I think we can put the rt715 settings in the codecs/rt715/init.conf and use the machine related setting like "PGA xxx" in sof-soundwire folder. What do you think?

@jack-cy-yu We use "PGA xxx" to control the volume in "sound-setting" because we found not all the codecs has the volume control and switch control. But we can make sure "PGA xxx" will always exist. So to make all the platform to be aligned, we use "PGA xxx" as the volume/switch control.

plbossart commented 3 years ago

@libinyang there's a separate thread on this, we do want to have a single CaptureSwitch/CaptureVolume but have them exposed by the codec. We do not want to continue with the PGA use, it's a dead-end.

libinyang commented 3 years ago

@libinyang there's a separate thread on this, we do want to have a single CaptureSwitch/CaptureVolume but have them exposed by the codec. We do not want to continue with the PGA use, it's a dead-end.

@plbossart Excuse me continue replying in this thread as I didn't find the separate thread in thesofproject/linux. I only have one concern if we use the codec controls: What if the codec driver doesn't have a proper CaptureSwitch/CaptureVolume control? As you know there are so many codecs, and it's hard to require the codec venders to expose the controls for every codec.

mengdonglin commented 3 years ago

Realtek merged multiple mute/volume operation into single mute/volume operation in RT715 codec driver to fit sdca topology. https://github.com/thesofproject/linux/pull/2558

GoPerry commented 3 years ago

@KaiChuan-Hsieh Regarding to sdca version of RT715, rt714 FU02 1_2 Capture Switch/ rt714 FU02 3_4 Capture Switch for mute/unmute, rt714 FU02 1_2 Capture Volume/ rt714 FU02 3_4 Capture Volume for volume control. As for non-sdca version of RT715, ADC 07 Capture Switch/ ADC 27 Capture Switch for mute/ unmute, and ADC 07 Capture Volume/ ADC 27 Capture Volume for volume control.

From the patch #2588 the Capture Switch for local mic mute/unmute is "FU02 Capture Switch" ,right ? I am working on one Dell privacy driver need to be based on the new sdca driver of rt715.

static const struct snd_kcontrol_new rt715_sdca_snd_controls[] = { / Capture switch / SOC_DOUBLE_R("FU0A Capture Switch", SDW_SDCA_CTL(FUN_MIC_ARRAY, RT715_SDCA_FU_ADC7_27_VOL, RT715_SDCA_FU_MUTE_CTRL, CH_01), SDW_SDCA_CTL(FUN_MIC_ARRAY, RT715_SDCA_FU_ADC7_27_VOL, RT715_SDCA_FU_MUTE_CTRL, CH_02), 0, 1, 1), RT715_SDCA_FU_CTRL("FU02 Capture Switch", SDW_SDCA_CTL(FUN_MIC_ARRAY, RT715_SDCA_FU_ADC8_9_VOL, RT715_SDCA_FU_MUTE_CTRL, CH_01), SDW_SDCA_CTL(FUN_MIC_ARRAY, RT715_SDCA_FU_ADC8_9_VOL, RT715_SDCA_FU_MUTE_CTRL, CH_02), 0, 1, 1), RT715_SDCA_FU_CTRL("FU06 Capture Switch", SDW_SDCA_CTL(FUN_MIC_ARRAY, RT715_SDCA_FU_ADC10_11_VOL, RT715_SDCA_FU_MUTE_CTRL, CH_01), SDW_SDCA_CTL(FUN_MIC_ARRAY, RT715_SDCA_FU_ADC10_11_VOL, RT715_SDCA_FU_MUTE_CTRL, CH_02), 0, 1, 1),

jack-cy-yu commented 3 years ago

@GoPerry Yes, local mute/unmute switch is "FU02 Capture Switch".

GoPerry commented 3 years ago

@GoPerry Yes, local mute/unmute switch is "FU02 Capture Switch".

Hi Jack. Thanks for your confirm. I add some debug log in the non-rt715 codec driver rt715_set_amp_gain_get of rt715.c

I am a little confused for "the ADC 07 Capture Switch/ ADC 27 Capture Switch for mute/ unmute"

When system muted.

amixer cget numid=13,iface=MIXER,name='rt715 ADC 27 Capture Switch'

numid=13,iface=MIXER,name='rt715 ADC 27 Capture Switch' ; type=BOOLEAN,access=rw------,values=2 : values=on,on

jack-cy-yu commented 3 years ago

@GoPerry I am a bit confused about your question, why you want to set both ADC 07 ADC27 Capture Switch at the same time? In SDCA topology, there is a single capture switch "FU02 Capture Switch" to handle mute/unmute operation, but rt715.c is not for SDCA topology and from my understanding, ADC 07 /27 can be muted seperately which doesn't need to be in single operation.

plbossart commented 3 years ago

@jack-cy-yu I think the intent is to deal with mic mute in the same way for TGL-non-SDCA and TGL-SDCA hardware. So if we want to use the UCM CaptureSwitch and CaptureVolume capabilities then we also need a single mixer for mute and volume for rt715

@GoPerry did I get your concern right?

jack-cy-yu commented 3 years ago

@plbossart Should I combine ADC 07/ 08/ 09/ 27 Capture Switch into single control, or I just create another new main capture switch for mute/ unmute ADC 07/ 08/ 09/ 27 Capture Switch? (ADC 07/ 08/ 09/ 27 Capture Volume as well)

plbossart commented 3 years ago

Tricky question @jack-cy-yu

If we remove existing controls, we take the risk of having PulseAudio complain and no longer work if older UCMs are used with a newer kernel.

But if we add a new 'Master Capture Switch' and the corresponding Volume, we also take the risk of having inconsistencies between controls. I think this option is probably better but we need to be careful not to add more confusion :-)

GoPerry commented 3 years ago

@GoPerry I am a bit confused about your question, why you want to set both ADC 07 ADC27 Capture Switch at the same time? In SDCA topology, there is a single capture switch "FU02 Capture Switch" to handle mute/unmute operation, but rt715.c is not for SDCA topology and from my understanding, ADC 07 /27 can be muted seperately which doesn't need to be in single operation.

Hi Jack. Thanks for your reply. My testing platform is based on TGL system. I want to control the Mic Mute Leds state with the Local mic switching, when the local mic muted, the rt715 codec driver will help to send a event to BIOS/EC to notify the state change. It is required by Dell hardware design to send that event through some acpi interface. To notify the mic mute state change to EC, i need to add some codes to the Master capture switch callback.

`EnableSequence [ cset "name='PGA5.0 5 Master Capture Switch' 1" ]

DisableSequence [
    cset "name='PGA5.0 5 Master Capture Switch' 0"
]`

https://github.com/alsa-project/alsa-ucm-conf/blob/master/ucm2/sof-soundwire/rt715.conf

/* Capture switch */
SOC_DOUBLE_R_EXT("ADC 07 Capture Switch", RT715_SET_GAIN_MIC_ADC_H,
        RT715_SET_GAIN_MIC_ADC_L, RT715_DIR_IN_SFT, 1, 1,
        rt715_set_amp_gain_get, rt715_set_amp_gain_put),
SOC_DOUBLE_R_EXT("ADC 08 Capture Switch", RT715_SET_GAIN_LINE_ADC_H,
        RT715_SET_GAIN_LINE_ADC_L, RT715_DIR_IN_SFT, 1, 1,
        rt715_set_amp_gain_get, rt715_set_amp_gain_put),
SOC_DOUBLE_R_EXT("ADC 09 Capture Switch", RT715_SET_GAIN_MIX_ADC_H,
        RT715_SET_GAIN_MIX_ADC_L, RT715_DIR_IN_SFT, 1, 1,
        rt715_set_amp_gain_get, rt715_set_amp_gain_put),
SOC_DOUBLE_R_EXT("ADC 27 Capture Switch", RT715_SET_GAIN_MIX_ADC2_H,
        RT715_SET_GAIN_MIX_ADC2_L, RT715_DIR_IN_SFT, 1, 1,
        rt715_set_amp_gain_get, rt715_set_amp_gain_put),

As the comment https://github.com/thesofproject/linux/issues/2544#issuecomment-721486874" Regarding to sdca version of RT715, rt714 FU02 1_2 Capture Switch/ rt714 FU02 3_4 Capture Switch for mute/unmute, rt714 FU02 1_2 Capture Volume/ rt714 FU02 3_4 Capture Volume for volume control. As for non-sdca version of RT715, ADC 07 Capture Switch/ ADC 27 Capture Switch for mute/ unmute, and ADC 07 Capture Volume/ ADC 27 Capture Volume for volume control."

When the "PGA5.0 5 Master Capture Switch' 0", "ADC 07 Capture Switch" will be called ,right ? But you said that "ADC 27 Capture Switch are also used for mute/ unmute", < -- confused why there are two capture switch, which mute switch i should use to track the local mic mute state? Is it used for dual mic as different Mic has itself ADC value control ?

GoPerry commented 3 years ago

@jack-cy-yu I think the intent is to deal with mic mute in the same way for TGL-non-SDCA and TGL-SDCA hardware. So if we want to use the UCM CaptureSwitch and CaptureVolume capabilities then we also need a single mixer for mute and volume for rt715

@GoPerry did I get your concern right?

Hi @plbossart That is correct! I add some debug log to the rt715_set_amp_gain_get/rt715_set_amp_gain_put, when I press the Mic Mute hotkey,Fn+F4, the local mic is muted,but there is no log output from rt715_set_amp_gain_get/rt715_set_amp_gain_put.

Will any kcontrol callback will be called when i switch the mute state ? PGA5.0 5 Master Capture Switch

I am completely baffled by this problem, i ever create a new one kcontrol ,It indeed worked for me. But if i need to leverage the Master capture switch, the switch control should be called each time when mute state changed. After i did some debug, I still cannot verify when and how to know the mute state change. Could you help to give me some advices for this ? https://patchwork.kernel.org/project/alsa-devel/patch/20201103125859.8759-1-Perry_Yuan@Dell.com/

Perry.

mengdonglin commented 3 years ago

@libinyang Here is Realtek's patch for ASoC: rt715: add main capture switch and main capture volume control (https://github.com/thesofproject/linux/pull/2615), not merged yet.

libinyang commented 3 years ago

@GoPerry

I add some debug log to the rt715_set_amp_gain_get/rt715_set_amp_gain_put, when I press the Mic Mute hotkey,Fn+F4, the local mic is muted,but there is no log output from rt715_set_amp_gain_get/rt715_set_amp_gain_put.

Will any kcontrol callback will be called when i switch the mute state ? PGA5.0 5 Master Capture Switch

Currently we are using PGA5 to control the mute/volume. This means when you press hotkey to mute MIC, it won't trigger rt715's codec, instead, it will trigger PGA5 mute and PGA5 mute code will be called.

I am completely baffled by this problem, i ever create a new one kcontrol ,It indeed worked for me. But if i need to leverage the Master capture switch, the switch control should be called each time when mute state changed. After i did some debug, I still cannot verify when and how to know the mute state change. Could you help to give me some advices for this ? https://patchwork.kernel.org/project/alsa-devel/patch/20201103125859.8759-1-Perry_Yuan@Dell.com/

As @mengdonglin mentioned, the https://github.com/thesofproject/linux/pull/2615 is submitted. After this patch is merged, we can change the UCM as Pierre mentioned in https://github.com/thesofproject/linux/pull/2615#issuecomment-742683417. With this change, when you press hotkey, "Main Capture" will be used.

mengdonglin commented 3 years ago

@libinyang Thank you! PR #2615 has been merged by sof-dev kernel. And your UCM update [rt715: init: setup ADC07 to a proper volume] https://github.com/alsa-project/alsa-ucm-conf/pull/65/ has been merged by upstream 👍

keyonjie commented 3 years ago

Libin will submit SDCA UCM files to upstream once it is finalized (need #2615 merged in upstream).

plbossart commented 3 years ago

@keyonjie there's no relationship between #2615 and SCDA. For SDCA we use a well-defined FU (Feature Unit). The problem is with non-SDCA RT715, for which we do need #2615, which Jaroslav objected to.

To be clear, we have zero dependencies for SDCA devices, we can fix the UCM file without any kernel change

keyonjie commented 3 years ago

Thanks for clarification @plbossart , I have 0 knowledge about SDW and SDCA.

So we need to wait for the acceptance of #2615 and then upstream the UCM file, before we can close this issue here, right?

libinyang commented 3 years ago

Libin will submit SDCA UCM files to upstream once it is finalized (need #2615 merged in upstream).

@keyonjie #2615 is not for SDCA codec. I didn't submit the SDCA UCM patches because I'm waiting @GoPerry 's answer whether we will have similar change in SDCA driver. @GoPerry Could you confirm?

GoPerry commented 3 years ago

Libin will submit SDCA UCM files to upstream once it is finalized (need #2615 merged in upstream).

@keyonjie #2615 is not for SDCA codec. I didn't submit the SDCA UCM patches because I'm waiting @GoPerry 's answer whether we will have similar change in SDCA driver. @GoPerry Could you confirm?

Hi @libinyang The rt715 sdca driver use "FU02 Capture Switch" for local mic mute/unmute operation. I have the same micmute led code for sdca and non sdca rt715 driver.

' RT715_SDCA_FU_CTRL("FU02 Capture Switch", SDW_SDCA_CTL(FUN_MIC_ARRAY, RT715_SDCA_FU_ADC8_9_VOL, RT715_SDCA_FU_MUTE_CTRL, CH_01), SDW_SDCA_CTL(FUN_MIC_ARRAY, RT715_SDCA_FU_ADC8_9_VOL, RT715_SDCA_FU_MUTE_CTRL, CH_02), 0, 1, 1), '

UCM for rt715 sdca ,I guess we can duplicate like this.

' SectionDevice."Mic" { Comment "SoundWire microphones"

    EnableSequence [
            cset "name='rt715 FU02 Capture Switch' 1"
    ]                                     

    DisableSequence [
            cset "name='rt715 FU02 Capture Switch' 0"
    ]                                     

    Value {                       
          CapturePriority 100     
          CapturePCM "hw:${CardId},4"
          CaptureSwitch "rt715 FU02 Capture Switch"
          CaptureVolume "rt715 FU02 Capture Volume"
    }                                      

} '

libinyang commented 3 years ago

Libin will submit SDCA UCM files to upstream once it is finalized (need #2615 merged in upstream).

@keyonjie #2615 is not for SDCA codec. I didn't submit the SDCA UCM patches because I'm waiting @GoPerry 's answer whether we will have similar change in SDCA driver. @GoPerry Could you confirm?

Hi @libinyang The rt715 sdca driver use "FU02 Capture Switch" for local mic mute/unmute operation. I have the same micmute led code for sdca and non sdca rt715 driver.

' RT715_SDCA_FU_CTRL("FU02 Capture Switch", SDW_SDCA_CTL(FUN_MIC_ARRAY, RT715_SDCA_FU_ADC8_9_VOL, RT715_SDCA_FU_MUTE_CTRL, CH_01), SDW_SDCA_CTL(FUN_MIC_ARRAY, RT715_SDCA_FU_ADC8_9_VOL, RT715_SDCA_FU_MUTE_CTRL, CH_02), 0, 1, 1), '

UCM for rt715 sdca ,I guess we can duplicate like this.

' SectionDevice."Mic" { Comment "SoundWire microphones"

    EnableSequence [
            cset "name='rt715 FU02 Capture Switch' 1"
    ]                                     

    DisableSequence [
            cset "name='rt715 FU02 Capture Switch' 0"
    ]                                     

    Value {                       
          CapturePriority 100     
          CapturePCM "hw:${CardId},4"
          CaptureSwitch "rt715 FU02 Capture Switch"
          CaptureVolume "rt715 FU02 Capture Volume"
    }                                      

} '

@GoPerry On my platform, it shows "RT714 FU02 Capture Switch/Volume". Have we updated the sdca codec driver?

mengdonglin commented 3 years ago

Ongoing upstream discussion about 'ASoC: rt715: add main capture switch and main capture volume control' https://mailman.alsa-project.org/pipermail/alsa-devel/2020-December/178306.html

mengdonglin commented 3 years ago

Upstreaming of UCM for TGL-U device with SDCA codecs is in progress: https://github.com/alsa-project/alsa-ucm-conf/pull/71 by @libinyang

libinyang commented 3 years ago

Jaroslav doesn't like our current codec driver solution. After discussing with Realtek, they will update the codec driver and I will update the UCM correspondingly.

KaiChuan-Hsieh commented 3 years ago

@jack-cy-yu

Hello,

May I know if https://github.com/jack-cy-yu/linux/commit/6759435102afabae65cb1d5d43eeee3ec98f2b73 is ready? I'd like to validate https://github.com/alsa-project/alsa-ucm-conf/pull/71#issuecomment-797325185, it seems it has dependency of your change.

Thanks,

jack-cy-yu commented 3 years ago

@KaiChuan-Hsieh The patch has been submitted to upstream for review, please refer

https://patchwork.kernel.org/project/alsa-devel/patch/a35835bae45f4f468dab8ad0df5ece10@realtek.com/

bardliao commented 3 years ago

@KaiChuan-Hsieh Is this issue solved? Can we close this issue?

KaiChuan-Hsieh commented 3 years ago

@bardliao yes, the issue is solved. Thanks for all of you kindly support.