December 2016

I fixed a crash that happened if module-combine-sink was used on top of a filter sink, and the filter sink was removed while the combine sink was running.

It was reported that module-xenpv-sink fails to build. I contacted Giorgos Boutsioukis (the module author) in hopes of getting some clues about why the module might have suddenly stopped building. He didn’t have ideas about the build failure, but he explained that the module has probably never been used by anyone (if I understood correctly, there was a project to develop an audio driver in Xen which the PulseAudio module was intended to use, but the driver was never adopted in Xen). We decided to remove the module from PulseAudio.

I addressed a couple of licensing issues: the license text for the audio filtering code copied from WebKit was not being included in release tarballs, and the top-level license file didn’t mention that the qpaeq utility is licensed under AGPL. Regarding qpaeq, I added the missing note to the top-level license file, but I also started the process to relicense qpaeq from AGPL to LGPL like the rest of PulseAudio code. I haven’t yet received permission from all qpaeq contributors to change the license.

A serious regression was about to creep in the 10.0 release (streaming would stop if a client sent “proactively” more data than the server had requested), but luckily Ahmed Darwish noticed it while working on a different bug. I made a fix for that.

It seemed that I could make the first 10.0 release candidate in December, but due to last minute problems it was postponed a bit. Now the release candidate is out, however, so please test it if you can!

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

November 2016

Preparing for the 10.0 release

I continued to work on the combine sink crash that is blocking the release. My fix (which still needs some work) changes the core memory handling in such an invasive way that I think it’s best to postpone merging it after the release so that it gets a bit more testing before becoming widely used. The crash that it fixes is so rare that it’s not very serious if we don’t get the fix in the upcoming release.

My patch for making module-raop-sink compatible with the newest openssl release got reviewed, and I had to make a couple of revisions for the patch. Now it’s merged.

Ahmed Darwish was awesome and fixed two blocker bugs (97769 and 98475), so now only two release blockers remain: removing module-xen-sink and fixing one crash. module-xen-sink will be removed, because it doesn’t build any more, and the module author said that it’s probably not used by anyone. Removing the module is easy, and the remaining crash looks like it will be easy to reproduce, so hopefully we can publish the first release candidate in December.

Other things

I had prepared a libsamplerate update for OpenEmbedded earlier, and now that the OpenEmbedded-Core repository was unfrozen after a release, I submitted the update and cleaned up the libsamplerate packaging a bit. I also studied some odd bits of the OpenEmbedded alsa-lib packaging, resulting in a couple of minor fixes.

Hajime Fujita submitted a new version of his big RAOP patch set that makes module-raop-sink compatible with more recent AirPlay hardware. The patches have existed for a long time, but nobody has had time to review them. This time around Anton Lundin helped by reviewing some of them. It was also discussed that it might be best to skip the review step for the patches if nobody has time for reviewing, since the patches mostly affect just module-raop-sink and that module is becoming more and more obsolete due to only supporting old hardware.

It was reported that the “System Sounds” volume slider doesn’t affect the sounds that are played by module-x11-bell. X11 has its own volume setting for bell sounds, and PulseAudio used to honor that setting, but since the result is a confusing UI, I changed module-x11-bell so that it uses the system sound volume instead of the X11 volume.

This post was originally written on 2016-12-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.

September 2016

Here’s my first monthly summary! Last month I made the decision to start a Patreon campaign, and the first concrete action towards that was to start writing notes every day about things I did, because it was clear from the beginning that monthly reports would be a part of the campaign, and there was no way I could write them without notes. So, let’s see what the notes say…

The loopback patches

The month began with reviewing the last few loopback patches from the big patch set that I had started reviewing already a while ago. Georg Chini has been working on them for a long time, this was already the sixth iteration. The patches include many improvements, my favourite is that module-loopback shouldn’t any more accumulate huge latencies if the audio consuming device (speakers) is for some reason slow to start. It’s also nice that it’s now much clearer to me how the dynamic sample rate regulation works in principle. Previously even the basic logic was unclear to me, now it works simply by measuring the end-to-end latency every now and then, and if it’s something else than desired, the sample rate is adjusted accordingly. The specifics of the regulator still go above my head, but according to Georg’s measurements, the latency should be very stable, and the new regulator should work much better than the old one.

Some of the patches were accepted, but most of the good stuff will have to wait until Georg submits the seventh iteration.

Improving default device selection

I decided to tackle bug 93006 (“headphone output is not preferred over HDMI”), even though there are release blocker bugs open and this was not one of them. I try to make occasional contributions to OpenEmbedded(/Yocto) beyond just the routine package updates, and this kind of falls into that category. My understanding is that the bug was found as part of the Yocto project’s QA process. The bug probably isn’t a serious problem for the Yocto folks, but I was motivated to fix it anyway (the problem is certainly not some weird corner case that would only affect Yocto).

So the problem was that the default sink was chosen badly. Headphones should be preferred over HDMI by default. Sinks have a priority value assigned to them, and the priorities are used to determine which sink is the default. Obviously there was something wrong with the priorities.

Headphone and HDMI output priorities are actually associated with ports, not sinks. The headphone port already has a higher priority than the HDMI port, so that was not the issue, but when the default sink is chosen, only sink priorities matter and the port priorities are ignored. I figured that there’s no need to have separate priorities for sinks and ports, so I changed things so that the sink priority is always the same as the priority of the active port. If a sink has multiple ports, the sink’s priority changes when changing the port.

My patches haven’t been reviewed yet, which means that the fix won’t be in the upcoming 10.0 release.

There’s still the problem that if the default sink changes, existing streams don’t get automatically moved to the new default sink (except when using Gnome’s sound settings application). So in the case of HDMI and headphones, my patches fix things so that after headphones are plugged in, new streams will correctly be routed to headphones, but it’s still so that streams that play to HDMI at the time when headphones are plugged in don’t get automatically moved to headphones. I plan to fix this during this month. This behaviour has annoyed me for a long time, so I’m excited to finally make it right.

Enabling memfd by default

PulseAudio 9.0 got the ability to use memfd for shared memory, but the feature wasn’t enabled by default. We want to enable it in 10.0, so I made a simple patch for that. Phoronix created a news story about that, which seemed funny, because users won’t notice any change (with the exception of firejail users, since firejail isn’t compatible with PulseAudio’s old shared memory mechanism). I guess it’s kind of newsworthy, though, since it’s a step towards really useful stuff like safe audio access for untrusted sandboxed applications.

Unfortunately, a serious problem was found relating to memfd. It turned out that 32-bit applications don’t work with 64-bit server if memfd is enabled. This is considered a release blocker bug, so either this will be fixed, or memfd can’t be enabled by default after all. The bug report is here: 67769.

Squashing release blocker bugs

I made some good progress on fixing the bugs that are blocking the 10.0 release. The master branch was frozen on 2016-09-22, but there’s no release candidate yet, because some release blocker bugs are still lacking a fix. Here are the bugs that got attention from me last month:

The new openssl 1.1.0 release is not compatible with code that was written against older versions, so I had to make some changes in module-raop-sink to make it compatible with both old and new openssl versions. It seems weird that an established project like openssl does something like this – libraries should in principle never break compatibility in this way, but I’d guess there was some very good reason for this. I expect distributions to have a lot of fun with transitioning all software to the new openssl version. At least PulseAudio is ready for that transition.

Running out of file descriptors makes the server crash. Fix submitted.

module-rtp-recv crashes when receiving an eight-channel audio stream. Fix submitted.

On some systems unloading a module also removes the module from the memory, which causes crashing if a module unloads itself (this has happened at least with module-bluez5-device). I submitted a fix that makes it safe for a module to unload itself.

The new automatic switching of bluetooth profiles makes the server crash if the bluetooth headset is the only audio device in the system. I started to investigate this, but at the time of writing I don’t have a fix, or even know why the crash happens.

libsamplerate update

On Monday 2016-09-19 the OpenEmbedded recipe reporting system reported that libsamplerate had got a new release (the first new release in years, by the way). That was surprising, since I’m on the libsamplerate mailing list and there was no release announcement (the recipe reporting system found out about the release by monitoring the libsamplerate download page). Nevertheless, I started the usual package update process.

The new release has a new optional dependency on alsa-lib, but the configure script warned about unsupported options when trying to enable or disable the alsa code. Those warnings turned out to be harmless, but I anyway submitted a fix for the configure script to get rid of the warnings.

The current status is weird. I have the package update ready for OpenEmbedded, but the new release has been removed from the libsamplerate web site. The release seemed a bit unfinished from the very start, so I guess the libsamplerate maintainer decided to pull the new release until he has time to do the release properly. The maintainer was travelling last week, but I’d expect something to happen this week.

Miscellaneous patch reviews

Sylvain Baubeau: “Use local icon for zeroconf shared devices” – This improves (in some situations) the device icon shown in GUIs for remote devices. Accepted.

Sylvain Baubeau: “module-gsettings: new module to store configuration using gsettings” – This helps us get rid of the gconf dependency of paprefs (gconf is a dead project). I didn’t review the code in detail, because it was very unclear how the data transition is supposed to be done without causing trouble for paprefs users with old configuration stored in gconf. The discussion is still ongoing, but I expect this to move forward soon.

Jan Steffens: “launch: Remove the already implicit After=pulseaudio.socket” – Cleanup for our systemd service file. Accepted.

Marcin Lewandowski: “core-util: log error if we hit file descriptors limit” – Accepted.

Pali Rohár: “bluetooth: Add support for automatic switch between hsp and a2dp profiles also for bluez5” – PulseAudio 10.0 will have a new feature for automatically switching bluetooth headsets to HSP mode when starting a VoIP call. I haven’t tested this myself, but I hope that this will be a big usability improvement for people that use bluetooth headsets for VoIP calls. This particular patch just adds bluez5 support, because at first this was supported only with bluez4. Accepted.

Pali Rohár: “bluetooth: bluez5: Add profile name to sinks and sources” – This makes A2DP and HSP volumes separate. I hope that’s a good thing. Accepted.

Deepak Srivastava: “xen: Fixed possible memory leak.” – Accepted.

Philip Withnall: “zeroconf-discover: fix a memory leak” – Accepted.

Other things

As usual, some of my time went to responding to questions on the mailing list bug tracker and IRC.

Setting up Patreon and the blog took a significant chunk of time, more than I expected. I expected to launch in September, but I still have things to do before that can happen.

I upgraded my “desktop” computer, a Raspberry Pi 2, from the old Wheezy based Raspbian to the newest release. As was recommended, I did the upgrade by installing the system from scratch. There were some issues with setting up the keyboard layout, so I got an opportunity to contribute to a new project – I submitted a fix for raspberrypi-ui-mods.

Last words

This turned out to be a rather lengthy post. This whole monthly summary thing is new to me – did you like the format? Should there be more or less detail? Would it be better to write two posts per month so that the individual posts would be shorter? Let me know in the comments.

This post was originally written on 2016-10-03, and first made available to my Patreon supporters. In the future these monthly reports will appear on my blog with much less delay than this one. 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.