Topic: App Nap drops RME CRF output stream, Reconnect() fails to recover
Hello!
I was having an issue with the Digiface AVB dropping connections from a PreSonus StudioLive 16R. Gemini Argon helped me track it down. Seems to be working now, but I thought I'd pass it along.
Thanks,
-- Jason
Subject: Digiface AVB / RME AVB Controller 0.9915 (macOS): App Nap drops RME CRF output stream, and Reconnect() fails to recover lost input streams
Environment:
- Hardware: RME Digiface AVB + MOTU AVB Switch + PreSonus StudioLive 16R (clocked from RME Output Stream 16 CRF) + MOTU M64/UltraLite AVB
- Software: RME AVB Controller 0.9915 on macOS (Tahoe 26.7.1 (25G241))
Summary of the Failure Chain:
There are two interacting issues in RME AVB Controller.app on macOS:
1. Cause of the drop: macOS App Nap throttles RME AVB Controller.app in the background, delaying its userspace MSRP LeaveAll responses and causing RME Output Stream 16 (CRF) to briefly stop (STREAM_STOP counter reached 176). When the RME's CRF clock stream drops, the downstream StudioLive 16R loses its media clock, stops its outgoing talker streams, and re-runs MAAP (allocating a new multicast MAC address).
2. Why it never recovers: When the talker comes back online, RME AVB Controller's Reconnect(void*) function checks get_avb_sink_state(), sees sink_state == 1 ("Sink state already enabled -> do nothing"), and returns without re-issuing ACMP CONNECT_TX_COMMAND or updating the FPGA's listener MAC filter.
---
Issue 1 (Trigger): macOS App Nap throttles RME AVB Controller.app's userspace MSRP LeaveAll responses, dropping Output Stream 16 (CRF)
Because RME AVB Controller.app runs the Digiface AVB's IEEE 1722.1 / MSRP / MAAP endpoint stack in macOS userspace (start_endpoint), macOS applies App Nap timer coalescing whenever the GUI window is in the background. When the AVB switch issues periodic 10-second MSRP LeaveAll events, RME AVB Controller.app occasionally responds late with MSRP JoinMt. This causes the switch to briefly drop and re-establish the Talker reservation for RME Output Stream 16 (CRF) (incrementing the RME's STREAM_STOP counter on Output 16).
When RME Output Stream 16 (CRF) briefly stops, any downstream device clocked from that CRF stream (such as the PreSonus StudioLive 16R) loses clock lock, stops its outgoing talker streams, and re-runs MAAP—allocating a new multicast destination MAC address—without sending an explicit ACMP DISCONNECT_RX_COMMAND first.
Suggested Fix for Issue 1:
Add <key>NSAppSleepDisabled</key><true/> to RME AVB Controller.app/Contents/Info.plist (or call [[NSProcessInfo processInfo] beginActivityWithOptions:NSActivityUserInitiatedAllowingIdleSystemSleep | NSActivityLatencyCritical ...]) so macOS never throttles the userspace AVB endpoint timers.
---
Issue 2 (Permanent Loss of Sync): Reconnect(void*) (__Z9ReconnectPv) fails to reconnect when a talker resets without sending DISCONNECT_RX_COMMAND
After the talker resets its streams and announces itself via ADP AVAILABLE, RME AVB Controller.app calls avb_entity_on_new_entity_available -> Reconnect(void*). However, for states 0x01..0x10, Reconnect() checks get_avb_sink_state(stream_idx, &sink_state). Because the talker never sent ACMP DISCONNECT_RX_COMMAND before resetting, sink_state inside RME AVB Controller is still 1 (enabled), so Reconnect() hits:
Reconnect State = %d, Sink state already enabled -> do nothing
and returns without sending ACMP CONNECT_TX_COMMAND to the talker and without calling hardware_SetStreamListenAdr (bRequest=0x1b) to update the Digiface AVB FPGA's destination MAC filter with the talker's new MAAP multicast MAC. As a result, those RME input streams remain permanently dead until the user manually disconnects and reconnects them in the GUI (or an external controller sends ACMP DISCONNECT_RX_CMD + CONNECT_RX_CMD).
Suggested Fix for Issue 2:
In Reconnect(void*) (or when ADP available_index resets / GET_TX_STATE shows stream_id == 0 or a changed dest_mac), re-issue CONNECT_TX_COMMAND and update hardware_SetStreamListenAdr even if sink_state == 1.
Grace m906