PulseAudio 11.0 release notes

Changes at a glance

  • Support for newer AirPlay hardware
  • USB and bluetooth devices preferred over internal sound cards
  • The default sink and source configuration is remembered better
  • Bluetooth HSP headset role implemented
  • Bluetooth HFP audio gateway role implemented (requires oFono)
  • Bluetooth HSP audio gateway and HFP hands-free unit roles can be enabled simultaneously
  • Upmixing can now be disabled without bad side effects
  • Avoid having unavailable sinks or sources as the default
  • Option to avoid resampling more often
  • Option to automatically switch bluetooth profile to HSP more often
  • Better latency regulation in module-loopback
  • Changed module argument names in module-ladspa-sink and module-virtual-surround-sink
  • Fixed input device handling on Windows
  • Improved bluetooth MTU configuration (warning! this causes some hardware to not work any more, see the details below for how to fix it)
  • GNU Hurd support
  • Applications can request LADSPA or virtual surround filtering for their streams
  • Support for 32-bit applications on 64-bit systems in padsp

Notes for end users

Support for newer AirPlay hardware

Previously the RAOP sink in PulseAudio only supported an older version of the protocol, which is not any more used in newer AirPlay products. Hajime Fujita has been maintaining his own version of PulseAudio (with patches from several other contributors too) that supports also the newer RAOP protocol version. That work has now been merged upstream.

USB and bluetooth devices preferred over internal sound cards

The prioritization of sinks and sources has been changed so that USB and bluetooth devices are preferred over internal sound cards when the user hasn't explicitly configured which device should be the default. This means that after plugging in an USB sound card or connecting a bluetooth device, it's not necessary to manually set the new device as default.

Update: Some have wondered what's the relationship of this change with module-switch-on-connect, which is often used to achieve the same result. module-switch-on-connect still exists, and is still not loaded by default (because it has undesirable side effects), and can still be useful to many people. In addition to just making the newly plugged in sound card the default sink, module-switch-on-connect also moves existing streams to the new sink. There are plans to eventually make module-switch-on-connect unnecessary, but for now it remains the only way to automatically move existing streams when plugging in a new sound card.

Another update: Most USB devices weren't prioritized over built-in sound cards in 11.0 after all. This should be finally working in 11.1.

The default sink and source configuration is remembered better

Previously, PulseAudio was bad at remembering the user's choice if they set a hotpluggable device (e.g. a USB sound card) as the default sink or source. Now PulseAudio doesn't forget the default device configuration any more. (Now that hotpluggable devices have higher priority in general, it's less often necessary to do any such manual configuration anyway, but this is an improvement nevertheless.)

Bluetooth HSP headset role implemented

The HSP headset role allows PulseAudio to act as a bluetooth headset, so it's possible to connect e.g. a phone to a laptop running PulseAudio, and use the laptop's speaker and microphone for calls made on the phone. This is similar to the previously implemented HFP hands-free unit role, which is supported via oFono. The HSP headset role doesn't use oFono.

Bluetooth HFP audio gateway role implemented (requires oFono)

Bluetooth headsets can now be used also using HFP, in addition to HSP that was already supported. Some newer headsets don't any more support HSP, so this change makes it possible to use such headsets.

The HFP support in PulseAudio depends on oFono, and unfortunately it's not all plug-and-play. See the Bluetooth wiki page for instructions.

Bluetooth HSP audio gateway and HFP hands-free unit roles can be enabled simultaneously

Previously, passing the "headset=auto" argument to module-bluetooth-discover would enable the HSP audio gateway role when oFono is not running, and the HFP hands-free unit role when oFono is running (so only one HSP/HFP role would be active at a time). The HSP audio gateway role doesn't really interfere with oFono, so this was changed so that the HSP audio gateway role will be kept available all the time.

The new HSP headset role implementation does interfere with oFono, however, so that will be disabled when oFono is running.

The "headset=auto" option is now enabled by default. To return back to only the native backend (i.e. no oFono support), pass "headset=native" to module-bluetooth-discover.

Upmixing can now be disabled without bad side effects

By default, PulseAudio will play a stereo stream to all speakers (except subwoofer) of a surround system. Many people don't like this. It has been possible to disable all remixing by setting "enable-remixing = no" in daemon.conf, but that breaks other use cases where remixing is useful (perhaps the most silly breakage is that mono streams don't play at all, because the system doesn't have a dedicated "mono speaker").

Now it's possible to leave remixing enabled, and only disable (most) upmixing by setting "remixing-use-all-sink-channels = no" in daemon.conf. Mono streams will still be upmixed to front-left, front-right and center channels.

Avoid having unavailable sinks or sources as the default

The default sink and source are now automatically changed if the current default becomes unavailable. This mostly affects systems that have HDMI and analog audio on separate cards. If the HDMI sink was set as the default, and the HDMI cable is unplugged, the analog sink is automatically set as the default.

Option to avoid resampling more often

By default, PulseAudio will configure hardware to use 44.1 kHz or 48 kHz sample rate, and if applications use some other rate, their audio is resampled to match the hardware rate. Now it's possible to set "avoid-resampling = yes" in daemon.conf, which will make PulseAudio configure the hardware to whatever rate the application uses (if the hardware doesn't support the application's rate, resampling is of course still done).

The feature is disabled by default, because ultrasonic audio can cause distortion in the audible frequency range. See the "192kHz considered harmful" section in this article: https://people.xiph.org/~xiphmont/demo/neil-young.html

Option to automatically switch bluetooth profile to HSP more often

By default, module-bluetooth-policy automatically switches from A2DP to HSP when a recording stream appears that has the media.role property set to "phone". To better support VoIP applications that don't set the property (perhaps because they use the ALSA API that doesn't have the concept of stream properties), module-bluetooth-policy can now be configured to switch to HSP also if a recording stream appears with the media.role property unset.

The feature is controlled by the "auto_switch" module argument for module-bluetooth-policy. Previously the argument was a boolean that enabled or disabled the automatic profile switching. Now the argument's type is integer, with the following supported values:

  • 0: disable the automatic profile switching altogether
  • 1: enable the automatic profile switching for streams with media.role=phone (this is the default mode)
  • 2: enable the automatic profile switching for streams with media.role=phone and streams with media.role unset

To keep backwards compatibility with old configuration files, boolean values are still accepted: "true" maps to option 1 and "false" maps to option 0.

Better latency regulation in module-loopback

The latency of module-loopback can be configured, but so far it hasn't been very good at actually implementing the requested latency. It used to be so that during startup the latency was rather random, and it would take a long time before the module would adapt to the requested latency. Now the startup latency should reflect the requested latency much more accurately.

module-loopback will now also try to ensure that the configured latency isn't too low to avoid glitches, but if underruns nevertheless occur, the loopback's target latency is increased automatically.

Changed module argument names in module-ladspa-sink and module-virtual-surround-sink

The master sink for module-ladspa-sink and module-virtual-surround-sink is now specified using the "sink_master" module argument instead of "master". The reason for the change is to be consistent with other modules that use "sink_master" as a module argument name. The old "master" module argument continues to work for the time being (a warning will be logged), but the old argument may be removed in the future.

Fixed input device handling on Windows

The Windows audio module, module-waveout, had pretty broken handling for input devices. The module arguments "device" and "device_name" were used for selecting both the input and output device, but the arguments worked properly only for output. Those module arguments have now been replaced by new arguments: "output_device", "output_device_name", "input_device" and "input_device_name". That allows the input device to be configured properly.

Improved bluetooth MTU configuration

The packet size (a.k.a. MTU, "maximum transmission unit") that PulseAudio uses with the bluetooth HSP profile was previously always configured to be 48 bytes. That worked with most hardware, but some adapters require a different packet size. Now PulseAudio asks the kernel what packet size should be used, which fixes the problem.

However, a new problem appeared: some adapters that used to work with 48 byte packet size don't any more work with the size that the kernel tells PulseAudio to use. If you find that HSP audio stopped working when upgrading to PulseAudio 11.0, you can revert to the old behaviour by passing option "autodetect_mtu=no" to module-bluetooth-discover in /etc/pulse/default.pa. If that fixes the problem, then please report the problem to the BlueZ and/or PulseAudio developers, so that the kernel can be fixed.

Update: We decided to disable the MTU autodetection in 11.1 by default, because the feature caused too much problems and it looked like the kernel would not really get fixed even when people reported issues.

GNU Hurd support

PulseAudio can now be used on the GNU Hurd kernel. There are no new Hurd specific modules, though; the way to make PulseAudio work on Hurd is to use module-solaris together with software that implements the Solaris /dev/audio interface. The only change in PulseAudio is that module-solaris was slightly modified so that it builds on Hurd. More information here: https://github.com/dm0-/hurd-rump-audio

Notes for application developers

Applications can request LADSPA or virtual surround filtering for their streams

module-ladspa-sink and module-virtual-surround-sink weren't previously compatible with the module argument interface that module-filter-apply expects from filter modules, but now they are. Another problem was that these two filter modules require arguments that module-filter-apply couldn't figure out on its own. It's now possible to tell module-filter-apply what the filter module arguments should be.

To request LADSPA filtering, set the "filter.apply" stream property to "ladspa-sink" and pass the required module arguments with "filter.apply.ladspa-sink.parameters" (multiple arguments are separated by spaces). Similarly, to request virtual surround filtering, set the "filter.apply" stream property to "virtual-surround-sink" and pass the module arguments with "filter.apply.virtual-surround-sink.parameters".

For documentation on what arguments the modules expect, see the Modules page.

The new module argument passing capability can also be utilized with the modules that module-filter-apply supported before (module-echo-cancel and module-equalizer-sink).

Notes for packagers

Support for 32-bit applications on 64-bit systems in padsp

padsp uses the LD_PRELOAD environment variable to make the wrapped application link to libpulsedsp.so. 32-bit applications on 64-bit systems are problematic, because the correct path to libpulsedsp.so depends on which architecture the application is built for. That means that 32-bit applications don't work, because the library path points to a 64-bit version of libpulsedsp.so. The problem is now solved for systems that use glibc. When the library path contains the string "$LIB", glibc will convert that to the correct directory name depending on the application's architecture.

This is not enabled by default, because the fix doesn't work on non-glibc systems. To enable the fix, pass --with-pulsedsp-location='/usr/\\$$LIB/pulseaudio' to the configure script (this assumes that the prefix is /usr, so adjust the path as needed).

git shortlog

Arun Raghavan (9):
      build-sys: Enable clang-based builds on Travis
      sink, source: Add a mode to avoid resampling if possible
      sink, source: Make rate selection more explicit
      combine-sink: Use PA_MAX instead of ternary operator for clarity
      alsa: Avoid creating tiny memchunks on write iterations
      echo-cancel: Limit the maximum sink/source latency
      echo-cancel: Fix assert with webrtc's built-in drift compensation
      echo-cancel: Try to minimise in-flight chunks in snapshot latency
      padsp: Write only frame-aligned chunks to the stream

Christian Kellner (3):
      sink: Invert priorities to prefer external devices
      sink: Add portable form factor priority (450)
      sink: Add missing 'hifi' form factor to priorities

Colin Leroy (5):
      rtp: New pa_rtsp_options function
      raop: Fix sink getting destroyed after one use
      raop: fix sequence number overflow
      raop: fix typos
      raop: Fix packet retransmission

Corentin Noël (2):
      vala: use the correct syntax
      echo-cancel: Change the DEVICE_MASTER_DEVICE property when changing device

David Mandelberg (4):
      remix-test: test the remixer using different flags
      resampler: Flag for remixing to all sink channels.
      remix-test: test the remixer with PA_RESAMPLER_NO_FILL_SINK set
      daemon-conf: add remixing-use-all-sink-channels option

David Michael (1):
      solaris: Support building on GNU Hurd

Denis Shulyaka (1):
      pacat: fix a memory issue

Felipe Sateler (1):
      padsp: allow overriding library install location

Georg Chini (33):
      bluetooth: Make use of getsockopt() to determine MTU configurable
      bluez5-device: Use correct constants for fixed latency in PA_{SINK, SOURCE}_MESSAGE_GET_LATENCY
      loopback: Rename sink_input_buffer to loopback_memblockq_length
      loopback: correct comments about the thread calling a function
      loopback: Initialize latency at startup and during source/sink changes
      loopback: fix up the previous commit
      bluetooth: use native and ofono backends in parallel with headset=auto
      bluez5-util: Disconnect AG devices when ofono is started and headset=auto
      sink-input/source-output: Don't crash when cork() is called without valid sink or source
      loopback: Fix corking logic of module-loopback
      loopback: Do not skip audio at startup
      loopback: Calculate and track minimum possible latency
      Merge branch 'master' of ssh://git.freedesktop.org/git/pulseaudio/pulseaudio
      loopback: Add hooks to track port latency offsets
      sink-input: Allow sink_input_set_rate() to be called during a move
      loopback: Reset sink input rate when source or sink changes
      loopback: Implement underrun protection
      sample.c: Allow module-loopback to exceed PA_RATE_MAX
      source/sink: Don't let pa_{sink, source}_get_latency_within_thread() return -1 if process_msg() fails
      source/sink: Allow pa_{source, sink}_get_latency_within_thread() to return negative values
      bluez5-util: Fix segfault during shutdown of daemon
      echo-cancel: Fix segfault during profile switch
      virtual sources and sinks: Fix possible segfault
      source/sink: Fix wrong calculation of thread_info.current_hw_volume
      volume: Print a warning when volume is clipped in pa_sw_volume_multiply/divide()
      volume: Fix overflow in percent calculation of pa_*volume_snprint*()
      bluez5-device: Correctly handle suspend/resume cyle for audio gateway role of ofono backend
      virtual sinks and sources: Revert commits
      virtual sources and sinks: Don't double attach a sink input or source output on filter load
      sink/source: Don't update default sink/source before calling PA_CORE_HOOK_{SINK,SOURCE}_PUT
      stream-restore: Ignore sink-inputs/source-outputs that connect a filter to the master
      tunnel-{sink, source}-new: Fix assertion when used with loopback or combine-sink
      bluez5-device: lower sink/source priority for Audio gateway or a2dp source

Grzegorz Kolodziejczyk (1):
      bluez5-device: Log subband count instead of subband flag

Hajime Fujita (14):
      Support IPv6 address in pa_socket_client_new_string()
      rtp: Freeing ioline when disconnecting
      rtp: Introduce pa_rtsp_exec_ready()
      core-util: add pa_strneq macro
      core-util: add pa_split_space_in_place function
      core-util: do in-place search in pa_str_in_list_spaces
      raop: Add UDP protocol handling
      raop: Add address to RAOP device description
      raop: Add IPv6 support
      raop: Silently drop out-of-history retransmission request
      raop: Stop recording when RTSP FLUSH is issued
      raop: Disable is_recording flag when tearing down the connection
      raop: Discard data upon getting EAGAIN on a socket
      raop: Fix memory leaks

Hui Wang (1):
      alsa: make priority of the port headset-mic higher than headphone-mic

Imre Vadász (1):
      context: Check for errno == ECHILD instead of ESRCH after failed waitpid().

Jungsup Lee (1):
      allow-passthrough: Fix indentation

Karl Ove Hufthammer (1):
      i18n: add a Norwegian Nynorsk translation

KimJeongYeon (1):
      i18n: Update the Korean translation

KimjeongYeon (4):
      filter-apply: Fix memory leak in process()
      virtual-surround-sink: Add sink_master argument to enable filter-apply to load the module
      ladspa-sink: Add sink_master argument to enable filter-apply to load the module
      filter-apply: Add ability to pass parameters to a filter module

Luiz Augusto von Dentz (7):
      bluetooth: ofono: Don't attempt to connect if fd is ready
      bluetooth: ofono: Fix asserting when connecting as AG
      bluetooth: ofono: Detect if Connect has been called
      bluetooth: Don't default to native backend
      bluetooth: Auto recover if profile is 'off'
      bluetooth: ofono: Close fd if cannot be accepted
      bluetooth: ofono: Fix failing to parse valid NewConnection

Martin Blanchard (17):
      raop: Cosmetic fixes / Match coding style
      raop: Add pulsecore/core-utils a pa_str_in_list function
      rtp: Random seq number at the beginning of the session
      raop: Parse server capabilities on discovery
      raop: Do not send audio before RECORD response
      raop: Better playback resume handling
      raop: Extract encryption related code into a separate file
      raop: Move base64 implementation to a util file
      raop: Add a MD5 hashing fuction
      raop: Add BA (Basic) and DA (Digest) HTTP authentication helpers
      raop: Merge TCP and UDP code paths + refactoring
      raop: Prefer ALAC encoding to raw PCM if supported by server
      raop: Update and standardise source file headers
      raop: Rework packet's store memory management
      raop: Remove unimplemented code (PCM and AAC)
      raop: Correctly wrap RTP packet sequence number
      raop: Add back initial volume RTSP SET_PARAMETER request on connect

Matthias Wabersich (1):
      raop: Packet retransmission support for UDP

Mihai Moldovan (2):
      build-sys: FlatCarbon is dead. Good riddance.
      coreaudio-device: fix improper memory handling leading to crashes.

Milo Casagrande (1):
      i18n: update the Italian translation

Moo (1):
      i18n: update the Lithuanian translation

Moritz Bruder (2):
      waveout: fix wrong input device
      waveout: add argument deprecation error

Muhammet Kara (1):
      i18n: Updated Turkish translation

Pali Rohár (1):
      bluetooth: Add optional heuristic for switching between hsp and a2dp profiles

Paul Seyfert (1):
      shell-completion: update zsh completion for pasuspender

Peter Meerwald-Stadler (22):
      build: Add Coverity scan model
      raop: Fix double free
      raop: Fix loop searching for port number
      raop: Fail after search for port number
      raop: Fix memleak
      raop: Fix resource leaks
      raop: Fix potential memory leak
      raop: Fix indentation
      raop: Silence unchecked return value warnings
      raop: Fix potential resource leaks
      raop: Fix potential NULL dereference
      build: Use #ifdef to check for #defines
      core-util: Fix description of pa_split()
      raop: Fix check for invalid file descriptor
      raop: Fix potential dereference after NULL check
      raop: Fix potential NULL dereference
      raop: Log if pa_atoi() fails, latency is not used anyway
      raop: Error out on parsing server port component
      core: Assert return value of pa_shared_set/_remove() in dbus-shared
      core: Ignore pa_shared_remove() return value
      oss: Fix dead code
      pulse: Explicitly ignore pa_mainloop_run() return value in thread function

Philip Chimento (2):
      build-sys: Move TLS check after flags additions
      build-sys: Don't override libtoolize

Piotr Drąg (1):
      i18n: update Polish translation

Rafael Fontenelle (1):
      i18n: update the Brazilian Portuguese translation

Renjith Thomas (1):
      bluetooth: fix distorted audio during Bluetooth SCO HFP/HSP playback

Stephen Paul Weber (1):
      raop: Do not flush when RTSP object is not ready

Takashi Sakamoto (1):
      alsa: remove double calls of snd_pcm_prepare()

Tanu Kaskinen (36):
      x11-bell: ignore volume from X11
      thread-test: fix deadlock
      alsa-util: don't crash on devices with more than 32 channels
      iochannel: don't use variable length array in union
      udev-detect: don't use readdir_r(), it's deprecated
      dbus: fix card profile change signals
      bluetooth-policy: retain backwards compatibility
      bluez5-util: fix profile waiting logic
      bluetooth: assert that dbus_message_iter_append_basic() doesn't fail
      bluetooth: allow UTF-8 in device descriptions
      i18n: update the Swedish translation
      thread-mainloop: fix volatile use in example
      pipe-sink: set correct latency
      protocol-native: log who changes card profiles
      memblock: multiple references should make blocks read-only
      ladspa-sink, virtual-surround-sink: fix master sink argument handling
      alsa: don't assume that hw:x is an analog output
      improve default sink/source handling
      core, device-port: check availability when choosing the default device
      jack-sink: fix latency calculation
      sink, source: update the default sink/source on port switches
      sink-input, source-output: don't allow moving streams that are connected to moving filter devices
      i18n: update the French translation
      Revert "bluetooth: Auto recover if profile is 'off'"
      man: fix a copy-paste error
      man: fix typos: "my" -> "may"
      man: fix typo: "the" -> "they"
      fix dbus message leaks
      core: change configured_default_sink/source type to string
      protocol-native: fix bytes-to-usec conversion of "on-the-fly" data
      simple: fix negative latency handling
      build-sys: bump sonames
      build-sys: add coverity/model.c to the tarball
      echo-cancel: don't set latency range if the device doesn't support dynamic latency
      core: ignore devices that are not linked when choosing the default sink or source
      update NEWS

Ted Ying (1):
      simple: Change latency estimation to account for already-read data in pa_simple_get_latency().

Vadim Troshchinskiy (1):
      conf-parser: provide a replacement for scandir on Win32

Wim Taymans (2):
      suspend-on-idle: resume on unload
      backend-native: add support for the HSP Headset role

Yuri Chornoivan (1):
      i18n: update the Ukrainian translation

ced2c (2):
      raop: Fix #36: invalid access to freed object
      raop: Fix #37: OOB access in rtsp_auth_cb

muzena (2):
      i18n: add Croatian translation
      i18n: update the Croatian translation