Skip to content

Commit

Permalink
Make the pipewire latency 200000 (uS?) instead of 20000.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikebrady committed Sep 25, 2023
1 parent 6bba7e0 commit c046746
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions audio_pw.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,11 @@ static void start(int sample_rate, int sample_format) {
data.rate = sample_rate;
data.channels = 2;
data.stride = spa_format_samplesize(data.format) * data.channels;
data.latency = 20000;
data.latency = 20000; // looks like microseconds

nom = nearbyint((data.latency * data.rate) / 1000000.0);

pw_properties_setf(data.props, PW_KEY_NODE_LATENCY, "%u/%u", nom, data.rate);
pw_properties_setf(data.props, PW_KEY_NODE_LATENCY, "%u/%u", nom, data.rate); // looks like samples in the data.latency period

debug(1, "pw: rate: %d", data.rate);
debug(1, "pw: channgels: %d", data.channels);
Expand Down

0 comments on commit c046746

Please sign in to comment.