December 2019

PulseAudio

PulseAudio 13.0 started to switch output to HDMI automatically when module-switch-on-connect is loaded (upstream PulseAudio doesn’t load it by default, but some distributions do). This change was not intentional, and caused very annoying behaviour in cases where waking up the monitor from sleep appears as a plug-in event in ALSA. I changed module-switch-on-connect so that it again ignores HDMI by default.

Earlier in the autumn I started reviewing Arun Raghavan’s patch set for automatically switching device channel configuration when playing a passthrough stream that requires it (Dolby TrueHD and DTS-HD Master Audio), now I have finished the review. There were many things to fix, but the needed fixes are mostly small.

I fixed a buffer overflow bug in volume string parsing (the exact location of the bug was pointed out by Patricia Aas, so doing the fix was trivial).

I found and applied an old patch from Peter Meerwald that fixes a bug in the public API headers. PA_CLAMP_VOLUME is a macro that makes sure that a volume value is within the valid range. It’s part of the public API, but applications couldn’t use it, because it used other macros that were private. The necessary macros are now all public.

I made a small fix to the pa_stream_connect_playback() and pa_stream_connect_record() function documentation. The functions can be given a device name if the application wants to use a particular device, but if the name is omitted, the documentation said earlier that the default sink or source is used. I changed it to make clear that omitting the device name lets the server choose the device. The old wording caused some confusion, because if the server chooses the device, it doesn’t always pick the default sink or source. For example, module-stream-restore may pick a device that has been saved for the application, which often isn’t the global default device.

The preparations for the 14.0 release have started. If everything goes smoothly, we might be able to release it in January.

OpenEmbedded

I continued updating the ALSA recipes to 1.2.1. Updating alsa-lib needed some extra work due to a change in the configure script that didn’t work on OpenEmbedded, and figuring out the reason for the failure took some time. Also, the UCM and topology configuration files were moved to separate repositories which required me to add new recipes for those files. I will still need to update the alsa-utils and alsa-plugins recipes, and then I’ll need to do some additional testing for the updates.

This post was originally written on 2020-01-02, and first made available to my Patreon supporters. Speaking of Patreon – I’m using crowdfunding in an attempt to make it financially sustainable to continue my volunteer work as a PulseAudio maintainer. If you’d like to help, check out my Patreon page (or Liberapay).

November 2019

The PulseAudio maintainers (me, Arun Raghavan and Georg Chini) started to have fortnightly patch prioritization meetings. As a result, the patches that are waiting for review are now ordered by priority, which helps us to focus on the important stuff, and the list is public, so it makes easier to answer questions like “when is my patch going to be reviewed”. The list can be seen here: https://www.freedesktop.org/wiki/Software/PulseAudio/PatchStatus/

It was reported that the pulseaudio man page contained outdated information about running the daemon with real-time scheduling. I improved the documentation.

I revieved a bunch of small patches:

  • Timo Gurr made it possible to disable the installation of shell scripts.
  • Rolf Eike Beer made patch that changes how temporary runtime file paths are constructed. The patch uses the “runstatedir” build variable instead of “localstatedir”, but the new variable is not universally supported, and the patch didn’t provide a fallback, so the patch was not merged at this time.
  • David Heidelberg made a couple of cleanups to the Meson build system.
  • Wim Taymans added an “xauthority” argument to the X11 modules, which is required on some systems to be able to authenticate to the X11 server.
  • Arun Raghavan changed the GitLab CI configuration so that updating the CI container image is easier.

I also did some light review on Hui Wang’s stream routing patches (Georg Chini did the main in-depth review). These patches improve the routing behaviour in multiple situations. So far it has been so that if the user moves an application stream once, module-stream-restore remembers that choice forever and it’s not possible to return the application back to default routing. Now if the user moves a stream to the current default sink, the stream switches back to default routing. Another change is that streams now move automatically when the default sink changes, which is probably the biggest improvement of the patch set.

I finished updating PulseAudio in OpenEmbedded to version 13.0, and I started updating the ALSA recipes to 1.2.1.

This post was originally written on 2019-12-10, and first made available to my Patreon supporters. Speaking of Patreon – I’m using crowdfunding in an attempt to make it financially sustainable to continue my volunteer work as a PulseAudio maintainer. If you’d like to help, check out my Patreon page (or Liberapay).

October 2019

Last month most of my time went into responding to messages on the mailing list and bug tracker. Other than that, I did the following things:

I applied an old patch of mine that made PulseAudio recognize an ALSA jack element called “Speaker”. It was required for PulseAudio to recognize that there’s a speaker output on some sound cards. The patch had been buried in the review queue, and now the user whose bug report originally prompted me to write the patch reminded that the bug was still not fixed after updating PulseAudio.

I reviewed a couple of patches:

  • Christophe Rodriguez fixed module-rtp-send’s “inhibit_auto_suspend” option handling. One of the possible values for the option is “only_with_non_monitor_sources”, which is intended to stop sending audio to the network when using a monitor source and nothing is playing to the monitored sink. That didn’t work, however, due to one inverted check, which is now fixed.
  • Rickie Schroeder fixed a bug in the “pulseaudio-start-x11” script that is usually run when starting a graphical login session. PulseAudio 13.0 added a KDE version check to determine whether module-device-manager should be loaded (it’s not needed with newer KDE versions), but that check didn’t work in all setups. Now the check is more reliable.

On OpenEmbedded front I worked on updating the PulseAudio recipe to 13.0. It still needs some more testing before I can submit the patch.

Some months ago the Raspberry Pi that I used for running a Quassel server (which I use to connect to IRC) managed to break its file system, and I decided to rent a virtual server in the hope that it would be more reliable (this was not the first time the Raspberry Pi broke its file system). The cheap virtual server turned out to constantly have huge latencies for some reason, however, and one morning last month it looked like the big latencies made Quassel unable to keep the connection open to the IRC network. I decided to set up the Raspberry Pi again (this time a RPi 2 rather than the original RPi 1, hopefully the newer model is more reliable).

This post was originally written on 2019-11-05, and first made available to my Patreon supporters. Speaking of Patreon – I’m using crowdfunding in an attempt to make it financially sustainable to continue my volunteer work as a PulseAudio maintainer. If you’d like to help, check out my Patreon page (or Liberapay).

September 2019

PulseAudio 13.0 is out now! Read the release notes to find out what’s new.

Last month I did some work on pavucontrol. I finished the patch that changes the stream device selection button to a drop-down list (that’s still pending review). I also fixed the logic of when pavucontrol shows advanced options for sinks and sources. It used to hide the compressed format configuration for all sinks that don’t have any ports. That didn’t cause problems before, because it used to be so that all sinks that support compressed formats happened to also have ports, but now the null sink also supports compressed format configuration, and the null sink doesn’t have ports. While working on that, I also noticed that the sink and source widgets didn’t handle updates from the server correctly. Every update caused pavucontrol to send a “set port” command to the server using the currently selected port, which often isn’t that harmful, but it could cause trouble in some cases, because PulseAudio needs to know when a port has been selected by the user and when it has been selected as part of some automatic policy. That’s now fixed.

module-null-sink can be configured at load time to support compressed formats, but it didn’t support changing the supported format list at runtime. All the “hard” parts of that were actually already implemented, the only thing missing was a flag that marks the sink as one that supports runtime format configuration. I added that flag, and together with the pavucontrol fixes it’s now possible to use pavucontrol (or pactl) to configure the null sink formats at runtime. That’s not particularly exciting for regular users, though; the compressed format support in the null sink is useful mainly for debugging and testing.

The Modules wiki page was missing documentation for module-null-sink’s “formats” argument, I fixed that shortcoming.

Flat volumes have always been a controversial feature in PulseAudio. If you’re not familiar with the feature, here’s a short summary: with flat volumes the stream volumes control also the sink volume. In the simple case of only one stream, the stream and the sink volume are always the same. In case of multiple streams, the sink volume is set to the maximum of the stream volumes. The purpose of this is to simplify the volume control of an application: the full volume range is always available via the application volume slider, so there’s no need to think about the sink volume. In practice, however, this has caused more harm than good (the worst problem is that some application automatically set their stream volume to 100%, causing the audio to be played at the maximum volume that the hardware can produce), and most large distributions have patched PulseAudio to disable flat volumes by default. I’ve been meaning for a long time to submit a patch to disable the feature by default also in upstream, and now that’s finally done.

Here’s a list of patches I reviewed last month:

  • Samuel Thibault submitted a patch by Svante Signell to make the webrtc-audio-processing library build on GNU/Hurd and GNU/kFreeBSD.
  • Jan Alexander Steffens fixed the module-tunnel-sink build when using Meson, and he also fixed the way how X11 compiler flags are passed to module-tunnel-source.
  • Rasmus Thomsen fixed the Meson build system to work with musl, which requires linking to an external libintl library.
  • Arun Raghavan updated an older merge request that implements automatic channel reconfiguration for passthrough streams. It’s needed for high bitrate passthrough streams (Dolby TrueHD and DTS-HD Master Audio). Support for those high bitrate passthrough streams were advertised in the 13.0 release notes, but it turned out that it didn’t actually work yet, because we forgot that these patches were needed for it to work. I reviewed the first three patches (and requested several changes), I will continue with the rest soon.
  • Peter Levine made a fix for a build failure with Clang 9.0.0. The new Clang version apparently doesn’t like implicit casts from void pointers to unsigned longs.

This post was originally written on 2019-10-10, and first made available to my Patreon supporters. Speaking of Patreon – I’m using crowdfunding in an attempt to make it financially sustainable to continue my volunteer work as a PulseAudio maintainer. If you’d like to help, check out my Patreon page (or Liberapay).

August 2019

There’s not much to report from August, other things distracted me from PulseAudio work. I just replied some issues and emails, and did the following:

  • I improved bootstrap.sh so that when installing from PulseAudio from source, the build system won’t overwrite files in /etc by default (configuration files now get installed under /usr/local/etc instead).
  • I reviewed a patch from Carlos Garnacho to not load settings from the X11 root window except when using SSH with X11 forwarding. This avoids unnecessary use of X11 under Wayland.
  • I started improving pavucontrol’s stream routing UI. Currently selecting the device of a stream is implemented as a button that opens a list of devices as radio buttons in a popup. There was a report that the popup opens in a completely wrong place (different screen) in some environments (the reason seems to have something to do with the popup being implemented using a deprecated API). A button plus popup doesn’t make much sense anyway, a drop-down list is the usual way to implement this kind of selection. Replacing a button with a drop-down list sounds like a simple change, and in some ways it is, but I’m not that experienced with the Gtk API, so this is still a work in progress.

This post was originally written on 2019-09-05, and first made available to my Patreon supporters. Speaking of Patreon – I’m using crowdfunding in an attempt to make it financially sustainable to continue my volunteer work as a PulseAudio maintainer. If you’d like to help, check out my Patreon page (or Liberapay).

July 2019

Things that happened last month:

I reviewed a bunch of things:

  • a couple of bluetooth crash fixes from Frédéric Danis
  • localization related fixes in the Meson build system from Arun Raghavan
  • A2DP fixes from Pali Rohár
  • pasuspender help text improvement from S Page
  • fix in volume related assembly code for a bug that became visible with GCC 9.1 from Arun Raghavan
  • information collection script for debugging purposes from Russell Treleaven

I fixed a bug in pavucontrol that made application icons huge in some cases.

Every once in a while someone pops up in the PulseAudio IRC channel complaining that they can’t move audio of one particular application to a different device, and they don’t have any idea why (pavucontrol doesn’t provide any diagnostics help when moving a stream fails). Usually the application turns out to be a game that uses the OpenAL Soft library. The library disallows stream moves by default, but moves can be enabled in the ~/.config/alsoft.conf configuration file. I finally got around to submitting a bug report to OpenAL Soft, only to find out that the default configuration had been already changed (yay!). The change is pretty recent, and I don’t think it’s included in any OpenAL Soft release yet. I also learned why the library does that. PulseAudio is partly to blame, because module-device-manager moves streams in a way that used to mess up the device selection logic in OpenAL Soft, and disallowing moves was a workaround for that.

I worked on release notes a little bit. We’re pretty close to releasing PulseAudio 13.0 now, and the release notes are pretty much the only major thing remaining to do, if new problems don’t come up. There’s a fair bit of work to do with the release notes – figuring out the important changes requires reviewing a year’s worth of commits.

This post was originally written on 2019-08-09, and first made available to my Patreon supporters. Speaking of Patreon – I’m using crowdfunding in an attempt to make it financially sustainable to continue my volunteer work as a PulseAudio maintainer. If you’d like to help, check out my Patreon page (or Liberapay).

Is Liberapay legal in Finland?

Donating through Liberapay is definitely legal in Finland, but what about asking for donations?

Asking for donations in Finland generally requires a money collection permit (“rahankeräyslupa”), and such permission is only available to associations, foundations and things like that, not to individuals. I have a Liberapay profile for funding my volunteer software development work, and so far I’ve assumed that having that profile is obviously breaking the law. However, Mikaela Suomalainen pointed out that the Gambling Administration (“Arpajaishallinto”) that runs the money collection permit system interprets the law so that a Finnish person who uses an international crowdfunding platform doesn’t need a fundraising permit if the fundraising is not targeted at Finnish residents.

In the light of this new information, the top of my Liberapay page now has a note that asks Finnish residents to not donate. I believe that to be enough to ensure that even if the Gambling Administration finds out about my Liberapay page (unlikely), they won’t sue me. If that leads to losing some potential Finnish donors, that’s not so bad, since at the time of writing, only 2% of my Patreon income is from Finland (this statistic is based on me guessing the supporters’ country of residence based on their names). I don’t know the demographics of my Liberapay supporters, because the donations are anonymous.

Here’s the relevant text from the Gambling Administration web page:

I intend to use an international crowdfunding site on the internet. Do I still need a permit?

You need a money collection permit if the money collection campaign is run in Finland. This is the case when donations are meant to be received from people in Finland. Therefore, using a foreign website or making an appeal for donations in other languages than Finnish or Swedish does not mean that the campaign could be undertaken without a permit. If however, the appeals for donations are clearly targeted outside Finland, it is not a money collection campaign in Finland, and a permit is not necessary.