From 0aea8107355e756294054fdbc59a9bab4c57f32d Mon Sep 17 00:00:00 2001 From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Mon, 28 Feb 2022 10:59:41 +1100 Subject: [PATCH] experiment with different startup regimes --- rtsp.c | 9 +++++++++ scripts/shairport-sync.service.in | 3 +++ shairport.c | 4 ++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/rtsp.c b/rtsp.c index 29d1e4e0..d43ea8e0 100644 --- a/rtsp.c +++ b/rtsp.c @@ -2687,6 +2687,15 @@ void handle_setup_2(rtsp_conn_info *conn, rtsp_message *req, rtsp_message *resp) // timingPeerList if (conn->airplay_stream_category == ptp_stream) { ptp_send_control_message_string("T"); // incidentally create the named SHM if necessary and remove all previous history + + if (ptp_shm_interface_open() == 0) { + debug(1,"shm interface opened successfully!"); + } else { + warn("Unable to open the shm interface at SETUP!"); + } + + + debug_log_rtsp_message(2, "SETUP \"PTP\" message", req); plist_t groupUUID = plist_dict_get_item(messagePlist, "groupUUID"); if (groupUUID) { diff --git a/scripts/shairport-sync.service.in b/scripts/shairport-sync.service.in index d1dca5af..efd99a43 100644 --- a/scripts/shairport-sync.service.in +++ b/scripts/shairport-sync.service.in @@ -1,6 +1,9 @@ [Unit] Description=Shairport Sync - AirPlay Audio Receiver +Provides=shairport-sync.service After=sound.target +Requires=nqptp.service +Wants=nqptp.service Requires=avahi-daemon.service After=avahi-daemon.service Wants=network-online.target diff --git a/shairport.c b/shairport.c index b0229e40..3dcdcff5 100644 --- a/shairport.c +++ b/shairport.c @@ -2213,11 +2213,11 @@ int main(int argc, char **argv) { #ifdef CONFIG_AIRPLAY_2 ptp_shm_interface_init(); ptp_send_control_message_string("T"); // incidentally create the named SHM and remove all previous history - usleep(100000); // wait for it to get done (?) + usleep(1000000); // wait for it to get done (?) if (ptp_shm_interface_open() == 0) { debug(1,"shm interface opened successfully!"); } else { - die("Unable to open the shm interface at startup!"); + warn("Unable to open the shm interface at startup!"); } #endif