diff options
Diffstat (limited to 'debian/tests')
-rw-r--r-- | debian/tests/control | 10 | ||||
-rwxr-xr-x | debian/tests/gnome-desktop-testing | 16 | ||||
-rwxr-xr-x | debian/tests/gstreamer1.0-pipewire | 12 | ||||
-rwxr-xr-x | debian/tests/libpipewire-0.3-dev | 41 | ||||
-rw-r--r-- | debian/tests/manual-tests.md | 147 |
5 files changed, 226 insertions, 0 deletions
diff --git a/debian/tests/control b/debian/tests/control new file mode 100644 index 0000000..b92c7fc --- /dev/null +++ b/debian/tests/control @@ -0,0 +1,10 @@ +Tests: gnome-desktop-testing +Depends: gnome-desktop-testing, pipewire-tests + +Tests: gstreamer1.0-pipewire +Restrictions: allow-stderr, superficial +Depends: gstreamer1.0-pipewire, gstreamer1.0-tools + +Tests: libpipewire-0.3-dev +Restrictions: allow-stderr, superficial +Depends: build-essential, libpipewire-0.3-dev, pkg-config diff --git a/debian/tests/gnome-desktop-testing b/debian/tests/gnome-desktop-testing new file mode 100755 index 0000000..c8318ed --- /dev/null +++ b/debian/tests/gnome-desktop-testing @@ -0,0 +1,16 @@ +#!/bin/sh + +set -eu +exec 2>&1 + +exec gnome-desktop-testing-runner $( + gnome-desktop-testing-runner -l pipewire-0.3 | while read -r t d; do + case "$t" in + (pipewire-0.3/pw-test-pipewire-alsa-stress*) + ;; + (*) + echo "$t" + ;; + esac + done +) diff --git a/debian/tests/gstreamer1.0-pipewire b/debian/tests/gstreamer1.0-pipewire new file mode 100755 index 0000000..c0b7ca2 --- /dev/null +++ b/debian/tests/gstreamer1.0-pipewire @@ -0,0 +1,12 @@ +#!/bin/sh +# Copyright 2020 Collabora Ltd. +# SPDX-License-Identifier: MIT + +set -eux + +export GST_INSPECT_NO_COLORS=1 +export PAGER=cat + +gst-inspect-1.0 pipewire +gst-inspect-1.0 pipewiresink +gst-inspect-1.0 pipewiresrc diff --git a/debian/tests/libpipewire-0.3-dev b/debian/tests/libpipewire-0.3-dev new file mode 100755 index 0000000..c5905ae --- /dev/null +++ b/debian/tests/libpipewire-0.3-dev @@ -0,0 +1,41 @@ +#!/bin/sh +# Copyright 2020 Collabora Ltd. +# SPDX-License-Identifier: MIT + +set -eux + +if [ -n "${AUTOPKGTEST_ARTIFACTS-}" ]; then + WORKDIR="$AUTOPKGTEST_ARTIFACTS" +else + WORKDIR="$(mktemp -d)" + trap 'cd /; rm -fr "$WORKDIR"' 0 INT QUIT ABRT PIPE TERM +fi + +if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then + CROSS_COMPILE="$DEB_HOST_GNU_TYPE-" +else + CROSS_COMPILE= +fi + +cd "$WORKDIR" + +cat > "$WORKDIR/trivial.c" <<EOF +#include <pipewire/pipewire.h> + +#include <stdio.h> + +int main(int argc, char *argv[]) +{ + pw_init(&argc, &argv); + printf("Compiled with libpipewire %s\n" + "Linked with libpipewire %s\n", + pw_get_headers_version(), + pw_get_library_version()); + return 0; +} +EOF + +# Deliberately word-splitting pkg-config's output: +# shellcheck disable=SC2046 +"${CROSS_COMPILE}gcc" -otrivial trivial.c -lm $("${CROSS_COMPILE}pkg-config" --cflags --libs libpipewire-0.3) +./trivial diff --git a/debian/tests/manual-tests.md b/debian/tests/manual-tests.md new file mode 100644 index 0000000..6910d3b --- /dev/null +++ b/debian/tests/manual-tests.md @@ -0,0 +1,147 @@ +Manual tests for PipeWire +========================= + +Introspection (pipewire) +------------------------ + +Install `pipewire`. + +Run `pw-cli dump`. + +Video streams +------------- + +Install `pipewire` and `pipewire-tests`. + +Run `/usr/libexec/installed-tests/pipewire-0.3/examples/video-src` +(or `video-src-alloc`). It will print a node ID, for example 42. + +In another terminal, run +`/usr/libexec/installed-tests/pipewire-0.3/examples/video-play 42` +or `/usr/libexec/installed-tests/pipewire-0.3/examples/export-sink 42`, +replacing 42 by the node ID you saw. You should get a window with an +animation. + +Similarly, if you uncomment the lines + +``` +add-spa-lib videotestsrc videotestsrc/libspa-videotestsrc +create-object spa-node-factory factory.name=videotestsrc node.name=videotestsrc Spa:Pod:Object:Param:Props:patternType=1 +``` + +in `/etc/pipewire/pipewire.conf`, then you should see a node in the output +of `pw-cli ls Node` with `node.name = "videotestsrc"`. Pass its node ID +to `video-play` to see a different animation. + +V4L2 cameras +------------ + +If you have a camera, run +`/usr/libexec/installed-tests/pipewire-0.3/examples/local-v4l2` or +`/usr/libexec/installed-tests/pipewire-0.3/examples/spa/local-v4l2`. +You should get a camera stream displayed in a window (but this might +fail if it cannot negotiate a suitable capture resolution). + +Audio sink +---------- + +Use `pw-play` to play a WAV file. + +Audio test source +----------------- + +If you uncomment the lines + +``` +add-spa-lib audiotestsrc audiotestsrc/libspa-audiotestsrc +create-object adapter factory.name=audiotestsrc node.name=my-test +``` + +in `/etc/pipewire/pipewire.conf`, then you should see a node in the output +of `pw-cli ls Node` with `node.name = "my-test"`. You can record from it +with `pw-record --target ${node id here} test.wav` (press Ctrl+C to +stop recording). + +ALSA client plugin (pipewire-audio-client-libraries) +---------------------------------------------------- + +Install `pipewire-audio-client-libraries` and `alsa-utils`. +Make sure PulseAudio is not currently playing audio and is configured +to release the audio device when not in use. + +`aplay -L` should list `pipewire`. + +`aplay -D pipewire /usr/share/sounds/alsa/Front_Center.wav` should +play a sound. + +JACK client library replacement (pipewire-audio-client-libraries) +----------------------------------------------------------------- + +Install `pipewire`, `pipewire-audio-client-libraries`, `alsa-utils` and +`sndfile-tools`. Do not have a real JACK server running. +Make sure PulseAudio is not currently playing audio and is configured +to release the audio device when not in use. + +`aplay -D jack /usr/share/sounds/alsa/Front_Center.wav` and +`sndfile-jackplay /usr/share/sounds/alsa/Front_Center.wav` should fail +with: + +``` +jack server is not running or cannot be started +``` + +`pw-jack aplay -D jack /usr/share/sounds/alsa/Front_Center.wav` +should succeed. + +* TODO: Currently it prints + + aplay: set_params:1343: Sample format non available + Available formats: + - FLOAT_LE + + and segfaults. + +`pw-jack sndfile-jackplay /usr/share/sounds/alsa/Front_Center.wav` +should succeed. + +* TODO: Currently it prints + `Cannot connect output port 0 (alsa_pcm:playback_1)` and plays + silence for the length of the test file. + +PulseAudio client library replacement (pipewire-audio-client-libraries) +----------------------------------------------------------------------- + +Install `pipewire`, `pipewire-audio-client-libraries`, `alsa-utils` and +`pulseaudio-utils`. Make sure PulseAudio is not currently playing audio +and is configured to release the audio device when not in use. + +Setup: let your pulseaudio service become idle, then +`pkill -STOP pulseaudio`. + +`paplay /usr/share/sounds/alsa/Front_Center.wav` should hang (because +PulseAudio has been stopped). + +`pw-pulse paplay /usr/share/sounds/alsa/Front_Center.wav` should play +the audio. + +Teardown: `pkill -CONT pulseaudio` to return it to normal. + +GStreamer elements (gstreamer1.0-pipewire) +------------------------------------------ + +Install `gstreamer1.0-tools` and `gstreamer1.0-pipewire`. +Make sure PulseAudio is not currently playing audio and is configured +to release the audio device when not in use. + +Run: `gst-inspect-1.0 pipewire`. It should list `pipewiresrc`, +`pipewiresink` and `pipewiredeviceprovider`. + +Run: `gst-inspect-1.0 pipewiresrc`. It should list details. + +Run: `gst-inspect-1.0 pipewiresink`. It should list details. + +Run: `gst-launch-1.0 audiotestsrc '!' pipewiresink`. It should beep +until you press Ctrl+C. + +Run: `gst-launch-1.0 pipewiresrc '!' videoconvert '!' autovideosink`. +You should get a webcam image (if you have a webcam). |