-
Notifications
You must be signed in to change notification settings - Fork 349
mux: using channel map as mux configuration #2212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
paulstelian97
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So in short you just transmit which channels are to be muxed together using the channel map, then the actual config options come from the connected buffers themselves?
Should be more reliable if I understood this correctly.
src/audio/mux/mux.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you comment this logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think docs description (and examples) will be better than my words :)
https://github.com/mmaka1/sof-docs/blob/channel-mapping/api/uapi/channel-mapping.rst
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abonislawski sorry I mean comment this code inline. i.e. briefly describe what it is doing at each block otherwise it's hard to follow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abonislawski any eta for the comments, this can be merged soon. thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lgirdwood sorry, its done now but please note this cannot be merged before #2216
aa89ca8 to
bc82867
Compare
Yes but the most important part is to use channel map for configuration. Num channels and frame format is small thing which should be done anyway |
|
@abonislawski can you check ICL CI report. |
|
@abonislawski oh and these is some alignment issue picked up by checkpatch, can you fix. |
|
@lgirdwood alignment fixed but not sure about CI because its only "Build not found." info for unit tests |
|
@zrombel CI has the build not found error, can you please check as it's blocking merge. |
|
Mux unit tests fail for all targets. |
|
Tests updated with channel map generation, please review this part (more changes than expected) @lgirdwood @jajanusz @paulstelian97 |
lgirdwood
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general (not just this PR), I want to see comments added to any block of code that is non obvious, I'd like to see that here to to allow the reader easier understanding of the code.
Previous sof_mux_config will be deleted along with global frame_format and num_channels for mux. Mux will obtain format data from buffer params. Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
|
@abonislawski can you ping this PR once the dependency is merged. Thanks. |
|
@abonislawski any update ? |
|
@lgirdwood dependency #2216 is ready to merge but not merged yet, kernel PR is ready to merge too |
|
Due to merge of PR#2303 this PR must be rebased or test results for KD tests with audio format 24b/32b ignored. |
|
@abonislawski you have the topology part for the configuration or are you doing with some new binary blo generator? I made #2345 to demonstrate the topology for demux, so I can modify it for this and we would have proper topology/configuration support. We would really need some documentation for mux/demux usage, I've been at least 2 times searching for it with @singalsuo because of need to use mux/demux. I only had some pre-historic mail from @akloniex that I've lost on the way... |
|
@juimonen care to create feature request for the docs and write them, I think you are the new expert now ! |
|
@abonislawski @mmaka1 how is the ch_coeffs array in sof_ipc_channel_map used? |
|
@juimonen ch_coeffs is a flexible array to be as small as possible, so in your example you will have ch_coeffs[0] and ch_coeffs[1] |
|
@abonislawski ok thanks. this will be "pita" to parse from topology in kernel, but I'll see what I can do :) |
|
@juimonen why do we need to parse coeffs in the kernel ? We should just need to find them and pass them to FW at most ? |
|
@lgirdwood So I guess these coeffs would be coming from topology? And if the amount of coeffs varies between 0-32, so this kind of variable amount of tokens is just nasty. You can't easily copy it from tuples arrays to ipc structs. You can do it, but requires much more effort than simple fixed amount of tuples, that map almost directly to ipc. |
|
@lgirdwood and the problem with channel map is even worse as you might have many of those in one wodget. All can have different size. You can't even reserve correct amount of memory for ipc struct before parsing the whole area (to find out total variable size of all channel maps) |
|
@juimonen can you remind us of the structures we are passing here by pasting in reply. |
|
@lgirdwood I'm talking about the structs in src/include/ipc/channel_map.h struct sof_ipc_channel_map {
uint32_t ch_index;
uint32_t ext_id;
uint32_t ch_mask;
uint32_t reserved;
int32_t ch_coeffs[0];
} __packed;
and
struct sof_ipc_stream_map {
struct sof_ipc_cmd_hdr hdr;
uint32_t num_ch_map;
uint32_t reserved[3];
struct sof_ipc_channel_map ch_map[0];
} __packed;So we should parse these from topology. stream_map contains variable amount of channel maps. channel_map contains variable amount of coeffs. |
|
@juimonen looks like we need a v2 for sof_ipc_stream_map and sof_ipc_channel_map since we have 2 variable length blobs in the array (making it impossible to easily index) |
|
Depends on #2216 |
|
Moving to v1.7 |
|
The recommendation is to cancel this PR due to fact that there is no functional use-case for this PR and it is more a refactor how the configuration is passed which include ABI upgrade (do not want to do that if not really needed). |
Previous sof_mux_config will be deleted along with global frame_format and num_channels for mux.
Mux will obtain format data from buffer params.