From: Mike Brady Date: Fri, 9 Mar 2018 09:25:49 +0000 (+0000) Subject: Getting the volume properties to work without feedback -- not there yet... X-Git-Tag: 3.2d29~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47fff82dd28ba70ee46031152736e5cee59b2d2b;p=thirdparty%2Fshairport-sync.git Getting the volume properties to work without feedback -- not there yet... --- diff --git a/dacp.c b/dacp.c index 49035c5d..49f60465 100644 --- a/dacp.c +++ b/dacp.c @@ -126,7 +126,7 @@ int dacp_send_command(const char *command, char **body, ssize_t *bodysize) { // to do it. struct timespec mutex_wait_time; mutex_wait_time.tv_sec = 0; - mutex_wait_time.tv_nsec = 20000000; // 20 ms + mutex_wait_time.tv_nsec = 100000000; // 100 ms struct addrinfo hints, *res; int sockfd; diff --git a/dbus-service.c b/dbus-service.c index d281efa6..93fcc958 100644 --- a/dbus-service.c +++ b/dbus-service.c @@ -16,6 +16,7 @@ void dbus_metadata_watcher(struct metadata_bundle *argc, __attribute__((unused)) void *userdata) { // debug(1, "DBUS metadata watcher called"); + debug(1,"Set volume to %d.",argc->speaker_volume); shairport_sync_set_volume(shairportSyncSkeleton, argc->speaker_volume); } diff --git a/mpris-service.c b/mpris-service.c index e0622ddf..dd24f848 100644 --- a/mpris-service.c +++ b/mpris-service.c @@ -143,7 +143,7 @@ void mpris_metadata_watcher(struct metadata_bundle *argc, __attribute__((unused) // debug(1,"Set metadata"); media_player2_player_set_metadata(mprisPlayerPlayerSkeleton, dict); - media_player2_player_set_volume(mprisPlayerPlayerSkeleton, metadata_store.speaker_volume); + // media_player2_player_set_volume(mprisPlayerPlayerSkeleton, metadata_store.speaker_volume); } static gboolean on_handle_next(MediaPlayer2Player *skeleton, GDBusMethodInvocation *invocation, diff --git a/player.c b/player.c index dc34ee48..56150473 100644 --- a/player.c +++ b/player.c @@ -2512,6 +2512,8 @@ void player_volume(double airplay_volume, rtsp_conn_info *conn) { #ifdef HAVE_DACP_CLIENT int32_t actual_volume; if (dacp_get_volume(&actual_volume) == 200) { + conn->dacp_volume = actual_volume; // store this as the actual volume + debug(1,"Got volume of %d.",actual_volume); metadata_hub_modify_prolog(); if (metadata_store.speaker_volume == actual_volume) metadata_hub_modify_epilog(0); // no change