Thursday, 26 November 2026

bluez news 2026

It's been a while since I've been able to post about something I've been working on, such is the fate of a software “maintenance” engineer[1].

 Here are some things that I've been working on, on the bluez side of Linux Bluetooth. My colleague David Marlin and I used to share the load on the kernel work, with me doing some user-space incursions, but it was decided early 2025 that I focus solely on the user-space side, leaving the kernel side up to David.

meson build system port

  Since summer 2025, I've been refining a patch set to port bluez from autotools to meson. I don't think I need to explain the benefits to most of the readers of this blog, especially when jumping from autotools, but there were definitely some bluez-specific benefits.

  First, it was much easier to implement some long-standing feature requests, such as being able to disable building the bluetoothd daemon or internal libraries, simplifying the use of the ell helper library (it's a copy-paste library that bluez can use from its copy-paste version or from the system[2]), and in addition to the inherent rapidity of meson and ninja, we also made the test suite go from taking 50 seconds under the autotools to less than 4 using meson.

docs!

  Secondly, this meson port made it much easier to find examples of modern API docs deployments in other projects, and I settled on modelling our own docs on xdg-desktop-portal, which also had a mix of D-Bus and command-line tools man pages to display in its HTML documentation.

 

Temporary docs website

This reuses style and logos from another as of yet incomplete project, a modernisation of the BlueZ website (thanks to George Kiagiadakis, Collabora and Jon Wallace design for that work). We're waiting on some infrastructure problems to be solved before at least deploying the new website, hopefully the docs aren't too far behind.

Tests

Thirdly, as I took time to fix some long-standing niggling issues in some command-line tools (e.g. tools hanging when they should time out, timing out when they should wait, etc.), I integrated a simple regression test suite for those utilities, so that I don't have to fix those bugs again in the future.

The tests I added are very much focused on a subset of command-line utilities, but a much bigger end-to-end test suite using the vhci driver, and either VMs or User-Mode Linux also landed thanks to Pauli Virtanen's work. This can run regression and integration tests with bluez and PipeWire which should stop some of the regressions we've seen when doing releases.

Rust?

  Fourthly (yes, we're still making a list), adding meson makes it possible to integrate Rust code into the build system without much special handling. I only had the time to experiment, just enough to create a dummy bluetoothd plugin. This exploratory work still managed to yield some API cleanup patches in bluez, and a couple of bug/docs issues filed against meson.

 At this point, I could probably conclude and make a list of other Linux hardware daemon projects that use meson and C/Rust mixed code bases, but we're not done just yet.

Security policy

  Let’s go back to the infrastructure problems we mentioned above regarding our inability to deploy a new website with its docs. The bluez.org website, and the mail aliases it hosts, stopped working some time earlier this year. You could say that the website itself is probably not such a big deal, but among the e-mail aliases it hosts was the security@ email mentioned in the documentation on how to report security issues...

  I spent a large part of the summer discussing, implementing and documenting the new security policy for bluez so that we could start guiding all of our energy triaging issues that came in outside of the process (remember that the security@ email alias was a blackhole for a couple of months), sorting the issues and fixing them. Thanks to the bluez maintainer Luiz Augusto von Dentz and Marco Benatto from the Red Hat product security team for their help writing something that could help us clearly communicate expectations with security researchers as well as our downstreams (distributions and integrators). 

CVEs

  The internal processes inside the bluez upstream project could still use some refinement, but at least I now know how to publish security advisories and ask for CVEs, creating more work for my downstream self.

  Without getting too much into the details, the bluez project still has a lot of "invisible" work to do.

Sticking the landing

  I mentioned a lot of different types of work above, but as you can imagine, they're still all very much connected:

  • we have integration and regression tests for bugs and security issues
  • we have a build system which we hope will make it easier to build with different analysis tools, debugging options, compilers and Linux variants to catch problems, whether they're security issues or innocuous bugs
  • we have browseable and searchable online documentation
  • we have tools to experiment with more secure programming languages 

But I hope that bluez can follow in the footsteps of projects like QEMU or systemd in adopting meson and Rust for the longer-term sustainability of the project.

What's next

Apart from landing the patch sets for the feature mentioned earlier in this post, I have a couple of personal goals tied to the project.

The first one would be to try and grow that inner maintainer circle. We have weekly meeting amongst bluez contributors from Bluetooth SIG member companies. If your company is a member of the Bluetooth SIG and you have a vested interest in bluez, make yourself known on the BlueZ Slack.

The second one would be to try and modernise our development practices. We've had a lot of problems either getting contributions in the first place (setting up git-send-email is a bit of a chore, especially if you thought the project’s presence on GitHub meant you could contribute there) or following-up past the first patch submission. It’s not uncommon for maintainers to clean up contributions before integrating them, but the e-mail review queue makes it more difficult to resurface interesting contributions that just need a tiny push versus patchsets that require extensive work.

It's not impossible that we switch bluez (just the user-space side) to a forge, likely GitHub because of our use of its security advisory handling. We might be able to switch to Freedesktop.org's gitlab instance, bringing us closer to related projects like PipeWire, but we would need a long-term sponsor for the CI pipeline machines, so don’t hesitate to reach out if it’s something your company would be interested in providing.

[1]: In some countries, I can't call myself an engineer because I don't have an engineering degree, the Wikipedia page on that subject makes for an interesting read. 

[2]: ell also got ported to meson, and is in the process of getting added to the meson wrap database, but a number of patches are still pending that block that work. 

Sunday, 27 July 2025

Digitising CDs (aka using your phone as an image scanner)

I recently found, under the rain, next to a book swap box, a pile of 90's “software magazines” which I spent my evening cleaning, drying, and sorting in the days afterwards.

Magazine cover CDs with nary a magazine 

Those magazines are a peculiar thing in France, using the mechanism of “Commission paritaire des publications et des agences de presse” or “Commission paritaire” for short. This structure exists to assess whether a magazine can benefit from state subsidies for the written press (whether on paper at the time, and also the internet nowadays), which include a reduced VAT charge (2.1% instead of 20%), reduced postal rates, and tax exemptions.

In the 90s, this was used by Diamond Editions[1] (a publisher related to tech shop Pearl, which French and German computer enthusiasts probably know) to publish magazines with just enough original text to qualify for those subsidies, bundled with the really interesting part, a piece of software on CD.

If you were to visit a French newsagent nowadays, you would be able to find other examples of this: magazines bundled with music CDs, DVDs or Blu-rays, or even toys or collectibles. Some publishers (including the infamous and now shuttered Éditions Atlas) will even get you a cheap kickstart to a new collection, with the first few issues (and collectibles) available at very interesting prices of a couple of euros, before making that “magazine” subscription-only, with each issue being increasingly more expensive (article from a consumer protection association).


Other publishers have followed suite.

I guess you can only imagine how much your scale model would end up costing with that business model (50 eurocent for the first part, 4.99€ for the second), although I would expect them to have given up the idea of being categorised as “written press”.

To go back to Diamond Editions, this meant the eventual birth of 3 magazines: Presqu'Offert, BestSellerGames and StratéJ. I remember me or my dad buying a few of those, an older but legit and complete version of ClarisWorks, CorelDraw or a talkie version of a LucasArt point'n'click was certainly a more interesting proposition than a cut-down warez version full of viruses when budget was tight.

3 of the magazines I managed to rescue from the rain

You might also be interested in the UK “covertape wars”.

Don't stress the technique 

This brings us back to today and while the magazines are still waiting for scanning, I tried to get a wee bit organised and digitising the CDs.

Some of them will have printing that covers the whole of the CD, a fair few use the foil/aluminium backing of the CD as a blank surface, which will give you pretty bad results when scanning them with a flatbed scanner: the light source keeps moving with the sensor, and what you'll be scanning is the sensor's reflection on the CD.

My workaround for this is to use a digital camera (my phone's 24MP camera), with a white foam board behind it, so the blank parts appear more light grey. Of course, this means that you need to take the picture from an angle, and that the CD will appear as an oval instead of perfectly circular.

I tried for a while to use GIMP perspective tools, and “Multimedia” Mike Melanson's MobyCAIRO rotation and cropping tool. In the end, I settled on Darktable, which allowed me to do 4-point perspective deskewing, I just had to have those reference points.

So I came up with a simple "deskew" template, which you can print yourself, although you could probably achieve similar results with grid paper.

My janky setup

The resulting picture 

After opening your photo with Darktable, and selecting the “darkroom” tab, go to the “rotate and perspective tool”, select the “manually defined rectangle” structure, and adjust the rectangle to match the centers of the 4 deskewing targets. Then click on “horizontal/vertical fit”. This will give you a squished CD, don't worry, and select the “specific” lens model and voilà.

Tools at the ready

Targets acquired


 Straightened but squished

You can now export the processed image (I usually use PNG to avoid data loss at each step), open things up in GIMP and use the ellipse selection tool to remove the background (don't forget the center hole), the rotate tool to make the writing straight, and the crop tool to crop it to size.

And we're done!


 The result of this example is available on Archive.org, with the rest of my uploads being made available on Archive.org and Abandonware-Magazines for those 90s magazines and their accompanying CDs.

[1]: Full disclosure, I wrote a couple of articles for Linux Pratique and Linux Magazine France in the early 2000s, that were edited by that same company.

Wednesday, 23 October 2024

wireless_status kernel sysfs API

(I worked on this feature last year, before being moved off desktop related projects, but I never saw it documented anywhere other than in the original commit messages, so here's the opportunity to shine a little light on a feature that could probably see more use)

    The new usb_set_wireless_status() driver API function can be used by drivers of USB devices to export whether the wireless device associated with that USB dongle is turned on or not.

    To quote the commit message:

This will be used by user-space OS components to determine whether the
battery-powered part of the device is wirelessly connected or not,
allowing, for example:
- upower to hide the battery for devices where the device is turned off
  but the receiver plugged in, rather than showing 0%, or other values
  that could be confusing to users
- Pipewire to hide a headset from the list of possible inputs or outputs
  or route audio appropriately if the headset is suddenly turned off, or
  turned on
- libinput to determine whether a keyboard or mouse is present when its
  receiver is plugged in.
This is not an attribute that is meant to replace protocol specific
APIs [...] but solely for wireless devices with
an ad-hoc “lose it and your device is e-waste” receiver dongle.
 

    Currently, the only 2 drivers to use this are the ones for the Logitech G935 headset, and the Steelseries Arctis 1 headset. Adding support for other Logitech headsets would be possible if they export battery information (the protocols are usually well documented), support for more Steelseries headsets should be feasible if the protocol has already been reverse-engineered.

    As far as consumers for this sysfs attribute, I filed a bug against Pipewire (link) to use it to not consider the receiver dongle as good as unplugged if the headset is turned off, which would avoid audio being sent to headsets that won't hear it.

    UPower supports this feature since version 1.90.1 (although it had a bug that makes 1.90.2 the first viable release to include it), and batteries will appear and disappear when the device is turned on/off.

A turned-on headset