>_ DevTrendsen

Language

Home

Languages

Sections

Frontend Backend Mobile DevOps AI / ML GameDev Blockchain Embedded Security
C

What Linus Torvalds Does When He's Tired of the Linux Kernel

Imagine the creator of Linux and Git deciding in his spare time to dive into analog circuit design and digital audio processing. The result is the GuitarPedal project on GitHub. It's a full-featured guitar multi-effect pedal, where Linus himself designed the printed circuit boards in KiCad and wrote the firmware in C.

The project grew out of his old abandoned prototype. Previously it had analog potentiometers, which were a nightmare to configure. Now the pedal has an OLED screen, a pair of encoders, and a fresh microcontroller.

Modular Hardware and Tiny Connectors

The hardware is built on a modular, disassemblable design. Rather than routing the entire circuit on one large board, Linus divided the device into four separate modules.

The first board carries the RP2354 microcontroller from the Raspberry Pi Pico 2 family. The second board hosts the TI TAC51 audio codec, which digitizes the signal from the guitar. The third module contains the 9V power connectors and audio jacks, and the fourth handles the interface with the 128x128 screen, footswitches, and encoders.

Front

The modules connect to each other via a flat 12-pin FFC cable. Data transfer goes over I2C for control and I2S for audio. The boards use HiRose BM28 connectors with a pitch of just 0.35 mm. Torvalds openly states in the README that working with such microscopic components during manual assembly is difficult. But they make it possible to fit everything into a compact enclosure.

The author emphasizes: modularity was needed for experimenting with the layout. If you decide to replicate the design, it would be more sensible to place the codec directly on the connector board and the microcontroller on the control board. This eliminates double-sided assembly and complex ribbon cables.

Inside

Control and Firmware Build

On top of the enclosure sits a monochrome display. Below it are two rotary encoders with built-in buttons and two footswitches.

The upper encoder changes the value of the current parameter, and pressing it switches to the next parameter in the list. The lower encoder scrolls through the effects themselves. The left footswitch enables or disables the selected effect with a tap of your foot, and the right one switches the pedal to signal bypass mode.

The firmware build is straightforward without unnecessary complications. The source code is written in pure C with bindings to pico-sdk and tinyusb. On Linux the process looks like this:

git clone https://github.com/torvalds/GuitarPedal.git
cd GuitarPedal/Software
make prep
make

In the build/ directory, the ready blink.uf2 file appears. To flash the device, you need to hold both encoders when connecting via USB and simply copy the file to the virtual drive that appears.

What's Inside the DSP

The most interesting part of the repository is in the software processing folder. Torvalds wrote his own set of DSP algorithms. The computations run in 32-bit floating-point format.

Here's what the pedal already can do:

  • Noise Gate. The threshold level drops down to -85 dBV. The code calculates attack and decay parameters to cut pickup hum without quickly chopping string tails. The status LED changes brightness when the gate triggers.
  • Compressor. Works with adjustable attack time, decay, and makeup gain level.
  • Boost with signal limiting. Instead of standard wave clipping, Linus used signal folding. When amplitude exceeds the threshold, the wave isn't cut — it wraps back around. This creates a rich harmonic spectrum.
  • Echo and delays. The Echo King effect was ported from the Hothouse project and emulates the Maestro Echoplex tape delay. Basic phaser and flanger are also present nearby.
  • Pitch shifter. Works without heavy fast Fourier transform. The algorithm uses a ring delay buffer with two phases and sinusoidal smoothing at the seams. Adding feedback produces an echo effect with gradual pitch drift.
  • Ten-band equalizer. Each band is adjustable from -20 dB to +20 dB, and the current frequency response is drawn as a graph on the screen.

The code also has a stub for sending audio over USB to a computer, although Linus himself warns about the instability of this part.

Why Look at This Project

The GuitarPedal repository is interesting not so much as a finished musical instrument, but as a clear example of full-cycle embedded development from one person.

Here you can pick up:

  • Ready schematics and layout in KiCad with examples of working on a compact enclosure
  • Native C code for working with an audio codec via I2S on RP2040 and RP2350 chips
  • Clear mathematical algorithms for guitar effects without external heavy libraries
  • Simple UI for OLED screens based on encoders

If you want to understand DSP on microcontrollers or see how Torvalds writes code outside the Linux kernel, studying this repository is definitely worth it.

Related projects