<br><br><div class="gmail_quote">On Mon, Nov 30, 2009 at 8:36 AM, Michal Schmidt <span dir="ltr"><<a href="mailto:mschmidt@redhat.com">mschmidt@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Dne Mon, 30 Nov 2009 11:12:38 +0100 Michael Schwendt napsal(a):<br>
<div><div></div><div class="h5">> On Mon, 30 Nov 2009 10:38:15 +0100, Michal wrote:<br>
><br>
> > Dne Mon, 30 Nov 2009 07:05:28 -0200 Paulo Cavalcanti napsal(a):<br>
> > > Thanks for the explanation.<br>
> > ><br>
> > > At least 3 applications are not restoring the volumes:<br>
> > ><br>
> > > xmms, mplayer and audacious.<br>
> ><br>
> > Interesting. Maybe these programs try to be too clever and force the<br>
> > volume themselves.<br>
><br>
> It's not an attempt at being "too clever", but several upstream<br>
> developers feel lost in what they have to do or what they have not to<br>
> do to get something right. Temporarily, Audacious devlopers have<br>
> dropped their "pulse_audio" driver (originally from XMMS) even, since<br>
> they were of the impression that "it didn't work anyway". Ubuntu<br>
> users currently feel punished with Pulse Audio. With a first bunch of<br>
> fixes [for volume issues in Fedora 12 Rawhide, volume decreased for<br>
> every new song], the driver was restored again for Audacious 2.2<br>
> development. With more recent changes in Pulse Audio, it seems, more<br>
> changes are necessary. But Audacious 2.1 cannot reflect external<br>
> volume level changes in its UI anyway. Its volume slider cannot move<br>
> for volume level changes made with external tools. Only the next<br>
> release can do that, and it suffers from new bugs (such as a bug in<br>
> alsa-lib that will require an update in Fedora, too).<br>
<br>
</div></div>Thanks for the explanation. Before I saw your reply, I played with<br>
audacious-plugins and made a kludge to prevent it from forcing 100 %<br>
volume on startup. It probably breaks something else, I haven't really<br>
tested it too much.<br>
<br>
Notice that the documentation for pa_stream_connect_playback strongly<br>
recommends passing NULL as volume.<br>
<br>
Index: audacious-plugins-fedora-2.1/src/pulse_audio/pulse_audio.c<br>
===================================================================<br>
--- audacious-plugins-fedora-2.1.orig/src/pulse_audio/pulse_audio.c<br>
+++ audacious-plugins-fedora-2.1/src/pulse_audio/pulse_audio.c<br>
@@ -666,7 +666,7 @@ static int pulse_open(AFormat fmt, int r<br>
     pa_stream_set_write_callback(stream, stream_request_cb, NULL);<br>
     pa_stream_set_latency_update_callback(stream, stream_latency_update_cb, NULL);<br>
<br>
-    if (pa_stream_connect_playback(stream, NULL, NULL, PA_STREAM_INTERPOLATE_TIMING|PA_STREAM_AUTO_TIMING_UPDATE, &volume, NULL) < 0) {<br>
+    if (pa_stream_connect_playback(stream, NULL, NULL, PA_STREAM_INTERPOLATE_TIMING|PA_STREAM_AUTO_TIMING_UPDATE, NULL, NULL) < 0) {<br>
         AUDDBG("Failed to connect stream: %s", pa_strerror(pa_context_errno(context)));<br>
         goto unlock_and_fail;<br>
     }<br>
@@ -715,6 +715,7 @@ static int pulse_open(AFormat fmt, int r<br>
     }<br>
<br>
     pa_operation_unref(o);<br>
+#if 0<br>
     /* set initial volume */<br>
     if (!(o = pa_context_set_sink_input_volume(context, pa_stream_get_index(stream), &volume, NULL, NULL))) {<br>
         g_warning("pa_context_set_sink_input_volume() failed: %s", pa_strerror(pa_context_errno(context)));<br>
@@ -725,6 +726,7 @@ static int pulse_open(AFormat fmt, int r<br>
         pa_threaded_mainloop_wait(mainloop);<br>
     }<br>
     pa_operation_unref(o);<br>
+#endif<br>
<br>
     do_trigger = 0;<br>
     written = 0;<br>
<div><div></div><div class="h5"><br><br></div></div></blockquote><div><br>Your patch almost worked. Audacious starts at the right volume level.<br>However, when audacious volume slider is hit for the first time, <br>the volume goes to the maximum again. <br>
</div></div><br>-- <br>Paulo Roma Cavalcanti<br>LCG - UFRJ<br>