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
[SOF CODEC]how can i use sof/cadence decoder or encoder? #5381
i wannna use cadence encoder and decoder,how can i open the cadence codec with my sof?
i check the source support,there are cadence codec supportting,
i now,use the pipe-passthrough-playback.m4 had already test the audio ok
so ,how can i open the cadence codec with my pipeline?
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Kernel: {zephyr}
SOF: {1.5.0}
Name of the topology file
Topology: {pipe-passthrough-playback.m4}
Name of the platform(s) on which the bug is observed.
Platform: {CSK6} our new add ,more sames to nxp
1.CONFIG_CADENCE_CODEC_MP3_DEC_LIB="path/to/cadence/library/xa_mp3_dec.a" where i cp this .a ?Where should I maintain the codec library on the file system?
2.cadence .a need Do all these. A need to be rebuilt?
1.CONFIG_CADENCE_CODEC_MP3_DEC_LIB="path/to/cadence/library/xa_mp3_dec.a" where i cp this .a ?Where should I maintain the codec library on the file system?
2.cadence .a need Do all these. A need to be rebuilt?
You can add Cadence library anywhere on your filestem and provide the correct path to CONFIG_CADENCE_CODEC_MP3_DEC_LIB config option.
I don't think I understand your question. You need to get the library from Cadence (are you a cadence customer?!), I think there are some fees involved. You will need to rebuild just the firmware and link it with Cadence library.
The cadence library it is just a binary. No need to modify it. Use it as it is.
i wanns test with my target board,so i think the .a will be Put on file system,Then the SOF on the AP side delivers the playback service, and calls. A to play after hifi4 starts?
The next thing that needs to be done is to find a way to link the cadence libraries with zepyr firmware. @lgirdwood any idea? We need a function similar with SOF - > sof_add_static_library
Meanhwile, @bawanqin1987 you can use codec_adapter's passhthrough codec type, to get you started.
Zephyr builds SOF as a module and imports it's cmake and Kconfig. We should be able to link Zephyr + SOF module to the Cadence archive with a regular Cmake library inclusion.
@bawanqin1987 i don't have a date when this is to be completed, hopefully in under 1 month. Patches are welcomed. Can you please let us know what platform are you using and if you have an NDA with Cadence (otherwise you wont be able to use cadence libs.)
@lenghonglin all the components are being aligned along a single interface being done by @ranj063 and @jxstelter. This is WIP but will converge at some point before SOF 2.4 (Q4 2022)
@lenghonglin That's a good point, with the current state of affairs the codec ID cannot be overwritten. It is a task actively being worked on (since MP3 doesn't work with the current code without changing the default). See #5245 .
@lenghonglin That's a good point, with the current state of affairs the codec ID cannot be overwritten. It is a task actively being worked on (since MP3 doesn't work with the current code without changing the default). See #5245 .
So there two way to support both mp3 and aac decode.
creat mp3 decode pipeline and aac decode pipeline. but this maybe coumse more ram.
@lenghonglin That's a good point, with the current state of affairs the codec ID cannot be overwritten. It is a task actively being worked on (since MP3 doesn't work with the current code without changing the default). See #5245 .
@lenghonglin please also see that @ranj063 is doing updates to the codec adapter to align the interface to what's used on Windows. Some PRs have been merged, some are in progress.
Activity
hlleng commentedon Feb 17, 2022
https://github.com/thesofproject/sof/blob/main/zephyr/CMakeLists.txt it seems zephy sof not support codec_adpater
bawanqin1987 commentedon Feb 17, 2022
Kernel: {zephyr}
SOF: {1.5.0}
Name of the topology file
Topology: {pipe-passthrough-playback.m4}
Name of the platform(s) on which the bug is observed.
Platform: {CSK6} our new add ,more sames to nxp
dbaluta commentedon Feb 17, 2022
@bawanqin1987 Have a look at the pipeline we have for supporting MP3 with i.MX8QXP/i.MX8QM here:
https://github.com/thesofproject/sof/blob/main/tools/topology/topology1/development/sof-imx8-compr-mp3-wm8960.m4
You will also need to have the cadence binary libraries: (these are provided by Cadence!!). Once you got them, you need to set some config options:
This works and it is tested for NXP platforms. I can assist you with that. For Intel platforms maybe @ranj063 can help you.
hlleng commentedon Feb 17, 2022
https://github.com/thesofproject/sof/blob/main/zephyr/CMakeLists.txt this file not support
CONFIG_COMP_CODEC_ADAPTERbawanqin1987 commentedon Feb 17, 2022
1.CONFIG_CADENCE_CODEC_MP3_DEC_LIB="path/to/cadence/library/xa_mp3_dec.a" where i cp this .a ?Where should I maintain the codec library on the file system?
2.cadence .a need Do all these. A need to be rebuilt?
dbaluta commentedon Feb 17, 2022
We will add this to zephyr in the next few weeks. Anyhow, @bawanqin1987 can try this with proper SOF without Zephyr.
dbaluta commentedon Feb 17, 2022
You can add Cadence library anywhere on your filestem and provide the correct path to CONFIG_CADENCE_CODEC_MP3_DEC_LIB config option.
Here is on my machine:
The cadence library it is just a binary. No need to modify it. Use it as it is.
What platforms are you trying to enable?
bawanqin1987 commentedon Feb 17, 2022
i wanns test with my target board,so i think the .a will be Put on file system,Then the SOF on the AP side delivers the playback service, and calls. A to play after hifi4 starts?
bawanqin1987 commentedon Feb 17, 2022
then ,i test the sof cadence codec with zpehyr os..and it's does not work? it's not support with zpehyr?
dbaluta commentedon Feb 17, 2022
@bawanqin1987 Yes, currently codec_adapter is not supported with zephyr. I have added a first PR to add this support.
Please have a look at:
#5384
The next thing that needs to be done is to find a way to link the cadence libraries with zepyr firmware. @lgirdwood any idea? We need a function similar with SOF - > sof_add_static_library
Meanhwile, @bawanqin1987 you can use codec_adapter's passhthrough codec type, to get you started.
bawanqin1987 commentedon Feb 18, 2022
and some updates for me?
passthrough codec type is not necessary. We're mainly stereo...
lgirdwood commentedon Feb 21, 2022
Zephyr builds SOF as a module and imports it's cmake and Kconfig. We should be able to link Zephyr + SOF module to the Cadence archive with a regular Cmake library inclusion.
bawanqin1987 commentedon Feb 21, 2022
When will this feature be completed?we can merge it by my platform.
dbaluta commentedon Feb 21, 2022
@bawanqin1987 i don't have a date when this is to be completed, hopefully in under 1 month. Patches are welcomed. Can you please let us know what platform are you using and if you have an NDA with Cadence (otherwise you wont be able to use cadence libs.)
3 remaining items
hlleng commentedon Feb 28, 2022
Yes, but this is sof side , i wanna know how to let host send CODEC_ADAPTOR ipc cmd to dsp. i don't find this part code.
dbaluta commentedon Feb 28, 2022
The command to create the CODEC_ADAPTER component is already sent, as you see in your screenshot. And it fails.
What I think you want on the kernel side is to have the SND_SOC_SOF_COMPRESS config option enabled so that you can use the compress interface.
This needs that you must have this Compress patch in your tree: https://lkml.org/lkml/2022/1/20/527
One question: what decoder do you want to use: compress one (like MP3) or uncrompressed one like for example (Dolby Audio Processing?).
For DAP there is no need for compress interface as it is PCM based stream.
hlleng commentedon Feb 28, 2022
Thanks , I try to find SND_SOC_SOF_COMPRESS this part code.
Why don't use
SOF_COMP_CODEC_ADAPTORlike create SOF_COMP_DAIYes, MP3
dbaluta commentedon Feb 28, 2022
I don't know how to answer this question. Could be that DAI is a special component.
hlleng commentedon Feb 28, 2022
Thanks a bundle
lgirdwood commentedon Feb 28, 2022
@lenghonglin all the components are being aligned along a single interface being done by @ranj063 and @jxstelter. This is WIP but will converge at some point before SOF 2.4 (Q4 2022)
hlleng commentedon Mar 17, 2022
@dbaluta @lgirdwood hello, i can load mp3 decode lib in sof now.
now i have a question, i see
sof/src/audio/codec_adapter/codec/cadence.c
Line 105 in bcccf12
DEFAULT_CODEC_ID,2ca2977
this commit say
If needed, this can be overwritten from userspace at runtime.how can i change codec_id in runtime ?
i wanna let codec_adapter support both mp3 decode and aac decodec.
paulstelian97 commentedon Mar 17, 2022
@lenghonglin That's a good point, with the current state of affairs the codec ID cannot be overwritten. It is a task actively being worked on (since MP3 doesn't work with the current code without changing the default). See #5245 .
hlleng commentedon Mar 17, 2022
So there two way to support both mp3 and aac decode.
Right ?
hlleng commentedon Mar 17, 2022
and It seem this #5245 is not continuing @dbaluta
dbaluta commentedon Mar 17, 2022
This is no longer true with latest sources of SOF as we removed the codec_id from topology.
This is the way we are working now to upstream. Actually, I got back to look at this. Hope to have a solution in 1 week.
For now, just for testing you can replace at compile time DEFAULT_CODEC_ID with MP3 so that you can test it.
hlleng commentedon Mar 17, 2022
Thanks for you reply.
DEFAULT_CODEC_ID with MP3 so that you can test it.Yes, i am dothing like this , and it work fine now.
I got back to look at this. Hope to have a solution in 1 week.What can i do for you? I've been needing that lately.
dbaluta commentedon Mar 17, 2022
What kernel are you using? What SOF version are you using.
Not sure if you can help, unless you have some ideas on how can we dinamically set the codec id as discussed in #5245
You can help me test this change applied on SOF main, with MP3 and tell me if it still works. Thus we can spare me some cycles.
#5559
hlleng commentedon Mar 17, 2022
The sof version is v1.5, but i update
codec_apaterpart files to latest.OK
OK, i will test later.
lgirdwood commentedon Mar 18, 2022
@lenghonglin please also see that @ranj063 is doing updates to the codec adapter to align the interface to what's used on Windows. Some PRs have been merged, some are in progress.