[pulseaudio-discuss] Volume Restore

Colin Guthrie gmane at colin.guthr.ie
Sat Oct 17 05:25:17 PDT 2009

'Twas brillig, and Colin Guthrie at 16/10/09 20:46 did gyre and gimble:
> 'Twas brillig, and Marcus Blumhagen at 16/10/09 12:47 did gyre and gimble:
>> I recently switched to pulseaudio and discovered the very same issue.
>> MPlayer is setting the volume on playback start. I fixed it locally by
>> changing libao2/ao_pulse.c. I also posted this to the mplayer-users
>> mailing list but sadly it got not much attention.
>> Check the link for details and a patch sugesstion:
>> http://lists.mplayerhq.hu/pipermail/mplayer-users/2009-October/077999.html 
> This looks interesting. Does mplayer read back the volume from pulse 
> later tho'? The patch listed on it's own (without reading the other 
> code) would suggest that the value for volume will go out of sync with 
> what the volume actually is... I'm not sure if that value is used 
> elsewhere anyway.
> But overall, I agree that it should *not* set the volume. The only 
> question mark is whether or not there needs to be some extra code to 
> read the volume back :)
> I'll try and do some testing...

OK, done a bit of testing and read the code a bit. When requesting the 
volume, it seems to wait for the operation to complete, before returning 
it. This isn't ideal in our aync world, but hey ho. It means that there 
is no race between starting the stream and reading the volume before we 
get the info callback, so the patch makes sense IMO.

I've applied it to the mandriva mplayer package for our upcoming release 
and I'd advise you to push for it to be included upstream. Good luck :)



Colin Guthrie

Day Job:
   Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
   Mandriva Linux Contributor [http://www.mandriva.com/]
   PulseAudio Hacker [http://www.pulseaudio.org/]
   Trac Hacker [http://trac.edgewall.org/]

More information about the pulseaudio-discuss mailing list