You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] nocodec (SSP) topology with PASSTHROUGH=yes is broken. #9979
@ujfalusi what is your thinking about fixing this? You want to expand SSP hw_config in topology or would you prefer converting to 32-bit at the input of the DAI copier always?
I'm leaning forward of a fixed single format on DAI side, but on the other hand I think the ability to test S32_LE/S24_LE/S16_LE without loading different topology would have been the best aim.
Yeah, I think this is collateral damage from overloading nocodec for R&D/test purposes (still probably makes sense, but you get issues like this). For product use, the DAI side format is always fixed (and host side is variable). Only exception is BT offload where there are multiple formats on the DAI (one for each BT profile), but in the BT offload topologies the host/FE side is fixed to same selection (same enumeration of BT profiles). I don't see any need to have both FE and BE variable and opening this can of worms (kernel will then start to do policy choices on where to convert and IMHO this is wrong).
This leaves the R&D question of how to test multiple formats in our test beds. Maybe have nocodec variants for different DAI side configurations? Anyways this is more of a test asset scalability/maintainability question.
For any topology containing SSP we must have matching host and SSP configs, the internal format can be 32bit but the formats on both sides must have identical formats, this includes hw_configs.
for example:
Playback (capture is just the reverse naturally) three host inputs (PCM params): 48K, 2ch with S16_LE, S24_LE, S32_LE one host out: 48K, 2ch S32_LE
... one dai input: 48K, 2ch, S32_LE three dai outputs: 48K, 2ch with S16_LE, S24_LE, S32_LE
three hw_configs: 48K, 2ch with S16_LE, S24_LE, S32_LE
The DAI format is picked based on the fe_params.
If we support different rates, then we need to add these as well. I think the DAI side can support multiple formats in every case, like: one host inputs (PCM params): 48K, 2ch with S16_LE one host out: 48K, 2ch S32_LE
... one dai input: 48K, 2ch, S32_LE three dai outputs: 48K, 2ch with S16_LE, S24_LE, S32_LE
three hw_configs: 48K, 2ch with S16_LE, S24_LE, S32_LE
The PCM can only be S16_LE and the DAI will be configured to S16_LE as well all the time to match with the FE.
What matters is that we must have the format on the "host input" supported on the "dai output" and "hw config", if we list more on the dai side, it does not matter.
But for SSP this is not possible, we cannot have two hw_config for some reason and even so, the SSP definition does not allow 16 and 32 bit config to be present at the same time because:
Object.Dai.SSP."N" {
direction "duplex" # playback, capture or duplex
dai_name "NoCodec-0"
id 0
quirks "lbm_mode"
sample_bits 32 <===== THIS (32 or 16 ???)
Object.hw_config."0" {
mclk_freq 24000000
bclk_freq 4800000
tdm_slot_width 32 <===== VS THIS
}
Object.hw_config."1" {
mclk_freq 24000000
bclk_freq 4800000
tdm_slot_width 16 <===== VS THIS
}
Object.dai."playback" {
}
Object.dai."capture" {
}
So, single format for dai for sure. I'm not sure how BT offload works then if it does need different formats... I think it works because it only uses 16bit, no 24, 32 or 8 bit, just difference in rate and/or channels (mono vs stereo)
For any topology containing SSP we must have matching host and SSP configs, the internal format can be 32bit but the formats on both sides must have identical formats, this includes hw_configs.
Different formats should also be rejected by FW if pipeline does not permit format change, although my understanding is that teh copier should be able to do this (but for some reason its not). @singalsu any insights here why the copier would not align formats for the SSP blob ?
@lgirdwood, it does, but with a broken topology the kernel cannot really find anything which is usable, it does not have that level of insights and I doubt we want to build a huge validation machinery in kernel to cover all cases and then go back and rewrite the topology information to correct things.
Basically we find things alright, but the things we find are not meant to be used together.
@lgirdwood, I don't think the firmware is parsing the blob. The kernel sends the wrong blob (the only one available) with not matching copier config. My PRs are fixing this, but the topology itself remains broken.
Activity
ujfalusi commentedon Apr 29, 2025
@kv2019i, @singalsu, @jsarha, @ranj063, @lgirdwood, FYI
ranj063 commentedon Apr 29, 2025
@ujfalusi what is your thinking about fixing this? You want to expand SSP hw_config in topology or would you prefer converting to 32-bit at the input of the DAI copier always?
ujfalusi commentedon Apr 30, 2025
I'm leaning forward of a fixed single format on DAI side, but on the other hand I think the ability to test S32_LE/S24_LE/S16_LE without loading different topology would have been the best aim.
Fixed rate, channels, but blobs and hw_config for 32/24/16 bit on the SSP side. In theory it should work with thesofproject/linux#5395 and thesofproject/linux#5396 might be needed as well.
kv2019i commentedon Apr 30, 2025
Yeah, I think this is collateral damage from overloading nocodec for R&D/test purposes (still probably makes sense, but you get issues like this). For product use, the DAI side format is always fixed (and host side is variable). Only exception is BT offload where there are multiple formats on the DAI (one for each BT profile), but in the BT offload topologies the host/FE side is fixed to same selection (same enumeration of BT profiles). I don't see any need to have both FE and BE variable and opening this can of worms (kernel will then start to do policy choices on where to convert and IMHO this is wrong).
This leaves the R&D question of how to test multiple formats in our test beds. Maybe have nocodec variants for different DAI side configurations? Anyways this is more of a test asset scalability/maintainability question.
lgirdwood commentedon Apr 30, 2025
This should be rejected by FW at hw_params() i.e. I've no way to convert requested sample rate to 48kHz in this pipeline.
ujfalusi commentedon May 2, 2025
For any topology containing SSP we must have matching host and SSP configs, the internal format can be 32bit but the formats on both sides must have identical formats, this includes hw_configs.
for example:
Playback (capture is just the reverse naturally)
three host inputs (PCM params): 48K, 2ch with S16_LE, S24_LE, S32_LE
one host out: 48K, 2ch S32_LE
...
one dai input: 48K, 2ch, S32_LE
three dai outputs: 48K, 2ch with S16_LE, S24_LE, S32_LE
three hw_configs: 48K, 2ch with S16_LE, S24_LE, S32_LE
The DAI format is picked based on the fe_params.
If we support different rates, then we need to add these as well. I think the DAI side can support multiple formats in every case, like:
one host inputs (PCM params): 48K, 2ch with S16_LE
one host out: 48K, 2ch S32_LE
...
one dai input: 48K, 2ch, S32_LE
three dai outputs: 48K, 2ch with S16_LE, S24_LE, S32_LE
three hw_configs: 48K, 2ch with S16_LE, S24_LE, S32_LE
The PCM can only be S16_LE and the DAI will be configured to S16_LE as well all the time to match with the FE.
What matters is that we must have the format on the "host input" supported on the "dai output" and "hw config", if we list more on the dai side, it does not matter.
ujfalusi commentedon May 2, 2025
But for SSP this is not possible, we cannot have two hw_config for some reason and even so, the SSP definition does not allow 16 and 32 bit config to be present at the same time because:
So, single format for dai for sure. I'm not sure how BT offload works then if it does need different formats... I think it works because it only uses 16bit, no 24, 32 or 8 bit, just difference in rate and/or channels (mono vs stereo)
lgirdwood commentedon May 2, 2025
Different formats should also be rejected by FW if pipeline does not permit format change, although my understanding is that teh copier should be able to do this (but for some reason its not). @singalsu any insights here why the copier would not align formats for the SSP blob ?
ujfalusi commentedon May 2, 2025
@lgirdwood, it does, but with a broken topology the kernel cannot really find anything which is usable, it does not have that level of insights and I doubt we want to build a huge validation machinery in kernel to cover all cases and then go back and rewrite the topology information to correct things.
Basically we find things alright, but the things we find are not meant to be used together.
ujfalusi commentedon May 2, 2025
the two kernel patch will handle this better, but the topology remains broken.
ujfalusi commentedon May 2, 2025
@lgirdwood, I don't think the firmware is parsing the blob. The kernel sends the wrong blob (the only one available) with not matching copier config. My PRs are fixing this, but the topology itself remains broken.
tools: topology2: cavs-nocodec: Fix PASSTHROUGH configuration for SSPs
tools: topology2: cavs-nocodec: Fix PASSTHROUGH configuration for SSPs
abonislawski commentedon May 6, 2025
@ujfalusi please close it if verified