Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pylibsrtp.Error: couldn't initialize #29

Open
bernardolansing opened this issue Oct 27, 2023 · 0 comments
Open

pylibsrtp.Error: couldn't initialize #29

bernardolansing opened this issue Oct 27, 2023 · 0 comments

Comments

@bernardolansing
Copy link

I am trying to run a video transmission from a Raspberry Pi using aiortc, but recently I started to receive this weird error:

ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-17' coro=<RTCPeerConnection.__connect() done, defined at /home/proto003/.pyenv/versions/3.9.16/lib/python3.9/site-packages/aiortc/rtcpeerconnection.py:1000> exception=Error("couldn't initialize")>
Traceback (most recent call last):
  File "/home/proto003/.pyenv/versions/3.9.16/lib/python3.9/site-packages/aiortc/rtcpeerconnection.py", line 1010, in __connect
    await dtlsTransport.start(self.__remoteDtls[transceiver])
  File "/home/proto003/.pyenv/versions/3.9.16/lib/python3.9/site-packages/aiortc/rtcdtlstransport.py", line 413, in start
    self._rx_srtp = Session(rx_policy)
  File "/home/proto003/.pyenv/versions/3.9.16/lib/python3.9/site-packages/pylibsrtp/__init__.py", line 202, in __init__
    _srtp_assert(lib.srtp_create(srtp, _policy))
  File "/home/proto003/.pyenv/versions/3.9.16/lib/python3.9/site-packages/pylibsrtp/__init__.py", line 55, in _srtp_assert
    raise Error(ERRORS[rc])
pylibsrtp.Error: couldn't initialize

As i discussed here, this couldn't come from a code error, it must be something in the system that broke in the last few months. I believe the easiest way to reproduce this bug is with the aiortc webcam example.

A note that I forgot to mention in the other issue is that the ice gathering state checks as complete, the connection state stays stuck in "connecting" and the other end of the connection displays a dark screen. I tested with pylibsrtp built from source and pre-built from the official RPi wheels repository, with the same result.

This is the function that fails:

def _srtp_assert(rc):
    if rc != lib.srtp_err_status_ok:
        raise Error(ERRORS[rc])

I've added a print('rc:', rc) and this was the outcome:

rc: 0
rc: 0
rc: 5

I hope this information is enough to track whatever is going wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant