Skip to content

Commit

Permalink
fix source being ignored when using pipewire
Browse files Browse the repository at this point in the history
  • Loading branch information
gardk authored and karlstav committed Mar 29, 2024
1 parent 34179d6 commit dc80096
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions input/pipewire.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,12 @@ void *input_pipewire(void *audiodata) {
props = pw_properties_new(PW_KEY_MEDIA_TYPE, "Audio", PW_KEY_MEDIA_CATEGORY, "Capture",
PW_KEY_MEDIA_ROLE, "Music", NULL);

pw_properties_set(props, PW_KEY_TARGET_OBJECT, data.cava_audio->source);
pw_properties_set(props, PW_KEY_STREAM_CAPTURE_SINK, "true");
const char *source = data.cava_audio->source;
if (strcmp(source, "auto") == 0) {
pw_properties_set(props, PW_KEY_STREAM_CAPTURE_SINK, "true");
} else {
pw_properties_set(props, PW_KEY_TARGET_OBJECT, source);
}
pw_properties_setf(props, PW_KEY_NODE_LATENCY, "%u/%u", nom, data.cava_audio->rate);

data.stream = pw_stream_new_simple(pw_main_loop_get_loop(data.loop), "cava", props,
Expand Down Expand Up @@ -124,4 +128,4 @@ void *input_pipewire(void *audiodata) {
pw_main_loop_destroy(data.loop);
pw_deinit();
return 0;
}
}

1 comment on commit dc80096

@bvr-yr
Copy link

@bvr-yr bvr-yr commented on dc80096 Apr 7, 2024

Choose a reason for hiding this comment

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

what...why? how I capture specific sink, not auto monitor?

Please sign in to comment.