June 2018

PulseAudio 12.0 is out now! I think I’ve linked to the release notes draft before, so there may not be much new to you, but here are the final release notes anyway: https://www.freedesktop.org/wiki/Software/PulseAudio/Notes/12.0/

The release candidates clearly don’t get very much testing, since an embarrassing crash bug was reported quickly after the 12.0 release. Changing the bluetooth profile from “off” to “a2dp_sink” reliably makes PulseAudio crash. I have now made a fix for that. It’s not clear why the problem started occurring only in 12.0, when the underlying problem seems like something that has existed for quite a while, but anyway, we’ll need to make a 12.1 bugfix release soon.

A more obscure regression was reported related to module-pipe-sink. PulseAudio used to set umask to 022, which means that newly created files were world-readable, if they were in a directory that other users can access (which was generally true only in the system mode). Starting from PulseAudio 12.0 a more secure umask (077) is used, and that broke some use cases of module-pipe-sink, because the pipe file couldn’t be accessed by other users (problematic especially in the system mode). There’s no fix yet.

That’s enough for the release, here are other things that I worked on:

I fixed missing stereo profile on sound cards that can be also used in mono mode and that don’t have ALSA configuration that would define a “front:N” device.

I simplified state handling code for sinks, sources, sink-inputs and source-outputs. A minor bug was reported related to how we determine whether a sink input is drained or not. The whole “drained” concept turned out to be almost unused, and the only use case was obscure enough that I decided to remove the “drained” state from sink inputs. After that I also did some trivial simplification of how sink, source, sink-input and source-output states are read in the code.

A user suggested logging an error message to make debugging easier when we detect that a sound card is not usable due to some other program hogging the sound card to itself. That was easy enough to do, so I made a patch for that.

A broken link to the GitBranches wiki page was reported. I fixed the link and updated the page contents as well, since they weren’t entirely up-to-date any more. I also updated the Bluetooth wiki page to reflect the changes in 12.0.

I also reviewed a bunch of patches and did my best to be responsive on the mailing list and bug tracker, as usual.

This post was originally written on 2018-07-01, 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).

May 2018

Last month the first release candidate was released, so PulseAudio 12.0 is near 🙂 I did the release routine for that. In other news, I made various small fixes:

  • In X11 environments PulseAudio stores some information in the X server’s root window (the reason is to make audio work when using X remotely – I won’t go into the details here). The most important bit is the server address. The address in the root window used to override the “default-server” option in client.conf, which can cause confusion, because the user is likely not aware of the root window thing, so it can be baffling why setting the “default-server” option doesn’t seem to do anything. I made a patch that reverses things so that options set in client.conf override the settings in the X root window.
  • Arun Raghavan has been working on adding support for TrueHD and DTS-HD passthrough streams. The channel maps for such streams were not being set correctly, which I fixed.
  • Sometimes PulseAudio did uninitialized variable access when dealing with passthrough stream volumes. Fixed.
  • A weird crash due to null pointer dereference was reported in module-alsa-card. I found one possible reason for that and made a fix, but the reason seems so unlikely that I suspect there to be some other underlying bug. The crash isn’t reproducible, however, so there’s not much I can do to debug further.
  • I noticed a small memory leak in module-rtp-send. Fixed.
  • I noticed that a hook callback in module-allow-passthrough was returning invalid values in error handling code. Fixed.

I also did many patch reviews (mostly small stuff, though). A couple of more noteworthy things:

  • I reviewed the fourth iteration of Georg Chini’s patch to fix A2DP latency reporting. The patch was good, so finally A2DP should be quite usable for watching videos.
  • Arun Raghavan made patches for automatically changing a sink’s channel count when playing a passthrough stream, and I reviewed those. It’s more complicated than I thought, and the patches need some more work.

Running PulseAudio in the system mode requires disabling the user service’s socket activation for all users in systemd. This was not documented on the SystemWide wiki page, but now it is. I also updated the page contents in general.

I also did version upgrades for the libvorbis and ALSA recipes in OpenEmbedded.

This post was originally written on 2018-06-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).

April 2018

My main activity in April was getting the conversion from GConf to GSettings done. I wrote a bit about that in last month’s report, but here’s the summary again: GConf is an old system for storing desktop and application settings, and it’s used by the paprefs application. In the PulseAudio server there’s a GConf module that needs to be loaded when using paprefs. GConf has been unmaintained and deprecated for a long time, but converting paprefs to some other configuration system hasn’t felt urgent enough until now that at least Debian has removed GConf (and consequently paprefs too, because paprefs doesn’t work without GConf). Sylvain Baubeau actually provided patches for converting to GSettings already a couple of years ago, but those were never properly reviewed. I did the review now, fixed the issues that I found, and tested that the migration of old settings works when updating paprefs.

There’s not much else to report. I improved the documentation a bit for the pacmd commands “sudpend-sink” and “suspend-source”, but that’s about it. I did some reviews and replied to many mailing list and bug tracker messages, as usual.

This post was originally written on 2018-05-06, 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).

March 2018

One release blocker is now resolved: after a couple of iterations, my patches for the crash on port switches (and the associated device state change redesign) are now in master. Other things blocking the release have appeared, however. There are fixes for bluetooth and alsa latency issues from Georg Chini that I need to review, a crash in module-allow-passthrough needs to be investigated and fixed, and what I’m currently working on is converting paprefs from GConf to GSettings, which involves adding a new GSettings module in PulseAudio. Debian is getting rid of GConf, and that means that paprefs will be removed from Debian if it’s not converted. The conversion work is mostly done by Sylvain Baubeau, who submitted patches already a couple of years ago, but the patches were neglected (you can blame me). I’m now ironing out the remaining issues.

I haven’t done any OpenEmbedded work in a while, but that changed when libvorbis got a new release. OpenEmbedded Core is in a feature freeze currently, so I didn’t do a full version upgrade, I just backported some security fixes from the new release. While testing the patches on the stable branches of OpenEmbedded, I ran into an unrelated issue with e2fsprogs failing to build on my machine. The OpenEmbedded stable branches have older versions of e2fsprogs, and those were not compatible with glibc 2.27 that I had installed. e2fsprogs upstream already has a fix for the compatibility problem, so I backported the fix and submitted it to OpenEmbedded.

The rest of my my work was the usual discussion and review stuff. One thing worth mentioning about the reviews is that I accepted patches for removing BlueZ 4 support from PulseAudio (will land in PulseAudio 13.0, not the upcoming 12.0 release). BlueZ 4 has been deprecated for many years now, and I’m not aware of any distributions that are still relying on it, except on old (but still maintained) versions. Those old distribution versions are going to be using old PulseAudio anyway, so the only thing that will break is individual users who are using old distributions and are building a new PulseAudio version themselves from source.

This post was originally written on 2018-04-06, 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).

February 2018

We have entered the release preparation phase again. The master branch is frozen, and the first PulseAudio 12.0 release candidate will be published once the remaining release blocker bug is fixed. The bug is about a frequent crash that happens when changing ports on alsa devices. I finished the first version of the patch set for fixing the bug, but in the review discussion there were some ideas for improving the patches, so another version will be needed, which is in progress. There’s a fair bit of labour-intensive refactoring involved, which is why writing the patches is taking some time.

I finally got around writing a second version of an old patch for improving the accuracy of alsa card profile availability information. Alsa card profiles typically have one playback device and one capture device associated with them, and previously only those profiles whose both devices were unavailable were themselves marked as unavailable, so it was possible that during startup PulseAudio would choose to activate a profile whose sink is unavailable, resulting in no audio until the user manually changes the output. Now only profiles whose both devices are available are marked as available, and hence only those profiles are candidates for becoming the initial chosen profile.

It was reported that on OpenSuSE (and apparently on Fedora too) a quick relogin after logging out can result in audio not working. The symptoms included there being two PulseAudio instances running, and the two instances conflicted with each other. It turned out that on logout the PulseAudio daemon from the old login session kept running for a while before terminating itself, but on relogin libpulse didn’t detect the old daemon, and therefore spawned a new instance. The reason for this was that logind (a component of systemd) cleared all files from the user’s “runtime directory” on logout. That directory contains PulseAudio’s socket files, and libpulse depends on those files to determine whether there’s a PulseAudio daemon running. I made a fix that makes PulseAudio exit immediately on logout, so there’s no more risk of the ghost of the old login session messing with the new login session (another solution would have been to use systemd to manage PulseAudio in the login session, but that was an uncomfortably big change for the stable releases of OpenSuSE).

As usual, I also reviewed a bunch of patches and had various discussions on the mailing list and bug tracker.

This post was originally written on 2018-03-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).

January 2018

This month I continued reviewing Georg’s messaging patches (and also had a long discussion thread on the topic). We had some disagreements about how the public API should look like, but those disagreements have been largely resolved now.

It was reported that PulseAudio unnecessarily made dbus-daemon log error messages related to communication with bluetoothd. That was caused by sending a reply to a method call from bluetoothd, when bluetoothd indicated that didn’t want a reply to that call. I made a fix for that.

Raspberry Pi 3 has a bluetooth adapter that apparently is by default configured so that the HSP profile doesn’t work with PulseAudio. I was able to give a hint about similar problems with other adapters, and luckily a workaround for another Broadcom adapter worked also with the adapter in Raspberry Pi 3. Ideally the kernel driver would be fixed to work out-of-the-box, but for now you’ll need to run “sudo hcitool cmd 0x3F 0x01C 0x01 0x02 0x00 0x01 0x01” to make HSP work on Raspberry Pi 3.

The new 2.27 release of glibc added a syscall wrapper (memfd_create) that conflicts with PulseAudio’s internal implementation of that wrapper. I fixed PulseAudio so that it can now be built with both old and new glibc versions.

A recent patch of mine caused a bad case of crashing: whenever ports are changed on an alsa card (e.g. when plugging in headphones), PulseAudio will crash. The patch that introduced this bug is otherwise fine, it just didn’t take into account that the port change callback isn’t always called from the main thread as I assumed, causing things to happen in the wrong thread. I started fixing the issue, but the fix isn’t ready yet. I decided to clean up the core port changing design a bit, since calling the port change callback from different threads is not nice at all.

This post was originally written on 2018-02-06, 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).

December 2017

The Intel HDMI LPE driver continues to cause problems to PulseAudio despite previous attempts at making it work. To recap, the driver acts in an unusual way when the HDMI cable is not plugged in and PulseAudio tries to play audio to it. Of course, PulseAudio shouldn’t play audio to it in that situation, but there are still cases where that might happen. I wrote a patch that immediately suspends the HDMI sink when the cable is unplugged, which should finally make the worst problems go away (PulseAudio used to get killed due to too much CPU use). Even if the sink is suspended, though, streams may still be connected to it, so I made another patch for automatically moving streams away in this situation, but that was rejected in review. Georg Chini made a proposal for a better scheme, which I will implement. Details will hopefully appear in the January report.

I also made a couple of smaller fixes: A recent patch in module-augment-properties introduced a memory leak that was caught by Coverity, and I fixed that. Another recent patch in the build system had a typo that prevented module-default-device-restore from getting loaded, I fixed that too.

In order to make this report appear less short, I’ll mention some patches that I reviewed:

  • Georg Chini fixed a crash related to profile changes (the root cause for the crash remains a mystery, but the patch adds an extra safety check that should make the crash impossible).
  • Arun Raghavan simplified the build system by changing how module symbols are defined (we used to generate “symdef headers” with an m4 script, the script is now gone).
  • Roliga added a new “sink_input_properties” option to module-ladspa-sink that allows setting e.g. a custom description for the virtual stream that the module creates.
  • Samo Pogačnik added a new “use_system_clock_for_timing” option for module-pipe-sink, which makes it possible to use e.g. the “cat” command to write the sink output to a file. Previously “cat” would consume data so fast that streams connected to the pipe sink couldn’t keep up.
  • Andrius Štikonas ported qpaeq from Qt 4 to Qt 5.
  • I reviewed one of the messaging subsystem patches from Georg Chini that I’ve mentioned before.

In other news, Arun Raghavan has been working on a Meson-based build system for PulseAudio. That may or may not be merged soon. It won’t fully replace the old Autotools-based build system at least in the beginning, but it should be usable in many cases, and improve the build speed in those cases.

This post was originally written on 2018-01-04, 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.