Skip to content

Having trouble sending audio and video at the same time on aarch64 systems #28

@samiamlabs

Description

@samiamlabs

Hi @dkumor!

I've been working on a ROS2-based telepresence robot for a couple of weeks now using this really convenient and nicely abstracted library. Everything works great out of the box on my laptop but I'm having some trouble getting bi-directional audio and video to work on more limited aarch64 systems like raspberry pi 4 or Jetson Xavier.

The issue I'm currently having is with sending audio (it is choppy and increasingly behind as time passes). It seems to be caused by the recv function in _audioSenderTrack slowing down from getting called at about 60Hz to about 30Hz when I try to send video at the same time (from CVCamera(width=848, height=480) in this case). This is enough for it to no longer be able to keep up with the data generated from the microphone.

Have you run into this issue yourself?

I used log_slow_callbacks.enable(0.01) to try to figure out what was slowing the asyncio event_loop. I guess an execution time of 0.029 for _run_rtp() could throttle the loop at around 30Hz if everything gets called with the same priority and it tries to run at around 30Hz itself? (Not very familiar with asyncio so my intuitions could be really off here...)
ARNING:aiodebug.log_slow_callbacks:Executing <Task pending name='Task-47' coro=<RTCRtpSender._run_rtp() running at /opt/overlay_ws/container_workspace_files/forked_python_deps/aiortc/src/aiortc/rtcrtpsender.py:295> wait_for=<Task pending name='Task-1012' coro=<NoClosedSubscription.get() running at /opt/overlay_ws/container_workspace_files/forked_python_deps/rtcbot/rtcbot/base/base.py:26> cb=[<TaskWakeupMethWrapper object at 0x7f402e4b20>()]>> took 0.029 seconds

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions