-
Notifications
You must be signed in to change notification settings - Fork 349
DMIC and headset MIC LED support on sof-icl-rt711-rt1308-rt715 #2358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
lgirdwood
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why you are removing the highpass filter ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@singalsu can you comment here. @libinyang why is this change needed ? it does not appear in commit message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know why this change is done but pipe-eq-capture adds an IIR high-pass with +20 dB gain and pipe-highpass-capture adds an IIR with 0 dB gain. It's possible to get the same gain by setting volume control to +20 dB with the latter topology. But since volume defaults to 0 dB and apparently we don't have a mechanism to pass a default gain from topology to driver so using the topology with gain offset is justified in some cases (e.g. need out of box Ubuntu to sound sufficiently loud). @juimonen and @libinyang are the experts to comment if some UCM setting could achieve the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lgirdwood @singalsu pipe-eq-capture.m4 creates the "DMIC Capture Switch" control.
In Pipe-eq-catpure.m4, it defines:
C_CONTROLMIXER(Master Capture Switch, PIPELINE_ID,
CONTROLMIXER_OPS(volsw, 259 binds the mixer control to switch get/put handlers, 259, 259),
CONTROLMIXER_MAX(max 1 indicates switch type control, 1),
false,
,
Channel register and shift for Front Left/Right,
LIST(` ', KCONTROL_CHANNEL(FL, 2, 0), KCONTROL_CHANNEL(FR, 2, 1)),
"1", "1")
This means the switch controller will enable MIC MUTE LED feature.
This is why we need pipe-eq-capture.m4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, so why are we adding +20dB gain ? Should this not be set my UCM. Default should always be 0dB.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@libinyang this is the wrong direction, sorry. There should be a capture switch for the rt715 that can be used. We should not overload the DMIC capture switch when we don't use the DMIC, and as a result end-up with an unnecessary 20dB boost.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lgirdwood @plbossart I was thinking that MIC is a mic like a DMIC. Thanks for the information. I add a new pipeline model: pipe-volume-switch-capture pipeline in my patch. Do you think it is OK to use this pipeline for the MIC? Or should I create a new pipeline pipe-highpass-volume-capture-capture for this MIC?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@singalsu any comments on pipeline for this use case ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My point what that we should have a 'MIC Switch" control exposed by the rt715 driver. I don't see why we would add a switch on an SOF pipeline when the capture is controlled by an external device.
It's similar to HDAudio capture, we don't have a MIC switch for SOF, so why should we just when we change from HDaudio to SoundWire?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@plbossart Yes, when I enabled this feature, I referred thinkpad laptop which uses sof HDaudio. To be honest, this confuses me. MIC MUTE LED is a machine related feature and codec should never realize this feature. I mean if we changed the codec to any other vendor's codec, the LED feature should always be there, because the led key press event is from ACPI level, not from codec level. So I prefer to implement this feature in the machine driver. And because our tplg is bound to machine tightly, I implement this feature in our tplg.
plbossart
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if this PR makes sense. The PCH-attached DMICs are not used on this platform if RT715 is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@libinyang are you aware that we don't use the PCH-attached DMICs on this platform?
All DMICs are connected to the RT715. So is this patch even relevant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@plbossart Thanks for reminder. Do you mean we should not include 'platform/intel/dmic.m4'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change does not look correct, we recently had @singalsu add a high-pass filter to remove a DC component on startup, why would we want to modify this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have already seen the discussion, the eq serves as a highpass if I understood correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@plbossart @paulstelian97 Please check my upper comments. The main purpose is we need a switch controller which enables MIC MUTE LED feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C_CONTROLMIXER(Master Capture Switch, PIPELINE_ID, CONTROLMIXER_OPS(volsw, 259 binds the mixer control to switch get/put handlers, 259, 259), CONTROLMIXER_MAX(max 1 indicates switch type control, 1), false, , Channel register and shift for Front Left/Right, LIST(` ', KCONTROL_CHANNEL(FL, 2, 0), KCONTROL_CHANNEL(FR, 2, 1)), "1", "1")This means the switch controller will enable MIC MUTE LED feature.
This is why we need pipe-eq-capture.m4
@libinyang Sorry, please allow me to ask a basic question. How do we control the MUTE LED and how does the switch enable the MIC MUTE LED feature? Is there a corresponding driver to control the LED? Can we always enable the MUTE LED feature instead of creating a switch for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bardliao There are platform drivers, for example, drivers/platform/x86/dell-xxx for dell platforms. In this platform driver, it will define how LED is controlled and how speical key is treated (To compare, most keys are treated in the keyboard driver). And there is a LED driver for audio, please refer drivers/leds/*. In audio driver, when it need change the LED state, it will call leds driver, which will call dell platform driver. So the sequence is:
key pressed -> (dell) platform/keyboard driver -> userspace -> pulseaudio set the audio mixer -> audio driver kcontrol -> led driver -> (dell) platform driver
MUTE LED is combined to the mute function. Without switch we have to another controller or driver to control the LED, which is strange and it needs more logic to sync the switch state and the LED state. As you can see, legacy hda driver also implements it in a switch control.
|
@libinyang so this PR is to add mute switch to 2 items: non-hda analog mic, and dmic? |
|
@libinyang can you also try this PR on top of: #2099 |
@juimonen Yes. one is for non-hda analog mic, the other is for dmic. But based on Pierre's comments, it is not DMIC. So I will refine the patches. |
@juimonen The #2099 is to simplify the control name define. I didn't find the decouple in that patch. |
This patch adds the capture pipeline which enables the volume and switch controls. In the switch control, it enables capture LED controlling. Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
|
patch is updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still not keen on changing the processing here. This was added for a reason, so you may be re-introducing the original problem. @singalsu any comments ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@libinyang please don't change this. We've added a high-pass filter on purpose to avoid DC-related issues.
thesofproject/linux#1480
I still don't get why you would want a mute implemented on the firmware side when it can be done on the RT711 and RT715 side, and the mute can be done in a better way on the 3rd party side (e.g. during a zero crosssing). If we implement the mute in firmware, it should be because it's impossible to do or due to some work-around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@plbossart This is implemented in firmware, not in codec, because this is not a feature in codec. It is a feature in the machine level. Actually the LED feature is non-related with the codec. Even the machine doesn't use codec RT711 and RT715, the LED feature is still there.
@plbossart @lgirdwood Sorry, I don't get the point why you don't want to use volume-switch pipeline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@plbossart @lgirdwood Sorry, I don't get the point why you don't want to use volume-switch pipeline.
@libinyang I think it is because we need the high-pass filter. Maybe you can add a new switch instead of replacing pipe-highpass-capture.m4?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When modifying this pipeline please do a capture test for 10s. There should be no strong start transients. In the SoundWire codec I recall the big "thump" happened for DMIC for the first 2-3 seconds time but please check both DMIC and headset capture.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check if PR #2414 helps. If not please inspect capture start waveform with volume-switch pipeline with every impacted capture PCM. If there are no issues seen then volume-switch usage should be OK. There's no need for high-pass IIR if the problem has been fixed somewhere else (codec driver, codec firmware).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@singalsu It seems #2414 cannot help here to fix thesofproject/linux#1816, please see test result of @Liviali155 :thesofproject/linux#1816 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mengdonglin Sorry I missed this. Is the IIR EQ still broken? I will try to test & fix it tomorrow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@singalsu Yvonne has tested both pipe-volume-capture and pipe-highpass-capture. And the result is highpass don't have the noise while pipe-volume-capture still have the noise. I will change to use highpass pipeline. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@libinyang Good that it was solved!
|
I'll make this very clear: NAK on this PR. |
This patch adds the highpass capture pipeline which enables the volume and switch controls. In the switch control, it enables capture LED controlling. Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
Add support of MIC Mute LED for capture on sof-icl-rt711-rt1308-rt715 platform. Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
@plbossart Yes, you are right. We did some test recently and did find highpass can avoid the noise on capture (while pipe-volume-capture still have noise). So I will switch to highpass. Thanks. |
|
Checked it on CML-U, much better than before, same result as master branch now. |
|
patches have been updated based on the comments. |
|
ping for review |
juimonen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so seems you now have the highpass eq in place. Can't really say too much to the discussion where the mute led should be implemented (codec/machine). I understood that this is working in Dell machine and led is blinking so LGTM.
lgirdwood
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@singalsu ok for you ?
singalsu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks good.
|
CI is showing know issues. |
|
@plbossart good for you now ? If so we can merge. |
|
SOFCI TEST |
|
ping for merge. CI shows known issues |
|
SOF CI TEST |
1 similar comment
|
SOF CI TEST |
|
@lgirdwood I checked the Internal Intel CI system/merge/build test result. It shows WHL fails. But my patches only impact on ICL platforms. Does this mean the test result failure can be ignored? I tried to check the WHL error log but I can't open it. |
|
@wwittbrx any idea on the CI issues, they seem consistent today ? |
|
confirmed with Clare. The CI issue are known issues. |
This patchset add the DMIC and headset MIC LED support on sof-icl-rt711-rt1308-rt715.