diff --git a/src/auracast/multicast.py b/src/auracast/multicast.py index 5128d4c..8c64e7b 100644 --- a/src/auracast/multicast.py +++ b/src/auracast/multicast.py @@ -703,6 +703,23 @@ class Streamer(): last_stats_log = time.perf_counter() stats_interval = 5.0 # Log stats every 5 seconds frame_count = 0 + # Prime inputs: read one frame from each non-precoded input to verify data flow + try: + for j, _big in enumerate(bigs.values()): + if not _big.get('precoded'): + gen = _big.get('frames_gen') + if gen is None: + gen = _big['audio_input'].frames(_big['lc3_frame_samples']) + _big['frames_gen'] = gen + test_frame = await anext(gen, None) + logging.info( + f"Prime read BIG{j}: bytes={0 if test_frame is None else len(test_frame)} samples={_big['lc3_frame_samples']}" + ) + # Store for crossfade if needed + if enable_drift_compensation and test_frame is not None: + _big['prev_pcm_frame'] = test_frame + except Exception as e: + logging.error(f"Prime read failed: {e}", exc_info=True) # One streamer fits all while self.is_streaming: