Skip to content

Commit ce4cd06

Browse files
bkokoszxlgirdwood
authored andcommitted
demux: fix demux look up table preparation
Array streams represents streams on "many" side i.e. input for MUX and output for DEMUX. For DEMUX each stream has masks array - 1 mask per output channel. Each mask shows, from which input channel data should be taken. This commit reverts "demux" part of commit: "b1b31e7154a5c159d81459634eabd8013b434181" Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
1 parent c6edc5f commit ce4cd06

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/audio/mux/mux_generic.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -524,9 +524,9 @@ void demux_prepare_look_up_table(struct comp_dev *dev)
524524
for (j = 0; j < PLATFORM_MAX_CHANNELS; j++) {
525525
for (k = 0; k < PLATFORM_MAX_CHANNELS; k++) {
526526
if (cd->config.streams[i].mask[j] & BIT(k)) {
527-
/* MUX component has only one sink */
528-
cd->lookup[i].copy_elem[idx].in_ch = j;
529-
cd->lookup[i].copy_elem[idx].out_ch = k;
527+
/* DEMUX component has only one source */
528+
cd->lookup[i].copy_elem[idx].in_ch = k;
529+
cd->lookup[i].copy_elem[idx].out_ch = j;
530530
cd->lookup[i].copy_elem[idx].stream_id =
531531
i;
532532
cd->lookup[i].num_elems = ++idx;

test/cmocka/src/audio/mux/demux_copy.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ static void test_demux_copy_proc_16(void **state)
197197
int64_t sample = 0;
198198

199199
for (k = 0; k < PLATFORM_MAX_CHANNELS; ++k)
200-
if (td->mask[i][k] & BIT(j))
200+
if (td->mask[i][j] & BIT(k))
201201
sample = input_16b[k];
202202

203203
expected_results[i][j] = sample;
@@ -222,7 +222,7 @@ static void test_demux_copy_proc_24(void **state)
222222
int32_t sample = 0;
223223

224224
for (k = 0; k < PLATFORM_MAX_CHANNELS; ++k)
225-
if (td->mask[i][k] & BIT(j))
225+
if (td->mask[i][j] & BIT(k))
226226
sample = input_24b[k];
227227

228228
expected_results[i][j] = sample;
@@ -247,7 +247,7 @@ static void test_demux_copy_proc_32(void **state)
247247
int32_t sample = 0;
248248

249249
for (k = 0; k < PLATFORM_MAX_CHANNELS; ++k)
250-
if (td->mask[i][k] & BIT(j))
250+
if (td->mask[i][j] & BIT(k))
251251
sample = input_32b[k];
252252

253253
expected_results[i][j] = sample;

0 commit comments

Comments
 (0)