diff --git a/src/auracast/multicast.py b/src/auracast/multicast.py index a1f99f7..a5ba779 100644 --- a/src/auracast/multicast.py +++ b/src/auracast/multicast.py @@ -597,6 +597,9 @@ class Streamer(): for attempt in range(1, max_attempts + 1): try: pcm_format = await audio_input.open() + logging.info( + f"Opened audio input: {type(audio_input).__name__} src={audio_source} sr={pcm_format.sample_rate} ch={pcm_format.channels}" + ) break # success except _sd.PortAudioError as err: # -9985 == paDeviceUnavailable @@ -720,6 +723,12 @@ class Streamer(): # Read the frame we need for encoding pcm_frame = await anext(frames_gen, None) + if big.get('logged_first_frame') is not True: + logging.info( + f"First PCM frame bytes={0 if pcm_frame is None else len(pcm_frame)} | lc3_frame_samples={big['lc3_frame_samples']} | bytes_per_frame={big['lc3_bytes_per_frame']}" + ) + big['logged_first_frame'] = True + if pcm_frame is None: # Not all streams may stop at the same time stream_finished[i] = True continue @@ -808,6 +817,13 @@ class Streamer(): pcm_frame, num_bytes=big['lc3_bytes_per_frame'], bit_depth=big['pcm_bit_depth'] ) + if big.get('logged_first_lc3') is not True: + try: + logging.info(f"First LC3 frame size={len(lc3_frame)} bytes") + except Exception: + pass + big['logged_first_lc3'] = True + await big['iso_queue'].write(lc3_frame) frame_count += 1 # Increment guard counter (tracks frames since last discard)