So this is the call trace I'm getting with my device:
1) module specific (droid in my case) -> pa_sink_new
2) pa_sink_new fires up PA_CORE_HOOK_SINK_FIXATE before finishing setting up the sink, giving the original data (pa_sink_new_data) to the callback;
3) module-device-restore gets PA_CORE_HOOK_SINK_FIXATE and calls sink_fixate_hook_callback, updating the real volume for pa_sink_new_data, and setting up save_volume;
4) pa_sink_new then correctly sets reference_volume and real_volume, getting it from pa_sink_new_data (which was used by module-device-restore)
5) pa_sink_new initializes soft_volume with the max value, causing this broken behavior
At the time you call pactl set-sink-volume (or set the volume via the indicator), it'll call sink_port_hook_callback that will call pa_sink_set_volume, which will then set the real_volume and soft_volume to the same value (as my driver is not providing the set_volume callback.
So this is the call trace I'm getting with my device: HOOK_SINK_ FIXATE before finishing setting up the sink, giving the original data (pa_sink_new_data) to the callback; device- restore gets PA_CORE_ HOOK_SINK_ FIXATE and calls sink_fixate_ hook_callback, updating the real volume for pa_sink_new_data, and setting up save_volume; device- restore)
1) module specific (droid in my case) -> pa_sink_new
2) pa_sink_new fires up PA_CORE_
3) module-
4) pa_sink_new then correctly sets reference_volume and real_volume, getting it from pa_sink_new_data (which was used by module-
5) pa_sink_new initializes soft_volume with the max value, causing this broken behavior
Code: sink.c: reset(& s->soft_ volume, s->sample_ spec.channels) ;
src/pulsecore/
169 /* Called from main context */
170 pa_sink* pa_sink_new(
171 pa_core *core,
172 pa_sink_new_data *data,
173 pa_sink_flags_t flags) {
174
...
285 s->reference_volume = s->real_volume = data->volume;
286 pa_cvolume_
...
At the time you call pactl set-sink-volume (or set the volume via the indicator), it'll call sink_port_ hook_callback that will call pa_sink_set_volume, which will then set the real_volume and soft_volume to the same value (as my driver is not providing the set_volume callback.