SlideShare a Scribd company logo
1 of 29
Download to read offline
Open FirstOpen First
PipeWire: a new foundation for
the embedded multimedia
Julian Bouzas
Multimedia Software Engineer
2
What is PipeWire?
3
Fresh multimedia framework for linux
●
Written by Wim Taymans (creator of PulseAudio)
●
Daemon that handles both audio and video devices
●
Handles format conversion, mixing, and re-position
●
Pipeline Based Design
●
Security Permissions
●
Like PulseAudio, but for video Video as well
4
PipeWire
●
Initial idea: PulseAudio for video (PulseVideo)
●
Now: generic multimedia platform service
– Video capture server
●
Camera and other video sources (ex. gnome-shell screencast)
– Audio server
●
PulseAudio and JACK (pro-audio) replacement
●
Borrowing ideas also from CoreAudio, AudioFlinger, and others…
5
The Multimedia Stack
7
External PipeWire Session Manager
●
Setup of devices
– Format
– Mixers
– Effects
●
Creation of links and nodes
●
Grants security and access control of clients
●
Prioritize Devices – Policy (User Specific)
8
Security
●
Fine-grained object access controls per client
– Visible, Read data (R)
– Write data (W)
– Execute methods (X)
●
Each client can be made to “see” an entirely different graph
●
Session manager applies permissions
9
Design
● Modules and Plugins
● Plugins based on SPA (Simple Plugin API)
– Header-only C library with zero dependencies
– Extremely lightweight data structures
– “Like Glib, but not so heavy” - Wim Tayman
10
Performance & Efficiency
● Uses modern linux kernel APIs:
– memfd & dmabuf to zero-copy buffers
– eventfd & timerfd to wake up the processes
● Low-latency real-time capable
– < 1.5 milliseconds possible on desktop
● Much lower CPU usage than PulseAudio
11
CPU Usage Statistics
Playback of a 24bit 96kHz 5.1 channel file, downmixed to 3.1 and resampled to 48kHz
21.33 ms 1.33 ms 2 clients @ 800 MHz
0.7
2.3
2.7
6
% CPU
●
Measurements:
–
21.33 ms (1024 samples / buffer)
–
1.33 ms (64 samples / buffer)
–
1.33 ms with 2 clients
–
1.33 ms with CPU pinned @ 800 MHz
●
Measurements on
Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
●
Comparatively, on 1.33 ms, PulseAudio
uses 100% CPU and fails (underruns)
12
Compatibility APIs
● ALSA apps
– PipeWire PCM plugin
– Built with streams API
● PulseAudio apps
– Replacement libpulse.so, libpulse-mainloop-glib.so
– Built with streams API
● JACK apps
– Replacement libjack.so
– Built on top of low-level PipeWire
13
Who is behind this
● Author: Wim Taymans
– Well-known old GStreamer developer & ex-maintainer
– Sponsored by: Red Hat
● Embraced by PulseAudio developers
– Seen as the next generation of PulseAudio
● Welcomed by ALSA and JACK developers
● License: MIT
14
Status
● Version 0.2 distributed in fedora
– Used for video only
● Version 0.3 to be released soon
– Estimated for later this year
– A lot of audio work & refactoring done
– Bluetooth starting to be fully supported
– Used in AGL (Automotive Grade Linux)
15
PipeWire in AGL
16
PipeWire in Automotive Grade Linux
● Audio system implemented with PipeWire for Connected Cars
– Replaces PulseAudio
– Mixer, Media player & Radio player using the native API
– ALSA compatibility plugin available
● Session manager: WirePlumber
● Merged in Happy Halibut (8.0.0) RC2
● In the future also: video
17
WirePlumber
● First session manager implementation
● Target: reusable session manager for embedded use cases
– we’ll see about desktop…
● Modular & extensible, like PipeWire
● Based on GObject
– To support writing modules using bindings in other languages
18
WirePlumber concepts
● Graph abstraction: Endpoint
– Closer to PulseAudio’s representation (sources, sinks, source-outputs, sink-inputs)
– Described by name & media-class (Audio/Source, Audio/Sink, Stream/Audio/Input,
Stream/Audio/Output)
● Extensibility: Modules & Factories like PipeWire
● Pipewire Proxies and Properties
– GObject-ify the pipewire API (ease of use + access from bindings)
19
Software DSP Endpoint
20
Hardware DSP Endpoint (Unicens)
21
Policy Management
● Decided what app nodes are linked with what device nodes
● Fully configurable with TOML files
● Default Configuration:
– Clients have roles with priorities:
● Multimedia, Navigation, Emergency, ...
– Highest priority wins
– Equal priority: last one wins
– Audio in other apps is automatically paused & restored
22
Other areas needing work
● Finish Bluetooth audio support (planned for AGL 8.0.2)
● Unicens hardware support (planned for AGL 8.0.3)
● Improve API and make it stable
– We are constantly changing it and figuring out what the best API could be
● Better security
– Mechanisms exist but currently all clients are granted full permissions
● Documentation
23
PipeWire Audio Contributions
24
Audio Stream (pw_stream)
●
Nicer than PipeWire low-level API
●
Takes input from client (asynchronously)
●
Does conversion
–
Resampling
–
Channel mixing / volume
–
Format conversion
–
Channel splitting into DSP
–
Decouples server buffer size from client requested latency
●
Flush / drain
25
In GStreamer
●
pipewiresrc / pipwiresink
–
Available upstream
–
Built mainly for video; have issues with audio at the moment
●
pwaudiosrc / pwaudiosink
–
Available in AGL
–
Smooth operation with audio
–
Upstream-Status: Submitted [https://github.com/PipeWire/pipewire/pull/140]
●
All built with the streams API
26
Supported Bluetooth Profiles
●
Only A2DP Sink was included
–
For high quality audio over bluetooth sinks (music - speakers)
●
Included A2DP Source node
–
For high quality audio over bluetooth sources (music - phones)
●
Started including HSP/HFP Sink and Source nodes
–
For comunications (voice – phones)
–
2 Setups: Head Unit, Gateway
27
Showtime
28
Thank you!
29
We are hiring
col.la/careers

More Related Content

What's hot

Audio in linux embedded
Audio in linux embeddedAudio in linux embedded
Audio in linux embedded
trx2001
 
HKG18-402 - Build secure key management services in OP-TEE
HKG18-402 - Build secure key management services in OP-TEEHKG18-402 - Build secure key management services in OP-TEE
HKG18-402 - Build secure key management services in OP-TEE
Linaro
 

What's hot (20)

Audio Drivers
Audio DriversAudio Drivers
Audio Drivers
 
ALSS14: Xen Project Automotive Hypervisor (Demo)
ALSS14: Xen Project Automotive Hypervisor (Demo)ALSS14: Xen Project Automotive Hypervisor (Demo)
ALSS14: Xen Project Automotive Hypervisor (Demo)
 
Linux Internals - Interview essentials 4.0
Linux Internals - Interview essentials 4.0Linux Internals - Interview essentials 4.0
Linux Internals - Interview essentials 4.0
 
Androidのリカバリシステム (Androidのシステムアップデート)
Androidのリカバリシステム (Androidのシステムアップデート)Androidのリカバリシステム (Androidのシステムアップデート)
Androidのリカバリシステム (Androidのシステムアップデート)
 
Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)
 
Audio in linux embedded
Audio in linux embeddedAudio in linux embedded
Audio in linux embedded
 
Linux Audio Drivers. ALSA
Linux Audio Drivers. ALSALinux Audio Drivers. ALSA
Linux Audio Drivers. ALSA
 
Linux Introduction
Linux IntroductionLinux Introduction
Linux Introduction
 
U-boot and Android Verified Boot 2.0
U-boot and Android Verified Boot 2.0U-boot and Android Verified Boot 2.0
U-boot and Android Verified Boot 2.0
 
Trace kernel code tips
Trace kernel code tipsTrace kernel code tips
Trace kernel code tips
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/Core
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)
 
Device tree support on arm linux
Device tree support on arm linuxDevice tree support on arm linux
Device tree support on arm linux
 
Red Bend Software: Separation Using Type-1 Virtualization in Vehicles and Aut...
Red Bend Software: Separation Using Type-1 Virtualization in Vehicles and Aut...Red Bend Software: Separation Using Type-1 Virtualization in Vehicles and Aut...
Red Bend Software: Separation Using Type-1 Virtualization in Vehicles and Aut...
 
Introduction to Linux Drivers
Introduction to Linux DriversIntroduction to Linux Drivers
Introduction to Linux Drivers
 
HKG18-402 - Build secure key management services in OP-TEE
HKG18-402 - Build secure key management services in OP-TEEHKG18-402 - Build secure key management services in OP-TEE
HKG18-402 - Build secure key management services in OP-TEE
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in Android
 
Building Embedded Linux Systems Introduction
Building Embedded Linux Systems IntroductionBuilding Embedded Linux Systems Introduction
Building Embedded Linux Systems Introduction
 
Android media framework overview
Android media framework overviewAndroid media framework overview
Android media framework overview
 

Similar to Embedded Recipes 2019 - Pipewire a new foundation for embedded multimedia

Development of Network Service Infrastructure for Transcoding ...
Development of Network Service Infrastructure for Transcoding ...Development of Network Service Infrastructure for Transcoding ...
Development of Network Service Infrastructure for Transcoding ...
Videoguy
 
Utf 8'en'ibm sametime 9 - voice and video deployment
Utf 8'en'ibm sametime 9 - voice and video deployment Utf 8'en'ibm sametime 9 - voice and video deployment
Utf 8'en'ibm sametime 9 - voice and video deployment
a8us
 
Chapter 15 distributed mm systems
Chapter 15 distributed mm systemsChapter 15 distributed mm systems
Chapter 15 distributed mm systems
AbDul ThaYyal
 
Digital Media Production - Future Internet
Digital Media Production - Future InternetDigital Media Production - Future Internet
Digital Media Production - Future Internet
Maarten Verwaest
 

Similar to Embedded Recipes 2019 - Pipewire a new foundation for embedded multimedia (20)

Embedded Android : System Development - Part IV
Embedded Android : System Development - Part IVEmbedded Android : System Development - Part IV
Embedded Android : System Development - Part IV
 
Embedded Android : System Development - Part III (Audio / Video HAL)
Embedded Android : System Development - Part III (Audio / Video HAL)Embedded Android : System Development - Part III (Audio / Video HAL)
Embedded Android : System Development - Part III (Audio / Video HAL)
 
Mp3 player project presentation
Mp3 player project presentationMp3 player project presentation
Mp3 player project presentation
 
Audio equalizer
Audio equalizerAudio equalizer
Audio equalizer
 
UPnP Forum Overview - H Elenbaas
UPnP Forum Overview - H ElenbaasUPnP Forum Overview - H Elenbaas
UPnP Forum Overview - H Elenbaas
 
Development of Network Service Infrastructure for Transcoding ...
Development of Network Service Infrastructure for Transcoding ...Development of Network Service Infrastructure for Transcoding ...
Development of Network Service Infrastructure for Transcoding ...
 
Thinking about IP migration
Thinking about IP migration Thinking about IP migration
Thinking about IP migration
 
Multimedia Services: Video
Multimedia Services: VideoMultimedia Services: Video
Multimedia Services: Video
 
Gda ipsoc blr_hic_final
Gda ipsoc blr_hic_finalGda ipsoc blr_hic_final
Gda ipsoc blr_hic_final
 
Utf 8'en'ibm sametime 9 - voice and video deployment
Utf 8'en'ibm sametime 9 - voice and video deployment Utf 8'en'ibm sametime 9 - voice and video deployment
Utf 8'en'ibm sametime 9 - voice and video deployment
 
Challenges and experiences with IPTV from a network point of view
Challenges and experiences with IPTV from a network point of viewChallenges and experiences with IPTV from a network point of view
Challenges and experiences with IPTV from a network point of view
 
What’s New in UniVerse 11.2
What’s New in UniVerse 11.2What’s New in UniVerse 11.2
What’s New in UniVerse 11.2
 
Chapter 15 distributed mm systems
Chapter 15 distributed mm systemsChapter 15 distributed mm systems
Chapter 15 distributed mm systems
 
LAS16 100 K1 - Keynote George Grey
LAS16 100 K1 - Keynote George GreyLAS16 100 K1 - Keynote George Grey
LAS16 100 K1 - Keynote George Grey
 
LAS16-100K1: Welcome Keynote
LAS16-100K1: Welcome KeynoteLAS16-100K1: Welcome Keynote
LAS16-100K1: Welcome Keynote
 
Audio and video streaming
Audio and video streamingAudio and video streaming
Audio and video streaming
 
Inria Tech Talk : RIOT, l'OS libre pour vos objets connectés #IoT
Inria Tech Talk : RIOT, l'OS libre pour vos objets connectés #IoTInria Tech Talk : RIOT, l'OS libre pour vos objets connectés #IoT
Inria Tech Talk : RIOT, l'OS libre pour vos objets connectés #IoT
 
The CLAM Framework
The CLAM FrameworkThe CLAM Framework
The CLAM Framework
 
Digital Media Production - Future Internet
Digital Media Production - Future InternetDigital Media Production - Future Internet
Digital Media Production - Future Internet
 
The MRAA and UPM Middleware Libraries
The MRAA and UPM Middleware LibrariesThe MRAA and UPM Middleware Libraries
The MRAA and UPM Middleware Libraries
 

More from Anne Nicolas

Kernel Recipes 2019 - GNU poke, an extensible editor for structured binary data
Kernel Recipes 2019 - GNU poke, an extensible editor for structured binary dataKernel Recipes 2019 - GNU poke, an extensible editor for structured binary data
Kernel Recipes 2019 - GNU poke, an extensible editor for structured binary data
Anne Nicolas
 

More from Anne Nicolas (20)

Kernel Recipes 2019 - Driving the industry toward upstream first
Kernel Recipes 2019 - Driving the industry toward upstream firstKernel Recipes 2019 - Driving the industry toward upstream first
Kernel Recipes 2019 - Driving the industry toward upstream first
 
Kernel Recipes 2019 - No NMI? No Problem! – Implementing Arm64 Pseudo-NMI
Kernel Recipes 2019 - No NMI? No Problem! – Implementing Arm64 Pseudo-NMIKernel Recipes 2019 - No NMI? No Problem! – Implementing Arm64 Pseudo-NMI
Kernel Recipes 2019 - No NMI? No Problem! – Implementing Arm64 Pseudo-NMI
 
Kernel Recipes 2019 - Hunting and fixing bugs all over the Linux kernel
Kernel Recipes 2019 - Hunting and fixing bugs all over the Linux kernelKernel Recipes 2019 - Hunting and fixing bugs all over the Linux kernel
Kernel Recipes 2019 - Hunting and fixing bugs all over the Linux kernel
 
Kernel Recipes 2019 - Metrics are money
Kernel Recipes 2019 - Metrics are moneyKernel Recipes 2019 - Metrics are money
Kernel Recipes 2019 - Metrics are money
 
Kernel Recipes 2019 - Kernel documentation: past, present, and future
Kernel Recipes 2019 - Kernel documentation: past, present, and futureKernel Recipes 2019 - Kernel documentation: past, present, and future
Kernel Recipes 2019 - Kernel documentation: past, present, and future
 
Embedded Recipes 2019 - Knowing your ARM from your ARSE: wading through the t...
Embedded Recipes 2019 - Knowing your ARM from your ARSE: wading through the t...Embedded Recipes 2019 - Knowing your ARM from your ARSE: wading through the t...
Embedded Recipes 2019 - Knowing your ARM from your ARSE: wading through the t...
 
Kernel Recipes 2019 - GNU poke, an extensible editor for structured binary data
Kernel Recipes 2019 - GNU poke, an extensible editor for structured binary dataKernel Recipes 2019 - GNU poke, an extensible editor for structured binary data
Kernel Recipes 2019 - GNU poke, an extensible editor for structured binary data
 
Kernel Recipes 2019 - Analyzing changes to the binary interface exposed by th...
Kernel Recipes 2019 - Analyzing changes to the binary interface exposed by th...Kernel Recipes 2019 - Analyzing changes to the binary interface exposed by th...
Kernel Recipes 2019 - Analyzing changes to the binary interface exposed by th...
 
Embedded Recipes 2019 - Remote update adventures with RAUC, Yocto and Barebox
Embedded Recipes 2019 - Remote update adventures with RAUC, Yocto and BareboxEmbedded Recipes 2019 - Remote update adventures with RAUC, Yocto and Barebox
Embedded Recipes 2019 - Remote update adventures with RAUC, Yocto and Barebox
 
Embedded Recipes 2019 - Making embedded graphics less special
Embedded Recipes 2019 - Making embedded graphics less specialEmbedded Recipes 2019 - Making embedded graphics less special
Embedded Recipes 2019 - Making embedded graphics less special
 
Embedded Recipes 2019 - Linux on Open Source Hardware and Libre Silicon
Embedded Recipes 2019 - Linux on Open Source Hardware and Libre SiliconEmbedded Recipes 2019 - Linux on Open Source Hardware and Libre Silicon
Embedded Recipes 2019 - Linux on Open Source Hardware and Libre Silicon
 
Embedded Recipes 2019 - From maintaining I2C to the big (embedded) picture
Embedded Recipes 2019 - From maintaining I2C to the big (embedded) pictureEmbedded Recipes 2019 - From maintaining I2C to the big (embedded) picture
Embedded Recipes 2019 - From maintaining I2C to the big (embedded) picture
 
Embedded Recipes 2019 - Testing firmware the devops way
Embedded Recipes 2019 - Testing firmware the devops wayEmbedded Recipes 2019 - Testing firmware the devops way
Embedded Recipes 2019 - Testing firmware the devops way
 
Embedded Recipes 2019 - Herd your socs become a matchmaker
Embedded Recipes 2019 - Herd your socs become a matchmakerEmbedded Recipes 2019 - Herd your socs become a matchmaker
Embedded Recipes 2019 - Herd your socs become a matchmaker
 
Embedded Recipes 2019 - LLVM / Clang integration
Embedded Recipes 2019 - LLVM / Clang integrationEmbedded Recipes 2019 - LLVM / Clang integration
Embedded Recipes 2019 - LLVM / Clang integration
 
Embedded Recipes 2019 - Introduction to JTAG debugging
Embedded Recipes 2019 - Introduction to JTAG debuggingEmbedded Recipes 2019 - Introduction to JTAG debugging
Embedded Recipes 2019 - Introduction to JTAG debugging
 
Kernel Recipes 2019 - ftrace: Where modifying a running kernel all started
Kernel Recipes 2019 - ftrace: Where modifying a running kernel all startedKernel Recipes 2019 - ftrace: Where modifying a running kernel all started
Kernel Recipes 2019 - ftrace: Where modifying a running kernel all started
 
Kernel Recipes 2019 - Suricata and XDP
Kernel Recipes 2019 - Suricata and XDPKernel Recipes 2019 - Suricata and XDP
Kernel Recipes 2019 - Suricata and XDP
 
Kernel Recipes 2019 - Marvels of Memory Auto-configuration (SPD)
Kernel Recipes 2019 - Marvels of Memory Auto-configuration (SPD)Kernel Recipes 2019 - Marvels of Memory Auto-configuration (SPD)
Kernel Recipes 2019 - Marvels of Memory Auto-configuration (SPD)
 
Kernel Recipes 2019 - Formal modeling made easy
Kernel Recipes 2019 - Formal modeling made easyKernel Recipes 2019 - Formal modeling made easy
Kernel Recipes 2019 - Formal modeling made easy
 

Recently uploaded

The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 

Recently uploaded (20)

Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban
 

Embedded Recipes 2019 - Pipewire a new foundation for embedded multimedia

  • 1. Open FirstOpen First PipeWire: a new foundation for the embedded multimedia Julian Bouzas Multimedia Software Engineer
  • 3. 3 Fresh multimedia framework for linux ● Written by Wim Taymans (creator of PulseAudio) ● Daemon that handles both audio and video devices ● Handles format conversion, mixing, and re-position ● Pipeline Based Design ● Security Permissions ● Like PulseAudio, but for video Video as well
  • 4. 4 PipeWire ● Initial idea: PulseAudio for video (PulseVideo) ● Now: generic multimedia platform service – Video capture server ● Camera and other video sources (ex. gnome-shell screencast) – Audio server ● PulseAudio and JACK (pro-audio) replacement ● Borrowing ideas also from CoreAudio, AudioFlinger, and others…
  • 6.
  • 7. 7 External PipeWire Session Manager ● Setup of devices – Format – Mixers – Effects ● Creation of links and nodes ● Grants security and access control of clients ● Prioritize Devices – Policy (User Specific)
  • 8. 8 Security ● Fine-grained object access controls per client – Visible, Read data (R) – Write data (W) – Execute methods (X) ● Each client can be made to “see” an entirely different graph ● Session manager applies permissions
  • 9. 9 Design ● Modules and Plugins ● Plugins based on SPA (Simple Plugin API) – Header-only C library with zero dependencies – Extremely lightweight data structures – “Like Glib, but not so heavy” - Wim Tayman
  • 10. 10 Performance & Efficiency ● Uses modern linux kernel APIs: – memfd & dmabuf to zero-copy buffers – eventfd & timerfd to wake up the processes ● Low-latency real-time capable – < 1.5 milliseconds possible on desktop ● Much lower CPU usage than PulseAudio
  • 11. 11 CPU Usage Statistics Playback of a 24bit 96kHz 5.1 channel file, downmixed to 3.1 and resampled to 48kHz 21.33 ms 1.33 ms 2 clients @ 800 MHz 0.7 2.3 2.7 6 % CPU ● Measurements: – 21.33 ms (1024 samples / buffer) – 1.33 ms (64 samples / buffer) – 1.33 ms with 2 clients – 1.33 ms with CPU pinned @ 800 MHz ● Measurements on Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz ● Comparatively, on 1.33 ms, PulseAudio uses 100% CPU and fails (underruns)
  • 12. 12 Compatibility APIs ● ALSA apps – PipeWire PCM plugin – Built with streams API ● PulseAudio apps – Replacement libpulse.so, libpulse-mainloop-glib.so – Built with streams API ● JACK apps – Replacement libjack.so – Built on top of low-level PipeWire
  • 13. 13 Who is behind this ● Author: Wim Taymans – Well-known old GStreamer developer & ex-maintainer – Sponsored by: Red Hat ● Embraced by PulseAudio developers – Seen as the next generation of PulseAudio ● Welcomed by ALSA and JACK developers ● License: MIT
  • 14. 14 Status ● Version 0.2 distributed in fedora – Used for video only ● Version 0.3 to be released soon – Estimated for later this year – A lot of audio work & refactoring done – Bluetooth starting to be fully supported – Used in AGL (Automotive Grade Linux)
  • 16. 16 PipeWire in Automotive Grade Linux ● Audio system implemented with PipeWire for Connected Cars – Replaces PulseAudio – Mixer, Media player & Radio player using the native API – ALSA compatibility plugin available ● Session manager: WirePlumber ● Merged in Happy Halibut (8.0.0) RC2 ● In the future also: video
  • 17. 17 WirePlumber ● First session manager implementation ● Target: reusable session manager for embedded use cases – we’ll see about desktop… ● Modular & extensible, like PipeWire ● Based on GObject – To support writing modules using bindings in other languages
  • 18. 18 WirePlumber concepts ● Graph abstraction: Endpoint – Closer to PulseAudio’s representation (sources, sinks, source-outputs, sink-inputs) – Described by name & media-class (Audio/Source, Audio/Sink, Stream/Audio/Input, Stream/Audio/Output) ● Extensibility: Modules & Factories like PipeWire ● Pipewire Proxies and Properties – GObject-ify the pipewire API (ease of use + access from bindings)
  • 21. 21 Policy Management ● Decided what app nodes are linked with what device nodes ● Fully configurable with TOML files ● Default Configuration: – Clients have roles with priorities: ● Multimedia, Navigation, Emergency, ... – Highest priority wins – Equal priority: last one wins – Audio in other apps is automatically paused & restored
  • 22. 22 Other areas needing work ● Finish Bluetooth audio support (planned for AGL 8.0.2) ● Unicens hardware support (planned for AGL 8.0.3) ● Improve API and make it stable – We are constantly changing it and figuring out what the best API could be ● Better security – Mechanisms exist but currently all clients are granted full permissions ● Documentation
  • 24. 24 Audio Stream (pw_stream) ● Nicer than PipeWire low-level API ● Takes input from client (asynchronously) ● Does conversion – Resampling – Channel mixing / volume – Format conversion – Channel splitting into DSP – Decouples server buffer size from client requested latency ● Flush / drain
  • 25. 25 In GStreamer ● pipewiresrc / pipwiresink – Available upstream – Built mainly for video; have issues with audio at the moment ● pwaudiosrc / pwaudiosink – Available in AGL – Smooth operation with audio – Upstream-Status: Submitted [https://github.com/PipeWire/pipewire/pull/140] ● All built with the streams API
  • 26. 26 Supported Bluetooth Profiles ● Only A2DP Sink was included – For high quality audio over bluetooth sinks (music - speakers) ● Included A2DP Source node – For high quality audio over bluetooth sources (music - phones) ● Started including HSP/HFP Sink and Source nodes – For comunications (voice – phones) – 2 Setups: Head Unit, Gateway