Skip to content

Conversation

@abonislawski
Copy link
Member

@abonislawski abonislawski commented Dec 16, 2019

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.

Copy link
Collaborator

@paulstelian97 paulstelian97 left a 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.

@lgirdwood lgirdwood added the ABI ABI change involved label Dec 16, 2019
Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member

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.

Copy link
Member

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.

Copy link
Member Author

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

@abonislawski
Copy link
Member Author

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.

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 abonislawski removed the ABI ABI change involved label Dec 17, 2019
@lgirdwood lgirdwood added this to the v1.5 milestone Jan 6, 2020
@lgirdwood
Copy link
Member

@abonislawski can you check ICL CI report.

@lgirdwood
Copy link
Member

@abonislawski oh and these is some alignment issue picked up by checkpatch, can you fix.

@abonislawski
Copy link
Member Author

abonislawski commented Jan 10, 2020

@lgirdwood alignment fixed but not sure about CI because its only "Build not found." info for unit tests

@lgirdwood
Copy link
Member

@zrombel CI has the build not found error, can you please check as it's blocking merge.

@zrombel
Copy link

zrombel commented Jan 10, 2020

Mux unit tests fail for all targets.

@abonislawski
Copy link
Member Author

Tests updated with channel map generation, please review this part (more changes than expected) @lgirdwood @jajanusz @paulstelian97

Copy link
Member

@lgirdwood lgirdwood left a 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>
@lgirdwood
Copy link
Member

@abonislawski can you ping this PR once the dependency is merged. Thanks.

@lgirdwood
Copy link
Member

@abonislawski any update ?

@abonislawski
Copy link
Member Author

@lgirdwood dependency #2216 is ready to merge but not merged yet, kernel PR is ready to merge too

@zrombel
Copy link

zrombel commented Jan 23, 2020

Due to merge of PR#2303 this PR must be rebased or test results for KD tests with audio format 24b/32b ignored.

@juimonen
Copy link

juimonen commented Feb 4, 2020

@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...

@lgirdwood
Copy link
Member

@juimonen care to create feature request for the docs and write them, I think you are the new expert now !

@juimonen
Copy link

juimonen commented Feb 6, 2020

@abonislawski @mmaka1 how is the ch_coeffs array in sof_ipc_channel_map used?
so is it sparse, like if I have masks set in bit 3 and 5, do I index it like ch_coeffs[3] and ch_coeffs[5] or they are in ch_coeffs[0] and ch_coeffs[1] ?

@abonislawski
Copy link
Member Author

@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]

@juimonen
Copy link

juimonen commented Feb 7, 2020

@abonislawski ok thanks. this will be "pita" to parse from topology in kernel, but I'll see what I can do :)

@lgirdwood
Copy link
Member

@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 ?

@juimonen
Copy link

juimonen commented Feb 7, 2020

@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.

@juimonen
Copy link

juimonen commented Feb 7, 2020

@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)

@lgirdwood
Copy link
Member

@juimonen can you remind us of the structures we are passing here by pasting in reply.

@juimonen
Copy link

juimonen commented Feb 7, 2020

@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.

@lgirdwood
Copy link
Member

@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)

@jajanusz
Copy link
Contributor

Depends on #2216

@lgirdwood
Copy link
Member

Moving to v1.7

@lgirdwood lgirdwood modified the milestones: v1.6, v1.7 Sep 17, 2020
@mwasko
Copy link
Contributor

mwasko commented Jan 25, 2021

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).

@mwasko mwasko closed this Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants