Skip to content

Commit

Permalink
ao_pipewire: pipewire uses linear volume
Browse files Browse the repository at this point in the history
Don't use cube root volumes, pipewire uses linear volumes.
  • Loading branch information
wtay authored and philipl committed Jul 8, 2022
1 parent c01bb44 commit c7b17be
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions audio/out/ao_pipewire.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,12 @@ static void on_state_changed(void *userdata, enum pw_stream_state old, enum pw_s

static float spa_volume_to_mp_volume(float vol)
{
return cbrt(vol) * 100;
return vol * 100;
}

static float mp_volume_to_spa_volume(float vol)
{
vol /= 100;
return vol * vol * vol;
return vol / 100;
}

static float volume_avg(float* vols, uint32_t n)
Expand Down

0 comments on commit c7b17be

Please sign in to comment.