|
4 | 4 |
|
5 | 5 | #include <sof/audio/buffer.h> |
6 | 6 | #include <sof/audio/component.h> |
| 7 | +#include <sof/audio/component_ext.h> |
7 | 8 | #include <sof/audio/format.h> |
8 | 9 | #include <sof/audio/module_adapter/module/generic.h> |
9 | 10 | #include <sof/audio/pipeline.h> |
@@ -309,7 +310,9 @@ static int mixin_process(struct processing_module *mod, |
309 | 310 | int i, ret; |
310 | 311 | struct cir_buf_ptr source_ptr; |
311 | 312 |
|
312 | | - comp_dbg(dev, "entry"); |
| 313 | + source_avail_frames = source_get_data_frames_available(sources[0]); |
| 314 | + comp_err(dev, "mixin_process entry: num_sinks=%d sources=%d avail=%u", |
| 315 | + num_of_sinks, num_of_sources, source_avail_frames); |
313 | 316 |
|
314 | 317 | source_avail_frames = source_get_data_frames_available(sources[0]); |
315 | 318 | sinks_free_frames = INT32_MAX; |
@@ -342,14 +345,8 @@ static int mixin_process(struct processing_module *mod, |
342 | 345 | unused_in_between_buf = comp_buffer_get_from_sink(sinks[i]); |
343 | 346 | mixout = comp_buffer_get_sink_component(unused_in_between_buf); |
344 | 347 |
|
345 | | - /* Skip non-active mixout like it is not connected so it does not |
346 | | - * block other possibly connected mixouts. In addition, non-active |
347 | | - * mixouts might have their sink buffer/interface not yet configured. |
348 | | - */ |
349 | | - if (mixout->state != COMP_STATE_ACTIVE) { |
350 | | - active_mixouts[i] = NULL; |
351 | | - continue; |
352 | | - } |
| 348 | + if (mixout->state != COMP_STATE_ACTIVE) |
| 349 | + mixout->state = COMP_STATE_ACTIVE; |
353 | 350 |
|
354 | 351 | mixout_mod = comp_mod(mixout); |
355 | 352 | active_mixouts[i] = mixout_mod; |
@@ -394,8 +391,10 @@ static int mixin_process(struct processing_module *mod, |
394 | 391 | sinks_free_frames = MIN(sinks_free_frames, free_frames - pending_frames->frames); |
395 | 392 | } |
396 | 393 |
|
397 | | - if (sinks_free_frames == 0 || sinks_free_frames == INT32_MAX) |
| 394 | + if (sinks_free_frames == 0 || sinks_free_frames == INT32_MAX) { |
| 395 | + comp_err(dev, "mixin_process early return 0: sinks_free=%u", sinks_free_frames); |
398 | 396 | return 0; |
| 397 | + } |
399 | 398 |
|
400 | 399 | #if CONFIG_XRUN_NOTIFICATIONS_ENABLE |
401 | 400 | frame_bytes = source_get_frame_bytes(sources[0]); |
@@ -502,6 +501,9 @@ static int mixin_process(struct processing_module *mod, |
502 | 501 |
|
503 | 502 | if (frames_to_copy + start_frame > mixout_data->mixed_frames) |
504 | 503 | mixout_data->mixed_frames = frames_to_copy + start_frame; |
| 504 | + |
| 505 | + if (mixout_mod && mixout_mod->dev) |
| 506 | + comp_copy(mixout_mod->dev); |
505 | 507 | } |
506 | 508 |
|
507 | 509 | if (bytes_to_consume) |
@@ -596,6 +598,18 @@ static int mixout_process(struct processing_module *mod, |
596 | 598 | sink_commit_buffer(sinks[0], bytes_to_produce); |
597 | 599 | md->acquired_buf.ptr = NULL; |
598 | 600 |
|
| 601 | + if (bytes_to_produce > 0) { |
| 602 | + struct comp_buffer *sink_buf = comp_buffer_get_from_sink(sinks[0]); |
| 603 | + if (sink_buf && comp_buffer_get_sink_component(sink_buf)) { |
| 604 | + struct comp_dev *sink_comp = comp_buffer_get_sink_component(sink_buf); |
| 605 | + comp_err(dev, "mixout_process: sink_buf=0x%x produced=%u bytes, triggering kpb=0x%x", |
| 606 | + sink_buf, bytes_to_produce, dev_comp_id(sink_comp)); |
| 607 | + comp_copy(sink_comp); |
| 608 | + } else { |
| 609 | + comp_err(dev, "mixout_process: produced=%u bytes, BUT sink_buf/comp NULL", bytes_to_produce); |
| 610 | + } |
| 611 | + } |
| 612 | + |
599 | 613 | return 0; |
600 | 614 | } |
601 | 615 |
|
|
0 commit comments