mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-02-25 01:40:36 -05:00
bluez5: iso-io: add debug option for forcing same data in all streams
When debugging desync issues, it's useful to force same data be sent on all ISO streams. Add option for that.
This commit is contained in:
parent
d0309b4e1e
commit
0003d7a2d0
4 changed files with 39 additions and 0 deletions
|
|
@ -257,6 +257,7 @@ static void group_on_timeout(struct spa_source *source)
|
|||
struct stream *stream;
|
||||
bool resync = false;
|
||||
bool fail = false;
|
||||
bool debug_mono = false;
|
||||
uint64_t exp;
|
||||
uint64_t now_realtime;
|
||||
int res;
|
||||
|
|
@ -295,6 +296,8 @@ static void group_on_timeout(struct spa_source *source)
|
|||
|
||||
if (!group->started && !stream->idle && stream->this.size > 0)
|
||||
group->started = true;
|
||||
|
||||
debug_mono = debug_mono || stream->this.debug_mono;
|
||||
}
|
||||
|
||||
if (group_latency_check(group)) {
|
||||
|
|
@ -303,6 +306,30 @@ static void group_on_timeout(struct spa_source *source)
|
|||
goto done;
|
||||
}
|
||||
|
||||
/* Force same data in all streams */
|
||||
if (debug_mono) {
|
||||
struct stream *s0 = NULL;
|
||||
|
||||
spa_list_for_each(stream, &group->streams, link) {
|
||||
if (!stream->sink)
|
||||
continue;
|
||||
if (stream->this.size) {
|
||||
s0 = stream;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (s0) {
|
||||
spa_list_for_each(stream, &group->streams, link) {
|
||||
if (!stream->sink)
|
||||
continue;
|
||||
if (stream != s0) {
|
||||
stream->this.size = s0->this.size;
|
||||
memcpy(stream->this.buf, s0->this.buf, s0->this.size);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Produce output */
|
||||
spa_list_for_each(stream, &group->streams, link) {
|
||||
int res = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue