Skip to content
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

ucm2: sof-soundwire - add support for new main capture switch and main capture volume control #67

Closed
wants to merge 1 commit into from

Conversation

GoPerry
Copy link

@GoPerry GoPerry commented Dec 15, 2020

This patch was added for its new main capture switch and main capture
volume control which combine the ADC 07 / ADC 27 Capture and Volume
switch ,the new mute switch and volume control will be handled by codec
rt715`s driver mute/volume kcontrol instead of PGA5.

BugLink: thesofproject/linux#2544
Signed-off-by: Perry Yuan perry_yuan@dell.com

@perexg
Copy link
Member

perexg commented Dec 15, 2020

@GoPerry
Copy link
Author

GoPerry commented Dec 16, 2020

perry@perry-$ amixer controls
numid=33,iface=CARD,name='HDMI/DP,pcm=5 Jack'
numid=39,iface=CARD,name='HDMI/DP,pcm=6 Jack'
numid=45,iface=CARD,name='HDMI/DP,pcm=7 Jack'
numid=30,iface=CARD,name='Headphone Jack'
numid=31,iface=CARD,name='Headset Mic Jack'
numid=28,iface=MIXER,name='Headphone Switch'
numid=34,iface=MIXER,name='IEC958 Playback Con Mask'
numid=40,iface=MIXER,name='IEC958 Playback Con Mask',index=1
numid=46,iface=MIXER,name='IEC958 Playback Con Mask',index=2
numid=35,iface=MIXER,name='IEC958 Playback Pro Mask'
numid=41,iface=MIXER,name='IEC958 Playback Pro Mask',index=1
numid=47,iface=MIXER,name='IEC958 Playback Pro Mask',index=2
numid=36,iface=MIXER,name='IEC958 Playback Default'
numid=42,iface=MIXER,name='IEC958 Playback Default',index=1
numid=48,iface=MIXER,name='IEC958 Playback Default',index=2
numid=37,iface=MIXER,name='IEC958 Playback Switch'
numid=43,iface=MIXER,name='IEC958 Playback Switch',index=1
numid=49,iface=MIXER,name='IEC958 Playback Switch',index=2
numid=62,iface=MIXER,name='EQIIR5.0 eqiir_coef_5'
numid=29,iface=MIXER,name='Headset Mic Switch'
numid=56,iface=MIXER,name='PGA1.0 1 Master Playback Volume'
numid=58,iface=MIXER,name='PGA2.0 2 Master Capture Switch'
numid=57,iface=MIXER,name='PGA2.0 2 Master Capture Volume'
numid=59,iface=MIXER,name='PGA3.0 3 Master Playback Volume'
numid=61,iface=MIXER,name='PGA5.0 5 Master Capture Switch'
numid=60,iface=MIXER,name='PGA5.0 5 Master Capture Volume'
numid=63,iface=MIXER,name='PGA6.0 6 Master Playback Volume'
numid=64,iface=MIXER,name='PGA7.0 7 Master Playback Volume'
numid=65,iface=MIXER,name='PGA8.0 8 Master Playback Volume'
numid=32,iface=MIXER,name='Speaker Switch'
numid=66,iface=MIXER,name='rt1308-1 DAC L Switch'
numid=67,iface=MIXER,name='rt1308-1 DAC R Switch'
numid=9,iface=MIXER,name='rt1308-1 RX Channel Select'
numid=2,iface=MIXER,name='rt711 ADC 08 Capture Switch'
numid=4,iface=MIXER,name='rt711 ADC 08 Capture Volume'
numid=3,iface=MIXER,name='rt711 ADC 09 Capture Switch'
numid=5,iface=MIXER,name='rt711 ADC 09 Capture Volume'
numid=54,iface=MIXER,name='rt711 ADC 22 Mux'
numid=55,iface=MIXER,name='rt711 ADC 23 Mux'
numid=6,iface=MIXER,name='rt711 AMIC Volume'
numid=1,iface=MIXER,name='rt711 DAC Surr Playback Volume'
numid=7,iface=MIXER,name='rt711 DMIC1 Volume'
numid=8,iface=MIXER,name='rt711 DMIC2 Volume'
numid=10,iface=MIXER,name='rt715 ADC 07 Capture Switch'
numid=15,iface=MIXER,name='rt715 ADC 07 Capture Volume'
numid=11,iface=MIXER,name='rt715 ADC 08 Capture Switch'
numid=16,iface=MIXER,name='rt715 ADC 08 Capture Volume'
numid=12,iface=MIXER,name='rt715 ADC 09 Capture Switch'
numid=17,iface=MIXER,name='rt715 ADC 09 Capture Volume'
numid=68,iface=MIXER,name='rt715 ADC 22 Mux'
numid=69,iface=MIXER,name='rt715 ADC 23 Mux'
numid=70,iface=MIXER,name='rt715 ADC 24 Mux'
numid=71,iface=MIXER,name='rt715 ADC 25 Mux'
numid=13,iface=MIXER,name='rt715 ADC 27 Capture Switch'
numid=18,iface=MIXER,name='rt715 ADC 27 Capture Volume'
numid=20,iface=MIXER,name='rt715 DMIC1 Boost'
numid=21,iface=MIXER,name='rt715 DMIC2 Boost'
numid=22,iface=MIXER,name='rt715 DMIC3 Boost'
numid=23,iface=MIXER,name='rt715 DMIC4 Boost'
numid=26,iface=MIXER,name='rt715 LINE1 Boost'
numid=27,iface=MIXER,name='rt715 LINE2 Boost'
numid=24,iface=MIXER,name='rt715 MIC1 Boost'
numid=25,iface=MIXER,name='rt715 MIC2 Boost'
numid=14,iface=MIXER,name='rt715 Main Capture Switch'
numid=19,iface=MIXER,name='rt715 Main Capture Volume'

@@ -4,17 +4,17 @@ SectionDevice."Mic" {
Comment "SoundWire microphones"

EnableSequence [
cset "name='PGA5.0 5 Master Capture Switch' 1"
cset "name='rt715 Main Capture Switch' 1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @perexg said, the patch is still in discussion. And if ALSA finally accepts the kernel patch, I suggested using 'If'. This can help not block the previous projects.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed!
I will update this PR with condition judgment to avoid impacting old platforms.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @perexg said, the patch is still in discussion. And if ALSA finally accepts the kernel patch, I suggested using 'If'. This can help not block the previous projects.

Hi @libinyang
I update PR with if judgment added.
It is not tested yet and need to be optimized.
Please help to take a look if the judgement framework is good to go.

…n capture volume control

This patch was added for its new main capture switch and main capture
volume control which combine the ADC 07 / ADC 27 Capture and Volume
switch ,the new mute switch and volume control will be handled by codec
rt715`s driver mute/volume kcontrol instead of PGA5.

BugLink: thesofproject/linux#2544
Signed-off-by: Perry Yuan <perry_yuan@dell.com>
If.driver {
Condition {
Type String
Empty "${var:MicMute}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoPerry The rt715 patch is merged https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/commit/?h=for-5.13&id=dcca646c4977d885af3466b454df97b9cb0e0d26

However, from the patch, 'rt715 Main Capture' is not related to the "class/leds/privacy::micmute". This means even without "class/leds/privacy::micmute", 'rt715 Main Capture' still can be used. Or even with "class/leds/privacy::micmute", 'rt715 Main Capture' may not be supported. It is better to test 'rt715 Main Capture' itself, such as "ControlExists". Please refer: https://github.com/alsa-project/alsa-ucm-conf/blob/master/ucm2/sof-hda-dsp/sof-hda-dsp.conf

@perexg perexg closed this in 8eed672 May 18, 2021
perexg added a commit that referenced this pull request May 18, 2021
Fixes: #67
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
perexg added a commit that referenced this pull request May 18, 2021
Fixes: #67
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
@perexg
Copy link
Member

perexg commented May 18, 2021

I tried to fix the issues in the above commits. If you find any problem, please, report it.

8eed672
f994991
dac1c49
2f27f7b

perexg added a commit that referenced this pull request May 18, 2021
Fixes: #67
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants