-
Notifications
You must be signed in to change notification settings - Fork 308
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
topology1: add sof-icl-rt711-rt1308-rt715-hdmi NOMIC support #5367
Conversation
@@ -77,7 +77,8 @@ ifdef(`NOJACK', `', | |||
# PCM2 ---> volume ----> ALH 2 BE dailink 2 | |||
ifdef(`MONO', `', | |||
`# PCM40 ---> volume ----> ALH 2 BE dailink 3') | |||
# PCM4 <--- volume <---- ALH 2 BE dailink 4 | |||
ifdef(`NOMIC', `', | |||
`# PCM4 <--- volume <---- ALH 2 BE dailink 4') |
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.
well, no this looks wrong. When the RT715 is not present, then we can still have a PCM4 pipeline that takes the data from ALH2 BE dailink 4
It's really not a 'NOMIC" solution, rather that the mics are handled in a different way.
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 I mean no dmic, not RT715 in this patch. On some platforms, there is no DMIC and only analog mic is used. There is no any codec connected to the BE dailink 4. I will change NOMIC to NODMIC.
BTW: And I found the comments are wrong. It should not be "ALH2 BE dailink4" but "ALH2 BE $MIC_LINK" (more precisely, it should be "ALH2 BE eval(MIC_LINK)" ).
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 still think you need to macros
NO_MIC_CODEC: tells that there is no RT715 on this skew
RT711_MIC_SUPPORT: tells that the local mics are connected to RT711.
you should really disable the mic pipeline only when the RT711_MIC_SUPPORT is not defined, otherwise the mic pipeline needs to rely on a capture port of the RT711 and the ALH,
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.
NO_MIC_CODEC: tells that there is no RT715 on this skew RT711_MIC_SUPPORT: tells that the local mics are connected to RT711.
What about use NOOBMIC (no onboard mic) instead of NODMIC? Let consider the scenarios:
- neither rt711 onboard mic nor rt715 dmic is used, this NOOBMIC will be defined.
- either rt711 onboard mic or rt715 dmic is used, NOOBMIC will not be defined. Then we don't define NOOBMIC and use MIC_LINK to define the link id just like what we do now. (If we use rt711 onboard MIC, we will still need to define PIN_ID. And we can do it when we use rt711 onboard mic)
- Both rt711 on board mic and rt715 dmic are used. This should not happen. But if it happens, we need create a new pipeline and assign a new PCM number for it. We can do it when we meet such configuration in the future.
With this assumption, the patch still can be used, the only change is NODMIC -> NOOBMIC.
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.
an acronym starting with "NOOB" doesn't sound very good in English, it's Internet slang for 'novice', 'newcomer' or 'inexperienced'. Consider a different term, such as NO_LOCAL_MICS or something.
I don't understand how you want to manage the case 2). You will need to use different branches to create the topology, and you need a variable to figure out if you are going to add the RT711 microphone path or the RT715 mic path. in existing solutions we use AMP_LINK as an integer, whereas here you need a true/false case.
The example I had in mind is the 'NO_JACK' case. We can have a similar case with NO_MIC_CODEC.
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 will use NO_LOCAL_MICS. Thanks for pointing it out.
When creating a pipeline for RT715 or RT711 local mic, we can both use:
ifdef(`NO_LOCAL_MIC', `' ,
`
# pipeline
PIPELINE_PCM_ADD(sof/pipe-highpass-switch-capture.m4,
5, 4, 2, s32le,
1000, 0, 0,
48000, 48000, 48000)
# dai
DAI_ADD(sof/pipe-dai-capture.m4,
5, ALH, eval(MIC_LINK * 256 + **PIN_ID**), `SDW'eval(MIC_LINK)`-Capture',
PIPELINE_SINK_5, 2, s24le,
1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)
# pcm
PCM_CAPTURE_ADD(Microphone, 4, PIPELINE_PCM_5)
# dai config
DAI_CONFIG(ALH, eval(MIC_LINK * 256 + **PIN_ID**), 4, `SDW'eval(MIC_LINK)`-Capture',
ALH_CONFIG(ALH_CONFIG_DATA(ALH, eval(MIC_LINK * 256 + **PIN_ID**), 48000, 2)))
'
We don't need to care whether it is a rt715 codec or rt711 codec, do we?
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 @libinyang, we don't need to know what the actual codec is in the topology file, all we see in ALH channels and PDI/port interfaces.
5b18afc
to
14ec290
Compare
# PCM0 ---> volume ----> mixer --->ALH 2 BE dailink 0 | ||
# PCM1 <--- volume <---- ALH 3 BE dailink 1 | ||
# PCM0 ---> volume ----> mixer --->ALH 2 BE $UAJ_LINK | ||
# PCM1 <--- volume <---- ALH 3 BE $UAJ_LINK |
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 the use of a $ does not do anything in m4, and I am not sure what this is trying to accomplish?
There is no other use of 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.
@plbossart '$' is in the comments line, just telling readers this is a variable. I will remove the '$' in the update patch.
@@ -77,7 +77,8 @@ ifdef(`NOJACK', `', | |||
# PCM2 ---> volume ----> ALH 2 BE $AMP_1_LINK | |||
ifdef(`MONO', `', | |||
`# PCM40 ---> volume ----> ALH 2 BE $AMP_2_LINK') | |||
# PCM4 <--- volume <---- ALH 2 BE $MIC_LINK | |||
ifdef(`NODMIC', `', |
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 thought you wanted to call this NO_LOCAL_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.
Will update it in the new patch
df5f4ff
to
3dfb6f1
Compare
Patch is updated.
|
@plbossart Please hold. I found sof-tgl-rt711-rt1308.m4 may be a better one for this scenario |
After doing the investigation. The sof-tgl-rt711-rt1308.m4 doesn't meet our scenario. I will continue using sof-icl-rt711-rt1308-rt715-hdmi. But as our driver has the rule to calculate the BE id. The Jack BE id is from 0. The AMP BE id is from 2. If there is second AMP codec, the second AMP BE id will be 3. The DMIC BE id is from 4. And the HMDI BE id is increasing dynamically. So the calculation for HDMI BE id should be:
@bardliao Could you please help confirm? |
@libinyang That would be very complicated if you want to calculate the HDMI1_BE_ID, for example, we could have more than one DMIC. Why not just specify HDMI1_BE_ID in CMakeLists.txt? We can have a default HDMI1_BE_ID if HDMI1_BE_ID is not specified. |
@bardliao Specifying the HDMI1_BE_ID is deferring the effort and we need to calculate it every time and it can be calculated wrong. I prefer to calculate it by the m4 itself. For the 2 DMICs, we can modify the code when we really meet it. It should be easy to support 2 DMICs. |
@libinyang Given that the topology is for SDW + HDMI only. We can go with your proposal. Some comments for your if condition
|
This is a good question. Actually, this file won't handle PCH DMIC platform. The SDW + PCH DMIC is handled by sof-tgl-rt711-rt1308.m4.
I actually test 'MONO'. MONO means there is a AMP or 2 AMPs. 'NO_AGGREGATION' is used when there are 2 AMPs. In the TPLG, we don't care there is one or two PCMs, but we can the BE ID. If the 2 speaker are aggregated, the second AMP should also occupies one BE ID, doesn't it?
Yes, this is a good suggestion. However my patch may still need to take care this situation, otherwise, the condition won't be gone through totally, which may cause corner issues. |
After going through the driver code with @bardliao , it is confirmed that |
3dfb6f1
to
468ac6d
Compare
PR is updated:
|
We could have a capture dai link for echo reference, so the test condition will not work
Sorry, @libinyang we could have too many possible combination conditions. For example, we will have 1 playback and 1 capture dai link for rt1316, and we didn't consider this in your test condition. I can imagine that we will have a very complicated condition if we want to cover all possible cases. So, I think just define the starting HDMI ID in CMakeLists.txt is the simplest and most scalable way to fix the issue. |
The new tplg id still doesn't meet the driver. I will check the driver BE id. |
@bardliao Define the ID in CMakefile will make the thing easy. But each tplg needs extra effort. @plbossart What's you option? |
Sorry @libinyang @bardliao, what makes you think, NO_AGGREGATION is relevant here? You have two rt1316 amplifiers on different links for this device and for all products using this configuration we use aggregation. NO_AGGREGATION was a test mode added initially, but it shall not be used by anyone. I think we want to remove it from topologies because it adds a level of complexity for no good reason. |
@plbossart Got it. Thanks. We found even with the latest code of this PR. It still doesn't work. This is because it is not sync between driver and tplg. Driver enables capture on rt1316 for smart AMP reference. But our tplg doesn't contain any information for it. I think @bardliao 's suggestion is easiest way to implement. I will take @bardliao 's advice as we need to give a solution quickly. |
I don't see the problem @libinyang. The machine driver can expose dai links that the topology does not use, we do this all the time. The problem is when the topology uses a link that is not created by the machine driver, that would prevent the card from probing. |
@plbossart The issue is that the HDMI id is fixed in sof-icl-rt711-rt1308-rt715-hdmi.m4, but it is dynamic in machine driver. It will be the last SDW ID + 1. In this case, the IDs are
@libinyang is trying to work out a general formula that can fit all cases. My opinion is that we can just specify the HDMI id on CMakeList.txt. |
we could add a quirk in the machine driver to skip the mic link as well. We've done it before. This is a very odd topology so better avoid getting migraines and use the simplest solution. I am not a big fan of using CMakeList.txt because that's yet another file that we need to track, and we can't do any math in there, while we can update counters in M4 and .conf. |
@plbossart capture is not supported by rt1308_sdw_dai[] |
@plbossart ping |
We can enable RT1308 feedback, in fact I did the work already in https://github.com/thesofproject/linux/pull/2514/commits |
@plbossart You are right. My only concern is the productions with rt1308 in the market don't support smart AMP now. And what's more, rt1308 needs 4 channels to support smart AMP. It means we need 8 channel to support 2xrt1308. The old platforms may not have so much memory to run smart AMP. So we still cannot set all the platforms to support smart AMP. We need a long term solution to support smart AMP on rt1308 and rt1316. Do you think we can use this PR's workaround for short term? |
@plbossart @libinyang @bardliao |
@plbossart Even if we enable rt1308 feedback, we still need to handle the no sdw mic case in topology. IMHO, that is a different topic. |
You're reading too much into my comment @shumingfan @bardliao @libinyang If we add the dailink in the machine driver, it does nothing. What matters is the follow-up topology change to actually enable a smart amp processing. And from that perspective, it's much better to push this change in the machine driver, so that the kernel support will be there ahead of time. It's very very hard to introduce a new feature that requires a topology/firmware change AND a kernel machine driver change. If we add a new feature in the topology and the machine driver does not create that dailink then it's a probe failure - a much worse situation. In other words, adding this capture dailink today is harmless. it's just there, it simplifies are life wrt. indices in the topology, but we don't have to deal with the smart amp integration today. |
@plbossart Do you mean we will apply the PR thesofproject/linux#2514, and in the tplg, we will always assume that rt1316/rt1308 uses 2 BE IDs? In this case, we still need determine the tplg BE ID based on the platform configuration, with or without rt715. So which version patch do you prefer, the latest version (assign HDMI BE ID in CMailefile) or https://github.com/thesofproject/sof/compare/3dfb6f1c423f6c747d73c05928211cf3f06b9b8d..468ac6d31b9f8cd5da83a8afc9e512a74a685e85 (Calculate the HDMI BE ID in m4)? |
@libinyang @bardliao here's the suggested patch to remove the 'no-aggregation' support I would recommend you check the binary topology before and after this patch to make sure we didn't break anything. |
@plbossart Thanks. I will test the tplg with the patch removing-no-aggregation. I will send out the test result next Monday. |
@plbossart The 'no-aggregation' patch need a little modification:
Otherwise, compile failed. |
@plbossart Would you submit the 'no-aggregation' patch or I can help submit it together with my PR? |
please go ahead and include this patch in your PR @libinyang, thanks |
NO_AGGREGATION is never used now. Let's remove it. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Libin Yang <libin.yang@intel.com>
The links are dynamically assigned. The descriptions should be changed correspondingly. Signed-off-by: Libin Yang <libin.yang@intel.com>
ping @plbossart |
ifdef(`NO_LOCAL_MIC', | ||
`ifdef(`NOAMP', | ||
`ifdef(`NOJACK', `define(HDMI_BE_ID_BASE, `0')', `define(HDMI_BE_ID_BASE, `2')')', | ||
`ifdef(`EXT_AMP_REF', `define(HDMI_BE_ID_BASE, `4')', `define(HDMI_BE_ID_BASE, `3')')' |
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.
that one I don't understand. Didn't we say that we would always reverse 2 links for the amplifiers, regardless of whether the reference is present or not?
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 If we always reverse 2 links for the amplifiers, we need the patch thesofproject/linux#3491 in kernel . Otherwise, the driver won't reverse 2 BE link ID when it is 1308. But thesofproject/linux#3491 is not a good idea because it will impact on the existing platforms. So the driver will reserve 1 BE id for rt1308 and 2 BE ids for rt1316. This requires tplg set the HDMI BE ID based on whether there is EXT_AMP_REF or not.
`ifdef(`NOJACK', `define(HDMI_BE_ID_BASE, `0')', `define(HDMI_BE_ID_BASE, `2')')', | ||
`ifdef(`EXT_AMP_REF', `define(HDMI_BE_ID_BASE, `4')', `define(HDMI_BE_ID_BASE, `3')')' | ||
)', | ||
`define(HDMI_BE_ID_BASE, `5')' |
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.
do we really have to do this three-level tests, or could we use the same technique as in the other topology file:
ifdef(`NO_JACK',
`
define(JACK_OFFSET, `0')
',
`
define(JACK_OFFSET, `2')
')
# if there is an external RT1308 amplifier connected over SoundWire,
# enable "EXT_AMP" option in the CMakefile.
ifdef(`EXT_AMP',
`
define(AMP_OFFSET, `1')
',
`
define(AMP_OFFSET, `0')
'
)
ifdef(`EXT_AMP_REF',
`
define(AMP_REF_OFFSET, `1')
',
`
define(AMP_REF_OFFSET, `0')
'
)
define(HDMI_BE_ID_BASE, eval(JACK_OFFSET+AMP_OFFSET+AMP_REF_OFFSET+DMIC_OFFSET))
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.
sof-tgl-rt711-rt1308 is something wrong. But it currently works because it doesn't meet the corner case. Let's image we don't have Jack and DMIC but have smart AMP on the board. Our driver code will always assigned the AMP BE ID from 2. So in this configuration, the driver will get the HDMI ID from 4, but in the sof-tgl-rt711-rt1308 tplg, HDMI ID will be from 2.
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 Currently, we don't reserve a dai link for amp reference. But we do have a fixed dsi link id for sdw mic.
So the hdmi link will always be 5 if there is a sdw mic present, but it will be 4 if we use a amp without reference.
@libinyang How about
define(HDMI_BE_ID_BASE, `0')
ifdef(`NO_JACK', `'
` define(HDMI_BE_ID_BASE, `2') '
)
ifdef(`NOAMP', `'
` define(HDMI_BE_ID_BASE, `3') '
)
ifdef(`EXT_AMP_REF',
` define(HDMI_BE_ID_BASE, `4') ',
`'
)
ifdef(`NO_LOCAL_MIC', `'
` define(HDMI_BE_ID_BASE, `5') '
)
We set HDMI_BE_ID_BASE = 0 initially, and check headset, amp, reference, mic one by one and overwrite HDMI_BE_ID_BASE when we find any sdw link.
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 The PR test has been passed.
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 you didn't reply to @bardliao 's suggestion
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 you didn't reply to @bardliao 's suggestion
@plbossart @bardliao Oh, sorry. I thought I had replied @bardliao 's suggestion. But it seems I failed to send out my reply. The suggestion can't handle: 'NOAMP' is set but 'NO_LOCAL_MIC' is not set. In this case, there is local MIC, so HDMI BE ID should be 5, but Bard's suggestion will get 3 for HDMI BE ID.
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 you didn't reply to @bardliao 's suggestion
@plbossart @bardliao Oh, sorry. I thought I had replied @bardliao 's suggestion. But it seems I failed to send out my reply. The suggestion can't handle: 'NOAMP' is set but 'NO_LOCAL_MIC' is not set. In this case, there is local MIC, so HDMI BE ID should be 5, but Bard's suggestion will get 3 for HDMI BE ID.
@libinyang Won't the HDMI BE ID be 5 in this case? HDMI_BE_ID_BASE will be overwrite to 5 if NO_LOCAL_MIC is not set, no?
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 Oh, my fault. There's a little fault in your suggestion. We have to undefine HDMI_BE_ID_BASE before redefining it. Please see my new PR.
sorry, I didn't see the update. Please use the button at the top right to request a review when you push an update, it makes sure reviewers will see it. |
…support add sof-icl-rt711-rt1308-rt715-hdmi NO_LOCAL_MIC & NOAMP support Signed-off-by: Libin Yang <libin.yang@intel.com>
Add sof-adl-rt711-l2-rt1316-l01 support. This tplg doesn't include any local MICs. Signed-off-by: Libin Yang <libin.yang@intel.com>
@plbossart @bardliao patch updated based on Bard's suggestion |
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 @libinyang
@plbossart @lrgirdwo Could you please help merge this PR? Thanks. |
Quickbuild is stuck @lgirdwood ? |
@lgirdwood Unfortunately, there is a problem with the internal service, |
add sof-icl-rt711-rt1308-rt715-hdmi NOMIC support and add CMake
definition for sof-adl-rt711-l2-rt1316-l01
Signed-off-by: Libin Yang libin.yang@intel.com