-
Notifications
You must be signed in to change notification settings - Fork 349
topology2: cavs-sdw: add Speaker and Microphone pcm #6549
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
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.
Should we prefix with SDW_ ?
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.
Should we prefix with
SDW_?
ack
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.
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 we need to start thinking about possible variations of the hardware layout. I think we should really create an 'amplifier' reference file and set the actual link/PDI number with macros, as we did for topology1.
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 we need to start thinking about possible variations of the hardware layout. I think we should really create an 'amplifier' reference file and set the actual link/PDI number with macros, as we did for topology1.
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.
The ALH index is not used by driver. link_id will be provided by callback function.
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.
naming seems weird here, what does copier have to do with volume?
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.
naming seems weird here, what does copier have to do with volume?
Renamed to "sdw amplifiers"
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.
we really need to have meaningful PGA control names.
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.
ack - the tplg compiler needs to be clever enough to name accordingly i.e. base class names would be templates where instance names (from toplevel) would be used. This would become
Playback Volume $ where $ could be the instance name like Headphones
All of this can be done for v2.5/v2.6
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.
Amplifier Volume or something.
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.
Amplifier Volume or something.
Updated
ed8693b to
3dbbf65
Compare
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.
S24_LE?
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.
too many closing braces, does this work?
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.
too many closing braces, does this work?
Thanks @plbossart This is an indentation issue. Fixing it now.
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 stream_name seems useless. @ranj063 do we need 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.
this stream_name seems useless. @ranj063 do we need this?
As I know, the stream_name maps to pcm_caps name. So, it is needed.
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 think you missed my feedback @bardliao
We should start using topology names that can be directly used by the kernel, so something like rt711-l0-rt1316-l12-rt715-l3 is needed. It's not just about adding a variable number of amplifiers, we also need to deal with the NOJACK case. In other words all variations we had for topology1 need to be supported here.
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.
is this really passthrough here?
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.
is this really passthrough here?
Yes, basically, passthrough-be pipeline contains a BE dai copier and that's what we need.
82a6e56 to
933570c
Compare
c06ed44 to
3714fd6
Compare
6d99b40 to
0b51ff5
Compare
|
@plbossart @ranj063 I use macro to define BE id and name. Could you review it? |
@bardliao I think the macro still won't be enough. What we need to do is remove the dai_index from being the unique attribute in the class DAI's and then set them using the formula to compute the link ID in the top-level topologies just like we do for topology 1 |
@ranj063 dai_index is not used by kernel. We don't need to compute link ID in topology at all. We use the .params_stream callback to get the index from SoundWire bus driver. See sdw_params_stream |
@bardliao for ALH the dai_index is of course used by the kernel What am I missing? |
|
@ranj063 I agree that for IPC3 the kernel does not "use" any dai_index coming from topology, the only thing that the kernel does is pass the 'stream_id', rate and channels in the dai_config, and the 'stream_id' is generated from the PDI ID+linkID. I must admit I have no idea why we encoded the stream_id in the topology, because we absolutely override whatever is provided by topology. No idea how IPC4 works for SoundWire. |
I think I understand Bard's point now. So we use the DAI index but not the one coming from topology and it is true for both IPC3 and IPC4. As far as the encoding in the topology goes, that also makes sense, right? We need it to set the DAI widget names. Now, this PR is OK as it is but I plan to rename the copiers with the DAI_INDEX, see #6627. So after that Im not sure if harcoding the DAI index in the DAI definition makes sense. |
Indeed. The dai_index is intuitive for SSPs only. For DMICs it's rather confusing, since the hardware can support two streams. For HDaudio it makes no sense, and for SoundWire not so much either. we could make the dai_index an option to be used where it helps (i.e. SSP only) and leave it out. My proposal to use pipeline_id.position_in_pipeline.[pcm/dai_index] would cover most cases /me/ thinks? |
@plbossart Can you please give me an example of position_in_pipeline? |
sure, using pipeline 10, we'd have copier.hda.10.1 or mixer.10.1 |
Oh you meant the actual position in the pipeline. Now having an optional value in the name is something the tplg2 compiler doesnt support. But we can just use a separate class for SSP type DAI copier with some code duplication but not too bad I guess |
|
@ranj063 @plbossart But for IPC3, we do need dai_index from topology. Because we need to send IPC before the .params_stream callback is called. |
which IPC is needed @bardliao, this is not clear to me? |
We need We may overwrite |
|
@plbossart dai index is built in fw based on node_id in copier dai_index = IPC4_ALH_DAI_INDEX(node_id.f.v_index);
/* copier id = (group id << 4) + codec id + IPC4_ALH_DAI_INDEX_OFFSET
* dai_index = (group id << 8) + codec id;
*/
#define IPC4_ALH_DAI_INDEX(x) ((((x) & 0xF0) << DAI_NUM_ALH_BI_DIR_LINKS_GROUP) + \
(((x) & 0xF) - IPC4_ALH_DAI_INDEX_OFFSET)) |
0b51ff5 to
76a9f21
Compare
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.
is this really needed?
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.
is this really needed?
Removed. Thanks
76a9f21 to
65e2b5d
Compare
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 'Amplifier Volume' is the same as above 'Amplifier Volume", you can call it "Main Amplifier Volume"
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.
@RanderWang @ranj063 The widget name will be added in the control name. So the two 'Amplifier Volume' controls are gain.20.1 Amplifier Volume and gain.21.1 Amplifier Volume. Do we need to add different prefix for them?
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.
gain.20 or gain21 are not meaning and will confuse user
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.
gain.20 or gain21 are not meaning and will confuse user
ok. updated.
65e2b5d to
8238fc0
Compare
|
@bardliao conflicts? |
A topology may be constructed by some .conf files. We may use a duplicated route index or pipeline index by accident. This commit suggests a rule to assign route and pipeline index. We have a consistent pcm id. For example, Jack out: 0 Jack in: 1 Speaker: 2 Microphone: 4 We can use a simple formula to assign the route and pipeline index for each pcm. The formula this commit suppests is pcm id * 10 ~ pcm id * 10 + 9. That is 0 ~ 9 for pcm 0, 10 ~ 19 for pcm 1, and so on. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Define macro for SoundWire jack stream name and BE id. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Add Speaker PCM to cavs-sdw topology. We need to set NUM_SDW_AMPS=1 in CMakeLists.txt if there is only one amplifier in the device and set NUM_SDW_AMPS=2 if there are two amplifiers. Set SDW_DMIC=1 if there is a SDW DMIC, like rt714 in the device. The 2nd ALH copier stream name should be the same as the 1st ALH copier, and no need to connect to the route. The 2nd ALH copier data will be set to the 1st ALH copier's gateway config in the aggregated mode. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
8238fc0 to
c196047
Compare
Fixed. |
|
@plbossart good for you ? |
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.
blindly approving, all the index management needs to be cleaned-up.
Add Speaker PCM to cavs-sdw topology. The default is for no aggregated speaker and AGGREGATED=1 should be set in CMakeLists.txt for aggregated speaker.
The 2nd ALH copier stream name should be the same as the 1st ALH copier, and no need to connect to the route.
The 2nd ALH copier data will be set to the 1st ALH copier's gateway config in the aggregated mode.
Signed-off-by: Bard Liao yung-chuan.liao@linux.intel.com