Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions include/sound/sof/topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,22 @@ struct sof_ipc_comp_asrc {
uint32_t reserved[4];
} __attribute__((packed));

struct mux_stream_data {
uint32_t data_id;
uint32_t pipeline_id;
uint8_t num_channels;
uint8_t mask[8];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does the mask represent?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so these are copied from FW and should be explained there. As I understand it, it is a channel mask for this stream, so which stream and channel is copied and where? @akloniex any comments?

uint8_t reserved[3]; /* padding */
} __packed;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we have u8 in IPC definitions? Are you sure we're not going to have endianness issues or other shenanigangs?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no I'm not. Actually the 8 and 3 in the mask and reserved are also dubious as we have variable size for those in FW depending on platform (for e.g. 8 for apl, 4 for byt). So actually I would like us also to rationalize the mux/demux structs, if they are made public in kernel, so that it would be same for all platforms and have some sane types. I mean pipeline_id is uint32 and channels is uint8? Are we going to have 2 million pipelines? So why don't just set everything to uint16 and fix the max channels to 8?

I think the space save we get from these hacks is minimal. So this is more for mux/demux component developer, but as these structs could be mirrored in kernel, they should take into account other issues as minimal size also...


struct sof_mux_config {
uint16_t frame_format;
uint16_t num_channels;
uint16_t num_streams;
uint16_t reserved; /* padding to ensure proper alignment */
struct mux_stream_data streams[];
} __packed;

/* generic MUX component */
struct sof_ipc_comp_mux {
struct sof_ipc_comp comp;
Expand Down
5 changes: 5 additions & 0 deletions include/uapi/sound/sof/tokens.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,9 @@
#define SOF_TKN_MUTE_LED_USE 1300
#define SOF_TKN_MUTE_LED_DIRECTION 1301

#define SOF_TKN_MUX_NUM_STREAMS 1400
#define SOF_TKN_MUX_NUM_CHANNELS 1401
#define SOF_TKN_MUX_STREAM_PIPELINE_ID 1402
#define SOF_TKN_MUX_STREAM_CHANNELS 1403

#endif
Loading