Debian Linux on Dell XPS 15

This is a small report and how-to on running Debian on Dell XPS 15 9520. TL;DR: on the whole, it works well use Debian Bookworm or later be aware of sound quality issues of built-in speakers on Linux be aware of possible issues with dock station after hibernation


Working on a new network transport for PulseAudio and ALSA

Last few years I was working on Roc Toolkit, an open-source solution for real-time media streaming over the network. Due to lack of free time, we postponed release several times, but now it’s almost ready. This article is, inter alia, some kind of a pre-release announcement. You can read more about the project here. The …


Ephemeral ports and SO_REUSEADDR

The ephemeral port range is a range of ports used by the kernel when the user wants the socket to be bound to a random unused port. In particular, bind, listen, connect, and sendto may automatically allocate an ephemeral port for AF_INET and AF_INET6 sockets. This behavior is described in the ip_local_port_range section of the …


PulseAudio under the hood

I’m working on the Roc Toolkit open-source project, a development kit for realtime audio streaming over the network. You can read more about the project in these two articles: 1, 2. We decided to implement a set of PulseAudio modules that will allow PulseAudio to use Roc as a network transport. Many Linux distros employ …


Using MiniSAPServer and MiniSAPListener for SAP/SDP

MiniSAPServer is a small program that periodically sends SAP/SDP messages, given a config file and destination address. I’ve prepared a complementary MiniSAPListener program which listens for SAP/SDP messages, and prints them to stdout or passes to a shell command. The source code is mostly extracted from PulseAudio RTP …


File locking in Linux

File locking is a mutual-exclusion mechanism for files. Linux supports two major kinds of file locks: advisory locks mandatory locks Below we discuss all lock types available in POSIX and Linux and provide usage examples.


Reusing UNIX domain socket (SO_REUSEADDR for AF_UNIX)

Unix domain sockets are a networkless version of Internet sockets. They have several advantages: Unix domain sockets are files, so file-system permissions may be used for them when one end is closed (e.g. process exits), SIGPIPE is delivered to another end performance may be up to 2x better See details here.


Decoding and playing audio files in Linux

I was playing with various media libraries recently and have prepared several snippets demonstrating how one can decode and play an audio file in two separate steps. The source code is available on GitHub here and there. The following libraries are used: FFmpeg SoX ALSA (libasound) PulseAudio libsndfile Each snippet is a small …


Xlib usage examples

Xlib (also known as libX11) is an X11 client library. It contains functions for interacting with an X server. This page provides several code snippets implementing complete X11 programs.