Using a Focusrite 18i8 under Linux

Focusrite’s Scarlett USB audio interfaces are cost-effective units with a wide range of input and output options. Out of the box they can be used by most digital audio workstations on Linux because they are USB class-compliant. However, besides the entry-level models (Solo, 2i2 and 2i4), you will certainly miss a few features for recording that just cannot be accessed due to a lack hardware controls. For these you need to use the Focusrite Control software which – as you can imagine – is available only for Mac and Windows. Fortunately, there is a device specific ALSA driver for the Scarlett devices that exposes mix controls to set gains on the different ins and outs as well as controls to enable Hi-Z or Pad modes on certain inputs. Unfortunately, using alsamixer to set these values is a huge PITA.

Now Robin Gareus, a very active contributor to Ardour, JACK and LV2 made the scarlett-mixer for his Scarlett 18i6 that allows one to control all the parameters with an easy-to-use graphical user interface. Now, I counted one and one together, made the appropriate changes and added support for the 18i8. So, no longer do I need to resort to the borderline crazy Alsa Json Gateway software 🙌

OpenCL resource tracking

I wrote about the woes I had with the abysmal OpenCL implementations by both AMD and NVIDIA. Now, it’s not always the fault of others and I recently had to debug a GPU memory leak originating from our own software. The first thing I needed to indentify was if all OpenCL resources were referenced and dereferenced equally. However, the entire system is (as usual I suppose) a dynamic pile of layers of abstractions, so simple reasoning from the code was out of the question rather quickly. I remembered the GObject tracking library from which I took the interception and backtrace bits, re-implemented the OpenCL calls dealing with resource allocation and unreferencing to make the LD_PRELOAD library Usage is similar to the GObject tracking library gobject-list:

$ LD_PRELOAD=/path/to/ ./app

with an example output like (now):

OpenCL objects alive
Contexts        1/1
Command queues  0/1
Buffers         0/9
Samplers        0/0
Kernels         3/11

Memory leaks
Leaking         0 B

pass and a GNOME search provider

I have been using pass, the “standard unix password manager”, for quite a while now. And I love having it at my disposal because I cannot remember all the account names and different passwords associated with them. Moreover, I can easily distribute the passwords by cloning a repository on the machine I want to have them on. The basic idea is stupidly simple: you tell pass your default GPG key that it uses to symmetrically encrypt a file containing the password and additional metadata. Groups of passwords are created storing them in different sub-directories. On password retrieval pass will print the password or copy it to the clipboard for a limited time.

Now, I love the command line but my main use for a password manager is of course to store passwords for websites. Therefore opening a terminal typing pass and tab-complete the correct password is time consuming and slow. Thankfully, Jonathan Lestrelin wrote a search provider for GNOME shell which means you can simply type the meta key and the password and it will ask pass to open the chosen password. Unfortunately, the search itself was implemented by matching the search term against a regular expression which works well if you type the groups and passwords correctly but fails if you want to search more lazily. I asked for inclusion of a very simple difflib.SequenceMatcher ranked search and now that it is in, it’s just perfect.

Moving music content

I decided to move all music and bass related content to its own platform over at because it does not really fit the technical stuff here. No redirects were set up, so if you happened to have linked there … update your links accordingly.