Skip to content

Commit

Permalink
Fix choppy sound when selecting pipewire output (#1230)
Browse files Browse the repository at this point in the history
Because forgot to set the period size in pipewire.
  • Loading branch information
nilninull committed Apr 8, 2023
1 parent 581e54b commit 4261e0e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/drivers/fluid_pipewire.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,15 @@ new_fluid_pipewire_audio_driver2(fluid_settings_t *settings, fluid_audio_func_t
goto driver_cleanup;
}

struct pw_properties *props = pw_properties_new(PW_KEY_MEDIA_TYPE, media_type, PW_KEY_MEDIA_CATEGORY, media_category, PW_KEY_MEDIA_ROLE, media_role, NULL);

pw_properties_setf(props, PW_KEY_NODE_LATENCY, "%d/%d", period_size, (int) sample_rate);
pw_properties_setf(props, PW_KEY_NODE_RATE, "1/%d", (int) sample_rate);

drv->pw_stream = pw_stream_new_simple(
pw_thread_loop_get_loop(drv->pw_loop),
"FluidSynth",
pw_properties_new(PW_KEY_MEDIA_TYPE, media_type, PW_KEY_MEDIA_CATEGORY, media_category, PW_KEY_MEDIA_ROLE, media_role, NULL),
props,
drv->events,
drv);

Expand Down

0 comments on commit 4261e0e

Please sign in to comment.