Bug 66677

Summary: Volume of regular stream turn to Max while volume sharing
Product: PulseAudio Reporter: IvanXie <cunshangzhishu>
Component: coreAssignee: pulseaudio-bugs
Status: RESOLVED FIXED QA Contact: pulseaudio-bugs
Severity: normal    
Priority: medium CC: lennart
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description IvanXie 2013-07-08 02:15:42 UTC
"volume sharing" feature patch http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/src/pulsecore/sink-input.c?id=c9c88fb8dcbd35774e7aaae09e057e1b8bcdc3d4 

When a sink-input has been moved to a new proper sink, for the regular stream case(flat disabled), we have to update sink-inputs' volume as "i->reference_ratio".

In my case, I just create a new sink-input without passing volume parameter. So the reference_ratio is Max. Right?
And after the sink-input created finished, I changed its volume by pa_sink_input_set_volume.
The client scenario is like below:
1.pa_simple_new
2.pa_simple_set_volume.

So, when I move this sink-input to a proper sink I wanted, the volume of this sink-input always turn to Max. Cause the "i->reference_ratio" is Max.

Anyway, I don't understand why we have to update the sink-input volume as "i->reference_ratio" in the regular stream case.

If you have any idea, please share with us.
 
Looking forward to your reply.
Comment 1 Tanu Kaskinen 2013-07-08 10:53:30 UTC
(In reply to comment #0)
> "volume sharing" feature patch
> http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/src/pulsecore/sink-
> input.c?id=c9c88fb8dcbd35774e7aaae09e057e1b8bcdc3d4 
> 
> When a sink-input has been moved to a new proper sink, for the regular
> stream case(flat disabled), we have to update sink-inputs' volume as
> "i->reference_ratio".

Are you saying that you have flat volumes disabled? Have you set "flat-volumes = no" in /etc/pulse/daemon.conf?

> In my case, I just create a new sink-input without passing volume parameter.
> So the reference_ratio is Max. Right?
> And after the sink-input created finished, I changed its volume by
> pa_sink_input_set_volume.
> The client scenario is like below:
> 1.pa_simple_new
> 2.pa_simple_set_volume.

There's no such thing as pa_simple_set_volume. Could you describe the steps to reproduce the bug in more detail?
Comment 2 IvanXie 2013-07-09 09:25:25 UTC
(In reply to comment #1)
> (In reply to comment #0)
> > "volume sharing" feature patch
> > http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/src/pulsecore/sink-
> > input.c?id=c9c88fb8dcbd35774e7aaae09e057e1b8bcdc3d4 
> > 
> > When a sink-input has been moved to a new proper sink, for the regular
> > stream case(flat disabled), we have to update sink-inputs' volume as
> > "i->reference_ratio".
> 
> Are you saying that you have flat volumes disabled? Have you set
> "flat-volumes = no" in /etc/pulse/daemon.conf?
> 

Yes. We set "flat-volumes = no" in /etc/pulse/daemon.conf.


> > In my case, I just create a new sink-input without passing volume parameter.
> > So the reference_ratio is Max. Right?
> > And after the sink-input created finished, I changed its volume by
> > pa_sink_input_set_volume.
> > The client scenario is like below:
> > 1.pa_simple_new
> > 2.pa_simple_set_volume.
> 
> There's no such thing as pa_simple_set_volume. Could you describe the steps
> to reproduce the bug in more detail?

Anyway. pa_simple_set_volume is a new function we added in PA simple.c.
Its just call pa_context_set_sink_input_volume to set volume value of sink-input belongs to this new simple.

The reproduce steps is:
1.Create a new sink-input. (pa_simple_new)
2.Set the volume value of this sink-input. (pa_context_set_sink_input_volume)
3.Move this sink-input to other sink. (pa_sink_input_move_to)
Conditions:
1.No PA_SINK_SHARE_VOLUME_WITH_MASTER flags for sinks
2.flat-volumes = no
Comment 3 Tanu Kaskinen 2013-07-09 14:05:54 UTC
Thanks, I can reproduce this. I'll investigate.
Comment 4 Tanu Kaskinen 2013-07-09 14:54:20 UTC
I actually had already sent a fix for this to the mailing list, but I had completely forgot about it. I now applied that old patch, and this bug should be fixed: http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=8e0e2617fb4c70fd4ed031cd108024f84e950fae

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.