[pulseaudio-discuss] [PATCH v6 31/37] raop: Add back initial volume RTSP SET_PARAMETER request on connect

Hajime Fujita crisp.fujita at gmail.com
Sun Jan 31 20:16:28 PST 2016


From: Martin Blanchard <tchaik at gmx.com>

Regression introduced in commit 8c6407f:
raop: Merge TCP and UDP code paths + refactoring

Anyway, we need to determine if initial volume has to be setup before
sending RECORD or after:

- Setting it up *before* shouldn't be a problem: sink.c waits for
CONNECT state, set the volume and client.c triggers RECORD only once
he's got the SET_PARAMETER reply from server.

- Setting it up *after* seems to be more difficult if we try not to
send any audio before receiving the SET_PARAMETER reply form server. A
solution may be to send SET_PARAMETER just after the RECORD server
response is received and hope that it get processed by server during the
2sec latency/buffering time...

Attached patch implement that last solution. Works for me, but I cannot
guaranty it will with your hardware...
---
 src/modules/raop/raop-sink.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/modules/raop/raop-sink.c b/src/modules/raop/raop-sink.c
index 2d8157e..6b707cf 100644
--- a/src/modules/raop/raop-sink.c
+++ b/src/modules/raop/raop-sink.c
@@ -95,6 +95,8 @@ enum {
 
 static void userdata_free(struct userdata *u);
 
+static void sink_set_volume_cb(pa_sink *s);
+
 static void raop_state_cb(pa_raop_state_t state, void *userdata) {
     struct userdata *u = userdata;
 
@@ -228,6 +230,9 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse
                         /* Our stream has been suspended so we just flush it... */
                         pa_rtpoll_set_timer_disabled(u->rtpoll);
                         pa_raop_client_flush(u->raop);
+                    } else {
+                        /* Set the initial volume */
+                        sink_set_volume_cb(u->sink);
                     }
 
                     return 0;
-- 
2.5.0



More information about the pulseaudio-discuss mailing list