ASoC: SOF: use FW based aggregation on ACE2.x#4790
ASoC: SOF: use FW based aggregation on ACE2.x#4790plbossart merged 7 commits intothesofproject:topic/sof-devfrom
Conversation
b57c1da to
2097aaa
Compare
…re DAIs" This reverts commit 699e146. Don't reset device_count as we will use the multi-gateway firmware configuration. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
sound/soc/sof/ipc4-topology.c
Outdated
| else | ||
| blob->alh_cfg.mapping[i].channel_mask = mask << (step * i); | ||
|
|
||
| /* Copy device data to dma_cfg */ |
e59fce2 to
e6b9c0e
Compare
Each stream needs a dma_config_tlv. We will handle multi dma_config_tlv in the follow up commits. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
db3f2c4 to
caf006e
Compare
sound/soc/sof/ipc4-topology.c
Outdated
| */ | ||
| dma_config = &ipc4_copier->dma_config_tlv[i].dma_config; | ||
| dma_config->dma_stream_channel_map.mapping[0].device = | ||
| blob->alh_cfg.mapping[i].device; |
There was a problem hiding this comment.
I keep repeating the same question "what is a device" in this context?
It's too cryptic and can be explained better.
There was a problem hiding this comment.
@plbossart Currently, the device = node_id which is node_type | stream_tag - 1. But, it doesn't have to be stream_tag - 1. The only rule is that the device is unique for each stream and should be identical between dma_config and ALH blob. @iganakov Can you advice what device should be?
There was a problem hiding this comment.
The comments in the firmware code seem to suggest it was link_id | pdi_id?
I'd really like to have a clear documented description of what this argument needs to be, otherwise this could be fun with breakages at any time.
There was a problem hiding this comment.
The comments in the firmware code seem to suggest it was link_id | pdi_id?
Sorry, I didn't see that comment. And I notice that the dai_index is stream_tag. thesofproject/sof#8361 (comment)
Given that there is no ALH hardware on ACE2.x, I think it is more reasonable to use stream_tag?
BTW, I can add a commit to use link_id | pdi_id if we are all agree.
I'd really like to have a clear documented description of what this argument needs to be, otherwise this could be fun with breakages at any time.
Totally agree.
There was a problem hiding this comment.
there's another comment which mentions alh_id
/* To be able to retrieve proper DMA config we need to check if
* device_id value (which is alh_id) is equal to device_address.
* They both contain SNDW master id and PDI. If they match then
* proper config is found.but it's unclear what the encoding might be...
Now that the fw part has been merged, we have a regression filed, so we need to progress on this PR and bring back the functionality.
There was a problem hiding this comment.
there's another comment which mentions alh_id
/* To be able to retrieve proper DMA config we need to check if * device_id value (which is alh_id) is equal to device_address. * They both contain SNDW master id and PDI. If they match then * proper config is found.but it's unclear what the encoding might be...
Now that the fw part has been merged, we have a regression filed, so we need to progress on this PR and bring back the functionality.
@plbossart I think alh_id here is referring to alh_blob->alh_cfg.mapping[i].alh_id. That is what I mentioned the device should be identical between dma_config and ALH blob. So, it is dma_cfg->channel_map.map[i].device_address = alh_blob->alh_cfg.mapping[i].alh_id in the firmware. And the device_address (alh_id) can be any number. @iganakov Please correct me if I am wrong.
There was a problem hiding this comment.
@bardliao Yes, you're right, dma_cfg->channel_map.map[i].device_address = alh_blob->alh_cfg.mapping[i].alh_id. And from the parsing algorithm perspective device_address (alh_id) can be any number
There was a problem hiding this comment.
5b7f7fa to
1ce3baa
Compare
1ce3baa to
ad66cb7
Compare
bc35eae to
07b8e7e
Compare
We always use the lowest N channels of stream. So, set ch_mask to GENMASK(params_channels(params) - 1, 0). Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
07b8e7e to
6d516f8
Compare
e76ea13 to
9949349
Compare
sof_ipc4_dma_config_tlv{} is required for ACE2.x. The patch follow the
convention to set the dma_stream_channel_map.mapping device as
"link_id << 8 | pdi_id".
And the mapping in sof_ipc4_alh_configuration_blob{} should be the same
as dma_stream_channel_map.mapping in sof_ipc4_dma_config{}.
The purposes of device id is to map DMA tlv.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
…for first CPU DAI" This reverts commit f8ba62a. The SoundWire aggregated solution was to use one DMA on multiple links. But, the solution changed to use one DMA for each link. It means that we should assign HDaudio stream_tag for each cpu_dai. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Set ipc4_copier->data.gtw_cfg.config_length dynamically based on blob->alh_cfg.device_count to align with the other OS. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
This reverts commit 7f9512a. commit 7f9512a ("ASoC: SOF: Intel: hda-dai-ops: fix HDaudio link format") added up all DAIs channels for SoundWire aggregation mode. That was correct because we used a DMA for all DAIs. But, it is not valid anymore after we use a DMA for each DAI. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
| if (ipc4_copier->dma_config_tlv[i].length) { | ||
| dma_config = &ipc4_copier->dma_config_tlv[i].dma_config; | ||
| blob->alh_cfg.mapping[i].device = | ||
| dma_config->dma_stream_channel_map.mapping[0].device; |
There was a problem hiding this comment.
I don't understand this part. Do we actually care about the alh_cfg mapping? It seems completely redundant.
@iganakov do you actually use this for the aggregation or do you rely on the DMA TLV only?
|
|
||
| /* | ||
| * The mapping[i] device in ALH blob should be the same as the | ||
| * dma_config_tlv[i] mapping device if a dma_config_tlv is present. |
There was a problem hiding this comment.
Is this really a requirement? this isn't something we discussed? I don't mind setting it to the same value as the DMA config TLV if the goal was to align with the other OS, but I would be surprised if the firmware used this value.
|
@lgirdwood @ujfalusi @bardliao I am going to merge this to unlock LNL tests and deal with the rest of the opens in a follow-up PR. |
To support FW based aggregation on ACE2.x.