[Pkg-xmpp-devel] Bug#1079085: libervia-backend: Tests fail with twisted 24.7.0

Colin Watson cjwatson at debian.org
Mon Aug 19 23:43:15 BST 2024


Source: libervia-backend
Version: 0.9.0~hg4294-1
Severity: serious

twisted 24.7.0 in unstable causes libervia-backend's autopkgtests to
fail.  See:

  https://ci.debian.net/packages/libe/libervia-backend/testing/amd64/50769228/

I reproduced this locally with similar results, e.g.:

_____________________ TestWebRtc.test_setup_call_test_mode _____________________

self = <test_webrtc.TestWebRtc object at 0x7f2608327da0>
host = <MagicMock id='139801306673520'>
webrtc = <libervia.frontends.tools.webrtc.WebRTC object at 0x7f2606d11520>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f2606d66930>

    @pytest.mark.asyncio
    async def test_setup_call_test_mode(self, host, webrtc, monkeypatch):
        """Test mode use fake video and audio in setup_call."""
        monkeypatch.setattr(data_format, "deserialise", MagicMock(return_value=[]))
        monkeypatch.setattr(webrtc, "sources_data", webrtc_mod.SourcesTest())
>       await webrtc.setup_call("initiator")

tests/unit/frontends/test_webrtc.py:191:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <libervia.frontends.tools.webrtc.WebRTC object at 0x7f2606d11520>
role = 'initiator', audio_pt = 96, video_pt = 97

    async def setup_call(
        self,
        role: str,
        audio_pt: int | None = 96,
        video_pt: int | None = 97,
    ) -> None:
        """Sets up the call.

        This method establishes the Gstreamer pipeline for audio and video communication.
        The method also manages STUN and TURN server configurations, signal watchers, and
        various connection handlers for the webrtcbin.

        @param role: The role for the call, either 'initiator' or 'responder'.
        @param audio_pt: The payload type for the audio stream.
        @param video_pt: The payload type for the video stream

        @raises NotImplementedError: If audio_pt or video_pt is set to None.
        @raises AssertionError: If the role is not 'initiator' or 'responder'.
        """
        assert role in ("initiator", "responder")
        self.role = role

        if isinstance(self.sources_data, SourcesPipeline):
            if self.sources_data.video_pipeline != "" and video_pt is None:
                raise NotImplementedError(NONE_NOT_IMPLEMENTED_MSG)
            if self.sources_data.audio_pipeline != "" and audio_pt is None:
                raise NotImplementedError(NONE_NOT_IMPLEMENTED_MSG)
        elif isinstance(self.sources_data, SourcesNone):
            pass
        else:
            if audio_pt is None or video_pt is None:
                raise NotImplementedError(NONE_NOT_IMPLEMENTED_MSG)

        match self.sources_data:
            case SourcesAuto():
                video_source_elt = VIDEO_SOURCE_AUTO
                audio_source_elt = AUDIO_SOURCE_AUTO
            case SourcesNone():
                video_source_elt = ""
                audio_source_elt = ""
            case SourcesPipeline() as source:
                if source.video_pipeline is None:
                    video_source_elt = VIDEO_SOURCE_AUTO
                else:
                    video_source_elt = source.video_pipeline
                if source.audio_pipeline is None:
                    audio_source_elt = AUDIO_SOURCE_AUTO
                else:
                    audio_source_elt = source.audio_pipeline
            case SourcesTest():
                video_source_elt = "videotestsrc is-live=true pattern=ball"
                audio_source_elt = "audiotestsrc"
            case _:
                raise exceptions.InternalError(
                    f'Unexpected "sources_data" value: {self.sources_data!r}'
                )

        match self.sinks_data:
            case SinksApp():
                local_video_sink_elt = (
                    "appsink name=local_video_sink emit-signals=true drop=true "
                    "max-buffers=1 sync=True"
                )
            case SinksAuto():
                if isinstance(self.sources_data, SourcesNone):
                    local_video_sink_elt = ""
                else:
                    local_video_sink_elt = "autovideosink"
            case SinksNone():
                local_video_sink_elt = ""
            case _:
                raise exceptions.InternalError(
                    f'Unexpected "sinks_data" value {self.sinks_data!r}'
                )

        gst_pipe_elements = [
            "webrtcbin latency=30 name=sendrecv bundle-policy=max-bundle"
        ]

        if self.merge_pip and local_video_sink_elt:
            # Compositor is used to merge local video feedback in video sink, useful when
            # we have only a single video sink.
            gst_pipe_elements.append(
                "compositor name=compositor background=black "
                f"! video/x-raw,width={self.target_width},"
                f"height={self.target_height},framerate=30/1 "
                f"! {local_video_sink_elt}"
            )
            local_video_sink_elt = "compositor.sink_1"

        if video_source_elt:
            # Video source with an input-selector to switch between normal and video mute
            # (or desktop sharing).
            gst_pipe_elements.append(
                f"""
        input-selector name=video_selector
        ! videorate drop-only=1 max-rate=30
        ! video/x-raw,framerate=30/1
        ! tee name=t

        {video_source_elt} name=video_src
        ! queue max-size-buffers=1 max-size-time=0 max-size-bytes=0 leaky=downstream
        ! video_selector.

        videotestsrc name=muted_src is-live=true pattern=black
        ! queue leaky=downstream
        ! video_selector.

        t.
        ! queue max-size-buffers=1 max-size-time=0 max-size-bytes=0 leaky=downstream
        ! videoscale
        ! videoconvert
        ! vp8enc deadline=1 keyframe-max-dist=30
        ! rtpvp8pay picture-id-mode=15-bit
        ! application/x-rtp,media=video,encoding-name=VP8,payload={video_pt}
        ! sendrecv.
        """
            )

        if local_video_sink_elt:
            # Local video feedback.
            gst_pipe_elements.append(
                f"""
        t.
        ! queue max-size-buffers=1 max-size-time=0 max-size-bytes=0 leaky=downstream
        ! videoconvert
        ! {local_video_sink_elt}
        """
            )

        if audio_source_elt:
            # Audio with a valve for muting.
            gst_pipe_elements.append(
                f"""
        {audio_source_elt} name=audio_src
        ! valve
        ! queue max-size-buffers=10 max-size-time=0 max-size-bytes=0 leaky=downstream
        ! audioconvert
        ! audioresample
        ! opusenc audio-type=voice
        ! rtpopuspay
        ! application/x-rtp,media=audio,encoding-name=OPUS,payload={audio_pt}
        ! sendrecv.
        """
            )

        self.gst_pipe_desc = "\n\n".join(gst_pipe_elements)

        log.debug(f"Gstreamer pipeline: {self.gst_pipe_desc}")

        # Create the pipeline
        try:
            self.pipeline = Gst.parse_launch(self.gst_pipe_desc)
        except Exception:
            log.exception("Can't parse pipeline")
            self.pipeline = None
        if not self.pipeline:
>           raise exceptions.InternalError("Failed to create Gstreamer pipeline.")
E           libervia.backend.core.exceptions.InternalError: Failed to create Gstreamer pipeline.

../../build.7LB/src/libervia/frontends/tools/webrtc.py:625: InternalError
------------------------------ Captured log call -------------------------------
ERROR    libervia.frontends.tools.webrtc:webrtc.py:622 Can't parse pipeline
Traceback (most recent call last):
  File "/tmp/autopkgtest.GVSqs4/build.7LB/src/libervia/frontends/tools/webrtc.py", line 620, in setup_call
    self.pipeline = Gst.parse_launch(self.gst_pipe_desc)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gi.repository.GLib.GError: gst_parse_error: no element "webrtcbin" (1)

-- System Information:
Debian Release: trixie/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 6.9.12-amd64 (SMP w/12 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Thanks,

-- 
Colin Watson (he/him)                              [cjwatson at debian.org]



More information about the Pkg-xmpp-devel mailing list