#endif
#ifdef CONFIG_DBUS_INTERFACE
+ if (dbus_service_is_running())
shairport_sync_set_active(SHAIRPORT_SYNC(shairportSyncSkeleton), TRUE);
#endif
if (config.disable_standby_mode == disable_standby_while_active) {
- config.keep_dac_busy = 1;
#ifdef CONFIG_DBUS_INTERFACE
+ if (dbus_service_is_running())
shairport_sync_set_disable_standby(SHAIRPORT_SYNC(shairportSyncSkeleton), TRUE);
+ else
+ config.keep_dac_busy = 1;
+#else
+ config.keep_dac_busy = 1;
#endif
}
}
#endif
#ifdef CONFIG_DBUS_INTERFACE
+ if (dbus_service_is_running())
shairport_sync_set_active(SHAIRPORT_SYNC(shairportSyncSkeleton), FALSE);
#endif
if (config.disable_standby_mode == disable_standby_while_active) {
- config.keep_dac_busy = 0;
#ifdef CONFIG_DBUS_INTERFACE
+ if (dbus_service_is_running())
shairport_sync_set_disable_standby(SHAIRPORT_SYNC(shairportSyncSkeleton), FALSE);
+ else
+ config.keep_dac_busy = 0;
+#else
+ config.keep_dac_busy = 0;
#endif
}
}
*/
void *alsa_buffer_monitor_thread_code(__attribute__((unused)) void *arg) {
+ int okb = -1;
while (1) {
+ if (okb != config.keep_dac_busy) {
+ debug(1,"keep_dac_busy is now %d",config.keep_dac_busy);
+ okb = config.keep_dac_busy;
+ }
if ((config.keep_dac_busy != 0) && (alsa_device_initialised == 0)) {
debug(2, "alsa: alsa_buffer_monitor_thread_code() calling "
"do_alsa_device_init_if_needed.");
#include "dbus-service.h"
+int service_is_running = 0;
+
ShairportSyncDiagnostics *shairportSyncDiagnosticsSkeleton = NULL;
ShairportSyncRemoteControl *shairportSyncRemoteControlSkeleton = NULL;
ShairportSyncAdvancedRemoteControl *shairportSyncAdvancedRemoteControlSkeleton = NULL;
debug(1, "Shairport Sync native D-Bus service started at \"%s\" on the %s bus.", name,
(config.dbus_service_bus_type == DBT_session) ? "session" : "system");
+ service_is_running = 1;
}
static void on_dbus_name_lost_again(__attribute__((unused)) GDBusConnection *connection,
g_bus_unown_name(ownerID);
else
debug(1, "Zero OwnerID for \"org.gnome.ShairportSync\".");
+ service_is_running = 0;
+}
+
+int dbus_service_is_running() {
+ return service_is_running;
}
int start_dbus_service();
void stop_dbus_service();
+int dbus_service_is_running();
#endif /* #ifndef DBUS_SERVICE_H */