Roc Toolkit 0.3 is out!

What’s new Roc Toolkit implements real-time streaming over unreliable networks like Internet and Wi-Fi. It works on Linux and macOS and provides C library, CLI tools, modules for PulseAudio and PipeWire, and Android app. You can find step-by-step tutorial here. The 0.3 release was focused on: reducing minimum allowed …

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 Table of contents Installing Debian Video 3.5K OLED display WORKS …

Updated tutorial for Roc 0.2

Table of contents What’s new? Linux desktop (PulseAudio) Linux desktop (PipeWire) Raspberry Pi (ALSA) Raspberry Pi (PulseAudio) macOS Android Troubleshooting What’s new? This article is an updated version of previous tutorial. An overview of the new release is available here. There are two main changes that affect …

Roc Toolkit 0.2 released

(Roc Droid logo) What is Roc? Roc is a toolkit for real-time streaming over unreliable networks. It works with desktop and embedded Linux, ALSA, PulseAudio, PipeWire, macOS, and Android. For a quick intro, see project repo and two previous articles: 1, 2. Summary Full changelog is available here. The main focus of this release …

A step-by-step tutorial for live audio streaming with Roc

Table of contents What is Roc? What’s new? Ubuntu desktop Raspberry Pi (ALSA) Raspberry Pi (PulseAudio) macOS Android / Termux UPDATE You can find tutorial updated for 0.2.x release series in this article. What is Roc? Roc is an open-source toolkit for real-time audio streaming over the network. You can learn about the …

Roc 0.1 released: real-time streaming over the network

What is Roc? I’m happy to announce the first release of Roc Toolkit, version 0.1.0! Roc provides a C API for real-time audio transport. The user just writes a stream to the one end and reads it from another end. Roc, in turn, performs encoding and decoding, and, more importantly, deals with the problems related to the …

Working on a new network transport for PulseAudio and ALSA

Intro 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. …

Ephemeral ports and SO_REUSEADDR

Ephemeral ports 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 …

PulseAudio under the hood

Table of contents Preface About PulseAudio High-level components Key abstractions D-Bus API C API Protocols and networking Device drivers Sound processing Sample cache Stream management Time management Power saving Automatic setup and routing Desktop integrations Compatibility layers Server internals Module list GUI tools …

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

Table of contents Introduction Advisory locking Common features Differing features File descriptors and i-nodes BSD locks (flock) POSIX record locks (fcntl) lockf function Open file description locks (fcntl) Emulating Open file description locks Test program Command-line tools Mandatory locking Example usage Introduction File …

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. Lack of SO_REUSEADDR …

Decoding and playing audio files in Linux

Table of contents Overview FFmpeg SoX ALSA (libasound) PulseAudio libsndfile Other libraries Notes Overview 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. …

SCons rebuilds generated source files every launch

Problem In a large project that uses SCons, VariantDir, and source code generation, happens one of the following: generated source files are rebuilt every time when scons is launched if .sconsign.dblite is removed manually, scons crashes with the following trace: OSError: [Errno 2] No such file or directory: …