+ All Categories
Home > Documents > Wim Taymans Principal Software Engineer FOSDEM 2019€¦ · Client1 Client2... To screen Kernel...

Wim Taymans Principal Software Engineer FOSDEM 2019€¦ · Client1 Client2... To screen Kernel...

Date post: 13-Aug-2020
Category:
Upload: others
View: 0 times
Download: 0 times
Share this document with a friend
24
PipeWire | Wim Taymans 1 PipeWire Wim Taymans Principal Software Engineer FOSDEM 2019
Transcript
Page 1: Wim Taymans Principal Software Engineer FOSDEM 2019€¦ · Client1 Client2... To screen Kernel V4l2 bluetooth alsa va-api DRM. 24 PipeWire | Wim Taymans Video capture Systemd socket

PipeWire | Wim Taymans1

PipeWireWim TaymansPrincipal Software EngineerFOSDEM 2019

Page 2: Wim Taymans Principal Software Engineer FOSDEM 2019€¦ · Client1 Client2... To screen Kernel V4l2 bluetooth alsa va-api DRM. 24 PipeWire | Wim Taymans Video capture Systemd socket

PipeWire | Wim Taymans6

What is it

Multimedia sharing and processing engine

Page 3: Wim Taymans Principal Software Engineer FOSDEM 2019€¦ · Client1 Client2... To screen Kernel V4l2 bluetooth alsa va-api DRM. 24 PipeWire | Wim Taymans Video capture Systemd socket

PipeWire | Wim Taymans7

The multimedia stack

Kernel V4l2 alsabluetooth va-api DRM

GStreamerBrowser Skype

App

Pulseaudio JACK

VLC Ardour

wayland

Page 4: Wim Taymans Principal Software Engineer FOSDEM 2019€¦ · Client1 Client2... To screen Kernel V4l2 bluetooth alsa va-api DRM. 24 PipeWire | Wim Taymans Video capture Systemd socket

PipeWire | Wim Taymans8

PipeWire

Kernel V4l2 alsabluetooth va-api DRM

PipeWireDaemon

GStreamer VLC App1 App2

App

JACK Wayland

SessionManager

Page 5: Wim Taymans Principal Software Engineer FOSDEM 2019€¦ · Client1 Client2... To screen Kernel V4l2 bluetooth alsa va-api DRM. 24 PipeWire | Wim Taymans Video capture Systemd socket

PipeWire | Wim Taymans21

Features

● Exchange media with devices and other apps● Zero copy, shared memory, memfd, dmabuf, eventfd

● Security per application● Visible objects (R), methods (WX), ..

● RT capable, low latency (<1.5ms)● All media types + generic control streams● Simple JACK-like scheduler + feedback loops● Extensible: types, protocol, ...● External session manager implements policy

Page 6: Wim Taymans Principal Software Engineer FOSDEM 2019€¦ · Client1 Client2... To screen Kernel V4l2 bluetooth alsa va-api DRM. 24 PipeWire | Wim Taymans Video capture Systemd socket

PipeWire | Wim Taymans22

Session manager

● Setup of devices● DSP processing, effects, mixers, ..

● Security of clients● What they can see, default permissions

● Management of links/nodes in the graph● What nodes and effects to link to (profiles, roles, ..)● Suspend of idle devices, volume restore, …

● The things you want to configure

Page 7: Wim Taymans Principal Software Engineer FOSDEM 2019€¦ · Client1 Client2... To screen Kernel V4l2 bluetooth alsa va-api DRM. 24 PipeWire | Wim Taymans Video capture Systemd socket

PipeWire | Wim Taymans23

V4l2 capture/sharing

PipeWire-0

Client1 Client2

To screen...

Kernel V4l2 alsabluetooth va-api DRM

Page 8: Wim Taymans Principal Software Engineer FOSDEM 2019€¦ · Client1 Client2... To screen Kernel V4l2 bluetooth alsa va-api DRM. 24 PipeWire | Wim Taymans Video capture Systemd socket

PipeWire | Wim Taymans24

Video capture

● Systemd socket activation in Fedora 29● Gstreamer pipewiresrc● Device Monitor● Autovideosrc → Should work in cheese

Page 9: Wim Taymans Principal Software Engineer FOSDEM 2019€¦ · Client1 Client2... To screen Kernel V4l2 bluetooth alsa va-api DRM. 24 PipeWire | Wim Taymans Video capture Systemd socket

PipeWire | Wim Taymans25

Page 10: Wim Taymans Principal Software Engineer FOSDEM 2019€¦ · Client1 Client2... To screen Kernel V4l2 bluetooth alsa va-api DRM. 24 PipeWire | Wim Taymans Video capture Systemd socket

PipeWire | Wim Taymans26

Portal

Wayland screen sharing

PipeWire-0

Mutter Screen Recording Remote Desktop

Page 11: Wim Taymans Principal Software Engineer FOSDEM 2019€¦ · Client1 Client2... To screen Kernel V4l2 bluetooth alsa va-api DRM. 24 PipeWire | Wim Taymans Video capture Systemd socket

PipeWire | Wim Taymans28

Page 12: Wim Taymans Principal Software Engineer FOSDEM 2019€¦ · Client1 Client2... To screen Kernel V4l2 bluetooth alsa va-api DRM. 24 PipeWire | Wim Taymans Video capture Systemd socket

PipeWire | Wim Taymans29

Audio Support

● Pro Audio model like JACK is choosen● 1 format (float32)● 1 buffer size (but is dynamic in PipeWire)● Channels are split into mono streams● All nodes are woken up in each cycle in turn● Sinks have an audio adapter in front to mix, merge,

resample, split and convert the channels● Sinks are created/destroyed dynamically

● Multiple sinks/sources● Automatic clock slaving

Page 13: Wim Taymans Principal Software Engineer FOSDEM 2019€¦ · Client1 Client2... To screen Kernel V4l2 bluetooth alsa va-api DRM. 24 PipeWire | Wim Taymans Video capture Systemd socket

PipeWire | Wim Taymans30

Audio setup

PipeWire-0

Hw:0

Kernel V4l2 alsabluetooth va-api DRM

SessionManager

Hw:0

a2dpHw:1

Page 14: Wim Taymans Principal Software Engineer FOSDEM 2019€¦ · Client1 Client2... To screen Kernel V4l2 bluetooth alsa va-api DRM. 24 PipeWire | Wim Taymans Video capture Systemd socket

PipeWire | Wim Taymans31

Pro audioPipeWire-0

Hw:0Hw:0

Scope

Ardour

Page 15: Wim Taymans Principal Software Engineer FOSDEM 2019€¦ · Client1 Client2... To screen Kernel V4l2 bluetooth alsa va-api DRM. 24 PipeWire | Wim Taymans Video capture Systemd socket

PipeWire | Wim Taymans32

Audio stream

● Takes input from client (asynchronously)● Does conversion

● Resample● channelmix/volume● Format conversion● Channel splitting into DSP● Decouples server buffer size from client requested

latency● Flush/drain

Page 16: Wim Taymans Principal Software Engineer FOSDEM 2019€¦ · Client1 Client2... To screen Kernel V4l2 bluetooth alsa va-api DRM. 24 PipeWire | Wim Taymans Video capture Systemd socket

PipeWire | Wim Taymans33

Audio server

PipeWire-0

Hw:0

Media player

...

Alsa appSessionManagerJACK app

Page 17: Wim Taymans Principal Software Engineer FOSDEM 2019€¦ · Client1 Client2... To screen Kernel V4l2 bluetooth alsa va-api DRM. 24 PipeWire | Wim Taymans Video capture Systemd socket

PipeWire | Wim Taymans34

API support

● PulseAudio apps● Replacement libpulse.so, libpulse-mainloop-glib.so● Built with streams API

● ALSA apps● PipeWire plugin● Built with streams API

Page 18: Wim Taymans Principal Software Engineer FOSDEM 2019€¦ · Client1 Client2... To screen Kernel V4l2 bluetooth alsa va-api DRM. 24 PipeWire | Wim Taymans Video capture Systemd socket

PipeWire | Wim Taymans35

JACK support

● Integration with device reservation API● When JACK claims device, replace our device with

JACK client and we simply become a jack client.● For sandboxed apps

● Replacement libjack.so● Built on top of native PipeWire

Page 19: Wim Taymans Principal Software Engineer FOSDEM 2019€¦ · Client1 Client2... To screen Kernel V4l2 bluetooth alsa va-api DRM. 24 PipeWire | Wim Taymans Video capture Systemd socket

PipeWire | Wim Taymans36

Page 20: Wim Taymans Principal Software Engineer FOSDEM 2019€¦ · Client1 Client2... To screen Kernel V4l2 bluetooth alsa va-api DRM. 24 PipeWire | Wim Taymans Video capture Systemd socket

PipeWire | Wim Taymans37

Page 21: Wim Taymans Principal Software Engineer FOSDEM 2019€¦ · Client1 Client2... To screen Kernel V4l2 bluetooth alsa va-api DRM. 24 PipeWire | Wim Taymans Video capture Systemd socket

PipeWire | Wim Taymans38

Page 22: Wim Taymans Principal Software Engineer FOSDEM 2019€¦ · Client1 Client2... To screen Kernel V4l2 bluetooth alsa va-api DRM. 24 PipeWire | Wim Taymans Video capture Systemd socket

PipeWire | Wim Taymans39

Latest changes (work branch)

● Unit tests + benchmarks + api cleanups● Client permission API● MIT relicensed● DLL for resampling and audio timing in devices● Cursor and bitmap metadata● Device objects + profiles● Work on pavucontrol (peaks resampler, profiles,

volumes,...)

Page 23: Wim Taymans Principal Software Engineer FOSDEM 2019€¦ · Client1 Client2... To screen Kernel V4l2 bluetooth alsa va-api DRM. 24 PipeWire | Wim Taymans Video capture Systemd socket

PipeWire | Wim Taymans43

Future plans

● More Latency/timing handling between nodes● More session policy (dynamic samplerate, compressed

formats, ...)● Merging devices/clock slaving● Transport● Video path/effects…● JACK handover● Implement missing pulseaudio features

● See https://github.com/PipeWire/pipewire/wiki/TODO

Page 24: Wim Taymans Principal Software Engineer FOSDEM 2019€¦ · Client1 Client2... To screen Kernel V4l2 bluetooth alsa va-api DRM. 24 PipeWire | Wim Taymans Video capture Systemd socket

PipeWire | Wim Taymans44

http://pipewire.orghttp://pipewire.orghttps://github.com/PipeWire/pipewirehttps://github.com/PipeWire/pipewire

Questions?Questions?


Recommended