As a test I created the following patch, that fixes the initial broken behaviour for my driver/hw:
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c index ccf6ea1..0f1a0b8 100644 --- a/src/pulsecore/sink.c +++ b/src/pulsecore/sink.c @@ -283,7 +283,10 @@ pa_sink* pa_sink_new( s->input_to_master = NULL;
s->reference_volume = s->real_volume = data->volume; - pa_cvolume_reset(&s->soft_volume, s->sample_spec.channels); + if (data->save_volume) + s->soft_volume = data->volume; + else + pa_cvolume_reset(&s->soft_volume, s->sample_spec.channels); s->base_volume = PA_VOLUME_NORM; s->n_volume_steps = PA_VOLUME_NORM+1; s->muted = data->muted;
Here data->save_volume will be true if module-device-restore was called before getting to this block (with the right volume restored as real_volume).
Now just need to discuss with upstream to see what would be the right fix.
As a test I created the following patch, that fixes the initial broken behaviour for my driver/hw:
diff --git a/src/pulsecore /sink.c b/src/pulsecore /sink.c /sink.c /sink.c >input_ to_master = NULL;
index ccf6ea1..0f1a0b8 100644
--- a/src/pulsecore
+++ b/src/pulsecore
@@ -283,7 +283,10 @@ pa_sink* pa_sink_new(
s-
s- >reference_ volume = s->real_volume = data->volume; reset(& s->soft_ volume, s->sample_ spec.channels) ; reset(& s->soft_ volume, s->sample_ spec.channels) ; >n_volume_ steps = PA_VOLUME_NORM+1;
- pa_cvolume_
+ if (data->save_volume)
+ s->soft_volume = data->volume;
+ else
+ pa_cvolume_
s->base_volume = PA_VOLUME_NORM;
s-
s->muted = data->muted;
Here data->save_volume will be true if module- device- restore was called before getting to this block (with the right volume restored as real_volume).
Now just need to discuss with upstream to see what would be the right fix.