Repository navigation
[RFC]topology: hda: add a volume component to convert 24bit format - #866
Conversation
|
Hi, I wonder why the volume component is instantiated by DAI for the HDA type and not by the playback and capture pipelines? It makes the HDA DAI different from others and creates risk for unneccessary volume components duplication. Did I interpret the patch m4 code correctly? |
lgirdwood
left a comment
There was a problem hiding this comment.
This means that all HDA pipes must have a volume ? Why not just use the sof volume pipeline on the HDA pipes that need them.
At pipelines, I don't know this playback or capture pipeline is for HDA or not, so I can't add a volume here. At dai component, I add a implicit volume here to let user doesn't take care of HW detail. And if we let users know this limitation and do it by themselves, they could use volume optimally |
No, only the hda pipes with 24bit dai. And if there is a 24bit dai, the hda pipe needs a sof volume. I add no redundant volume except the one mentioned by Seppo please refer to following code, there is a ifese to add only volume to s24le. |
@RanderWang this change is too difficult to follow. |
@ranj063 I have discussed with keyon and Liam, the conclusion is given by Liam: |
There was a problem hiding this comment.
@RanderWang why is this needed? Why are you overriding the s24le set in the top-level m4 to s32le?
There was a problem hiding this comment.
Doesnt this change make the other changes redundant?
There was a problem hiding this comment.
volume component in FW would check source and sink format to select conversion function, so I need to change dai format.
Yes, you are right if there is a volume at the end of pipeline. I am try to figure out how to know whether there is a volume at the end of pipeline and if I know it, I don't need to add volume again
There was a problem hiding this comment.
@RanderWang I still see Intel specific logic in generic code. Why don't you take each pipeline in machine.m4 and use a volume pipeline(instead of passthrough) for every pipeline that has this requirement. Please see the diff I commented yesterday.
@RanderWang if you want to make it transparent, you need to have the change in the top-level m4. Besides, user is not the end user here right? It is someone like you or me who is quite aware of the limitation. I feel like this is a roundabout way of addressing the problem. The simpler solution is to add a comment before the PIPELINE_PCM_ADD for HDA pipelines about why they need to use the volume pipelines. |
Yes, your idea is the simplest one, and I would get all feedback from others. |
@RanderWang how about adding a debug check in debug.m4 for HDA DAI's which have s24le pipeline format? |
so if it is s24le, then do what ? |
|
update my PR. Now check whether there is a volume at the end of pipeline. Don't add volume if there is one. |
|
Now if it is HDA dai && format == S24le && no volume at the end of pipeline, a volume would be added. |
|
@RanderWang I still see this as the wrong course as it adds complexity where it's not needed. Can you define pipelines for each required machine like |
Done, thanks! |
|
Sorry @RanderWang I mean this diff --git a/tools/topology/sof-whl-hda.m4 b/tools/topology/sof-whl-hda.m4
index ff6aa5f2..a4fa719a 100644
--- a/tools/topology/sof-whl-hda.m4
+++ b/tools/topology/sof-whl-hda.m4
@@ -28,7 +28,7 @@ include(`platform/intel/bxt.m4')
# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s24le.
# Schedule 48 frames per 1000us deadline on core 0 with priority 0
-PIPELINE_PCM_ADD(sof/pipe-passthrough-playback.m4,
+PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4,
1, 0, 2, s24le,
48, 1000, 0, 0)
This we we include a volume transformation for each pipeline and it does not impact other HDA users who may not need or want a volume. |
|
Update my PR, thanks! |
There was a problem hiding this comment.
@RanderWang I still see Intel specific logic in generic code. Why don't you take each pipeline in machine.m4 and use a volume pipeline(instead of passthrough) for every pipeline that has this requirement. Please see the diff I commented yesterday.
|
Update my PR, thanks! your method is the simplest one. But I discussed with you In bug: #700, I said, it is a limitation of hda dma, and it should be transparent to user. And you suggest to define some macros for creating HDA Intel DAI's that will automatically add the volume control. So I did so much work and try make user do it as usual and we do the left in our library. |
|
@lgirdwood sof-hda-generic.m4 is used by intel platform. sof-whl-hda.m4 is not used now. Thanks! |
|
@RanderWang I mean that sof-hda-generic.m4 will be for all HDA capable platforms and not just Intel platforms so must be generic (you cant make any Intel only changes to this file). You can however make Intel specific changes to intel files. So dai.m4 is generic and should not contain Intel specific logic. If you renamed sof-hda-generic.m4 to sof-hda-intel-common.m4 then there is no problem making these changes. |
Yes, one problem is in our kernel code, the topology for intel is named sof-hda-generic.tplg. This is not |
It is useless now and sof-hda-generic.m4 would be used by WHL. Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
sof audio pipeline with the format of 24bit doesn't work on HDA platform. It is caused by sample data layout. SOF supports S24_LE, and each sample format is like pattern of 0ddd, d stands for data. Samples are padded with 0‟s at the MSB. Link dma copys samples directly to hda bus, but hda bus requires samples layout like pattern of ddd0. Samples are padded with 0‟s at the LSB to left justify the sample within the container. Now there is a volume at the end of hda pipeline. We only need to convert dai type from S24_LE to S32_LE to make volume convert hda data to correct format Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
|
Update PR, thanks! |
|
@RanderWang pls check CI |
|
@lgirdwood CI is successful. |
Fix the bug: sof audio pipeline with the format of 24bit doesn't
work on HDA platform. It is caused by sample data layout. SOF supports
S24_LE, and each sample format is like pattern of 0ddd, d stands for
data. Samples are padded with 0‟s at the MSB.
Link dma copys samples directly to hda bus, but hda bus requires samples
layout like pattern of ddd0. Samples are padded with 0‟s at the LSB to
left justify the sample within the container.
Suggesting by Liam and Seppo, using volume to convert S24_LE to S32_LE
in topology file.
This fixes #700
Signed-off-by: Rander Wang rander.wang@linux.intel.com