Comment 34 for bug 598308

Revision history for this message
Ricardo Salveti (rsalveti) wrote : Re: Volume at login set to Maximum

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.