Skip to content

Pulse Audio

JayBeeDe edited this page Jan 6, 2024 · 1 revision

Overview

Architecture

Design goals

  • Abstraction layer for desktop audio
  • Programmable behaviorv (API)
  • Automatic Setup
  • Flexibility
  • Extensibility

Feature overview

  • Protocols and networking
  • Device drivers
  • Sound processing
  • Sample Cache
  • Stream Management
  • Time Management (latency)
  • Power Saving
  • Automatic Setup and Routing
  • Desktop Integrations
  • Compatibility Layers

Use Cases

  • GUI for switching between different output/input devices
  • Mixing table per application
  • GUI for routing audio to remote device available in LAN
  • Effects
  • Compromise between latency and power saving
  • Integration with any application, even if not compatible

Components

Components

  • libpulse-simple: client library. Is a wrapper around libpulse.
  • libpulse: client and server library. Provides "Asynchronous API" for applications.
  • libpulsecommon: client and server library. Contains parts of libpulse that ar not part of the public API.
  • libpulsecore: server library. Internal API for modules.
  • modules: server extensions. Network protocols, device drivers, desktop integrations.

Definitions

Definitions

  • Source <=> input HW device
  • Source Output <=> Channel <=> input SW source
  • Sink <=> Output device
  • Sink Input <=> Audio playback stream <=> ex: application

Object hierarchy

Object hierarchy

  • Core => 1 instance created at startup (1)
  • Module <=> 1 loadable server extension (*)
  • Client <=> 1 application connected to the PulseAudio server (*). Ex: media player
  • Card <=> 1 physical audio device (*)
  • Device: single input or output port on the card. One card can have several device ports. A port can be used by several devices on the same card
  • Device: virtual device that represents an output or input device. Can have an arbitrary number of streams connected to it:
    • HW device
    • Virtual device or sink: represents a remote network device
    • Monitor device: every sink gets automatically a monitor device (duplicate signal). Can be used to copy the signal somewhere else
  • Stream: recording stream (source output) connected to source | playback stream (sink input) connected to an output device (sink)
    • Application Stream: associated with a client
    • Virtual Stream: not with a client. Represents a remote server or anything else.
  • Sample cache is an in-memory storage for short names batches. Used for event sounds.

API

D-Bus API is too unstable and project has been abandoned

C API is better:

  • Asynchronous API (libpulse): complicated, but complete
  • Simple API (libpule-simple): easier, but synchronous.

Asynchronous API is designed around a main loop. User registers callbacks or can poll. Events can be either subscription events or stream events.

Sources

Clone this wiki locally