Multimedia processing graphs
Find a file
Barry Song df495b5a8e link: fix the race condition of port_set_io
This patch is fixing random crashes when vlc player connects rtsp.
we have two places to do link_activate, one is in node_activate(1),
the other one happens on link_paused(2).

The order of (1) and (2) can vary for each different connection.
Sometimes, (1) comes before (2); Sometimes, (1) comes after (2).
This will cause one crash in about five connections from vlc to
rtsp.

If link_paused(2) is earlier than node_activate, it will do set_io
and make activated=true, then when node_activate(1) comes, nothing
will happen:
int pw_link_activate(struct pw_link *this)
{
        struct impl *impl = SPA_CONTAINER_OF(this, struct impl, this);
        int res;

        pw_log_debug(NAME" %p: activate %d %d", this, impl->activated, this->info.state);

        if (impl->activated)
                return 0;
        ...
}
In this case, everything works well.

If node_activate(1) is earlier than (2), it will do port_set_io, but
"activated" will still be false after port_set_io since the link state
can be not PW_LINK_STATE_PAUSED:
int pw_link_activate(struct pw_link *this)
{
        struct impl *impl = SPA_CONTAINER_OF(this, struct impl, this);
        int res;

        pw_log_debug(NAME" %p: activate %d %d", this, impl->activated, this->info.state);

        if (impl->activated)
                return 0;

        pw_link_prepare(this);

        ... // port_set_io

        if (this->info.state == PW_LINK_STATE_PAUSED) {
                pw_loop_invoke(this->output->node->data_loop,
                       do_activate_link, SPA_ID_INVALID, NULL, 0, false, this);
                impl->activated = true;
        }
        return 0;
}
Then when link_paused(2) happens after (1), port_set_io will be done
again.
This will lead to random crash of pipewire.

Signed-off-by: Barry Song

Fixes #186
2019-09-30 09:32:35 +02:00
doc update docs 2017-09-05 13:35:25 +02:00
man Relicense as MIT/X11 2018-11-05 17:48:52 +01:00
pipewire-alsa@dddaaf4db4 channelmix: implement per channel volume 2019-08-12 15:14:39 +02:00
pipewire-jack@274d616fa6 alsa: improve midi 2019-09-26 11:57:25 +02:00
pipewire-pulseaudio@f269cb9e51 pulseaudio: update 2019-09-27 09:50:24 +02:00
po Update POTFILES.in 2017-09-19 17:42:12 +02:00
spa vulkan: handle older versions 2019-09-27 10:53:36 +02:00
src link: fix the race condition of port_set_io 2019-09-30 09:32:35 +02:00
.editorconfig add .editorconfig files 2019-02-13 11:19:21 +01:00
.gitignore gitignore: Add vim files 2018-10-31 07:54:22 +00:00
.gitmodules update url 2018-10-28 10:34:08 +00:00
.travis.yml travis: disable vulkan option 2019-08-19 16:39:24 +02:00
_config.yml Set theme jekyll-theme-slate 2017-09-04 19:55:46 +02:00
autogen.sh autogen.sh: Immediately fail on command errors 2019-05-23 10:15:14 +02:00
check_missing_headers.sh travis: run make install and check for headers that have not been installed 2019-05-31 09:51:30 +02:00
config.h.meson add systemd socket activation 2018-10-18 12:36:10 +02:00
COPYING Relicense as MIT/X11 2018-11-05 17:48:52 +01:00
LICENSE Relicense as MIT/X11 2018-11-05 17:48:52 +01:00
Makefile.in Add PortConfig parameter 2019-08-06 12:45:20 +02:00
meson.build bluez-monitor: fix usage of pw_properties_setf without a format string 2019-09-26 17:26:23 +02:00
meson_options.txt jack: add jack source and sink 2019-08-20 20:35:41 +02:00
NEWS Update NEWS 2019-09-26 16:53:05 +02:00
PROTOCOL Initial commit 2015-04-16 16:58:33 +02:00
pw-uninstalled.sh uninstalled: update uninstalled 2018-10-10 18:04:28 +02:00
README Relicense as MIT/X11 2018-11-05 17:48:52 +01:00

PipeWire
--------

PipeWire is a server and user space API to deal with multimedia
pipelines. This includes:

  - Making available sources of video (such as from a capture devices or
       application provided streams) and multiplexing this with
       clients.
  - Accessing sources of video for consumption.
  - Generating graphs for audio and video processing.

Nodes in the graph can be implemented as separate processes,
communicating with sockets and exchanging multimedia content using fd
passing.

Building
--------

Pipewire uses the Meson and Ninja build system to compile. If you're not
familiar with these tools, the included "autogen.sh" script will
automatically run the correct meson/ninja commands, and output a Makefile.
It follows that there are two methods to build Pipewire, however both rely
on Meson and Ninja to actually perform the compilation:

$ ./autogen.sh
$ make

or the Meson/Ninja native method:

$ meson build
$ cd build
$ ninja

You can see the available meson options in meson_options.txt file.