Repository navigation
Conversation
lgirdwood
left a comment
There was a problem hiding this comment.
Need some comments to help guide other developers through the Cadence differences.
There was a problem hiding this comment.
I would also have a big comment here explaining which Cadence codecs this applies to and state other may differ.
f75d28f to
f7742a4
Compare
|
@lgirdwood thanks will take over this as it also overlaps with some patches I need to send for somehow similar issue. |
Hmm I'll update this PR later today, please don't close |
This patch assigns IDs of each stream parameter that needs to be updated in runtime. This is because each codec uses different params and we need a consistent method of update. Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
This patch takes care of the update of stream parameters during runtime. It is important to start stream base on its runtime params and not those read from the topology which may not mach those of stream. Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
549d261 to
b8ba597
Compare
|
@dbaluta I have finally updated. I would appreciate if you could review :) |
|
@lgirdwood @paulstelian97 @dbaluta updated. Are we good to merge? |
paulstelian97
left a comment
There was a problem hiding this comment.
Other than the fact that we are using comp_err for something that's not an error this looks good now.
|
CI is all green so PR is good to merge for me :) |
|
@lgirdwood Yes, I figured out the problem. update_params() tries to do invalid set parameters configuration for MP3 for example and prepare fails. E.g setting sample rate for MP3 is an invalid operation! sample rate can only be read with a call to Cadence API. |
|
@dbaluta ok, does this mean this is good to merge or can it wait for rc2 ? (it also need a conflict fixed) |
|
@lgirdwood it's no good to merge. lets wait for rc2 |
|
@dbaluta are you going to fix that mp3 issue or you want me to do this? Although I don't have that codec on my disposal.. ;/ |
|
@mrajwa let me send you my version of this patch. |
|
@dbaluta #4139 seems to be just a copy and rework of this patch. Could you please tell why the update of sample rate fails for MP3 codec? Maybe we can make a define which keep record of updates that need to be performed? I am thinking about some sort of a mask like 0x03 -> first |
|
@mrajwa I will provide you a detailed answer to this on Tuesday. As I said above Cadence algorithms for MP3 (for example) will result in a fatal error when one tries to set sample rate or number of channels. The Cadence algorithm will figure out by itself these parameters by parsing the mp3 header. |
11da945 to
27afe5d
Compare
|
@lgirdwood will test this today. |
|
|
||
| static int update_stream_params(struct comp_dev *dev) | ||
| { | ||
| int ret = 0; |
There was a problem hiding this comment.
IIRC API_CALL() was ret = ... in which case this initialisation is superfluous
|
@lgirdwood @mrajwa what branch should I test this on? It looks like it cannot be cleanly applied on main / or v1.8 branch. |
|
@lgirdwood @mrajwa this patch fails for AAC and MP3 because some parameters are not supported for these codecs and the error is fatal. For example:
We can merge this patch with the following compromise. Do not return an error if setting a parameter fails: e.g there are few other comments which i will add inline. |
| CADENCE_SAMPLE_WIDTH_ID = 0x02, | ||
| CADENCE_CHANNELS_COUNT_ID = 0x04 | ||
| } | ||
|
|
There was a problem hiding this comment.
Here we need a semicolon:
CADENCE_SAMPLE_WIDTH_ID = 0x02,
CADENCE_CHANNELS_COUNT_ID = 0x04
-}
+};
|
|
||
|
|
||
|
|
||
| /*****************************************************************************/ |
There was a problem hiding this comment.
remove the new lines from here. Also, add the following changes:
--- a/src/audio/codec_adapter/CMakeLists.txt
+++ b/src/audio/codec_adapter/CMakeLists.txt
@@ -4,6 +4,7 @@ add_local_sources(sof codec_adapter.c codec/generic.c)
if(CONFIG_CADENCE_CODEC)
add_local_sources(sof codec/cadence.c)
+target_include_directories(sof PUBLIC ${CMAKE_CURRENT_LIST_DIR}/../../include/sof/audio/cadence)
--- a/src/include/sof/audio/codec_adapter/codec/cadence.h
+++ b/src/include/sof/audio/codec_adapter/codec/cadence.h
@@ -13,6 +13,9 @@
#include <sof/audio/cadence/xa_error_standards.h>
#include <sof/audio/cadence/xa_memory_standards.h>
+#include <sof/audio/cadence/mp3_dec/xa_mp3_dec_api.h>
+#include <sof/audio/cadence/aac_dec/xa_aac_dec_api.h>
I will add a PR with these changes later if you want.
| if (LIB_IS_FATAL_ERROR(ret)) { | ||
| comp_err(dev, "update_stream_params(): failed to set sample width."); | ||
| goto err; | ||
| } |
There was a problem hiding this comment.
Here only print a warning if there is an error but do not return err from this function.
|
@dbaluta do you happen to know if Cadence fixed the reset bug in their library? If no let's resurrect our workaround for this here. |
No news from Cadence. Also, @mrajwa can you remind me what was the reset bug? Instead of current PR I remember I prepared this PR #4139 which should be similar for Intel uses cases but doesn't break IMX usecases. |
|
@daniel, ohh sorry I confused, this is not about the reset this is about the update of stream params, we really need this patch. Unfortunately I no longer have my test board, can you retest it on your side? |
|
Ok I will update this patch as it is unmergable now and ask our internal validation to test it. CC: @wszypelt |
|
No activity in almost half a year, should we close? @mrajwa @dbaluta @lgirdwood |
This patch updates configuration parameters read from the topology
or during runtime with the stream parameters. Hence settings like
sampling rate or sample width are aligned with stream parameters.
The mismatch in those parameters may result in audio glitches or
stream stalls, just to name a few potential issues.
Signed-off-by: Marcin Rajwa marcin.rajwa@linux.intel.com