Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions getstream/video/rtc/audio_track.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ async def write(self, pcm: PcmData):
/ (self.sample_rate * self.channels * self._bytes_per_sample)
) * 1000

# TODO: do not perform logging inside critical section, move this code outside the lock
logger.warning(
logger.debug(
"Audio buffer overflow, dropping %.1fms of audio. Buffer max is %dms",
dropped_ms,
self.audio_buffer_size_ms,
Expand Down Expand Up @@ -170,7 +169,6 @@ async def recv(self) -> Frame:

# Calculate samples needed for 20ms frame
samples_per_frame = int(aiortc.mediastreams.AUDIO_PTIME * self.sample_rate)
wakeup_time = 0

# Initialize timestamp if not already done
if self._timestamp is None:
Expand All @@ -185,12 +183,7 @@ async def recv(self) -> Frame:
start_ts = self._start or time.time()
wait = start_ts + (self._timestamp / self.sample_rate) - time.time()
if wait > 0:
wakeup_time += time.time() + wait
await asyncio.sleep(wait)
if time.time() - wakeup_time > 0.1:
logger.warning(
f"scheduled sleep took {time.time() - wakeup_time} instead of {wait}, this can happen if there is something blocking the main event-loop, you can enable --debug mode to see blocking traces"
)

self._last_frame_time = time.time()

Expand Down
2 changes: 1 addition & 1 deletion getstream/video/rtc/network_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ async def _monitor_loop(self):
await asyncio.sleep(self.check_interval)
except asyncio.CancelledError:
self.logger.debug("Network monitoring loop cancelled")
break
raise
except Exception as e:
self.logger.error(
"Error in network monitoring",
Expand Down