From cc1101d441d5c32e6703501328fb30bba862ca0e Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Sun, 25 Oct 2020 23:29:28 +0100 Subject: [PATCH] FIXUP bluetooth: Delay A2DP Absolute Volume setup until property is available Set passthrough mode AFTER setting up callbacks, otherwise a volume change of 100% would be sent to the rendering device while PA meanwhile applies no attenuation (plays at max volume). This is unnaceptably loud. --- src/modules/bluetooth/module-bluez5-device.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/modules/bluetooth/module-bluez5-device.c b/src/modules/bluetooth/module-bluez5-device.c index 44086c2f9..ec6572691 100644 --- a/src/modules/bluetooth/module-bluez5-device.c +++ b/src/modules/bluetooth/module-bluez5-device.c @@ -2428,8 +2428,15 @@ static void sink_set_a2dp_remote_controlled(pa_sink *s) { // pa_sink_set_set_volume_callback(s, sink_set_volume_cb); // s->n_volume_steps = A2DP_MAX_GAIN + 1; + // Temporarily disable volume callback to change to passthrough + // This would otherwise send 100% to the sink, which is not + // nice on the ears... + pa_sink_set_set_volume_callback(s, NULL); + /* Reset local attenuation */ pa_sink_enter_passthrough(s); + + pa_sink_set_set_volume_callback(s, sink_set_volume_cb); } static pa_hook_result_t transport_tx_volume_gain_changed_cb(pa_bluetooth_discovery *y, pa_bluetooth_transport *t, struct userdata *u) { -- GitLab