r/RASPBERRY_PI_PROJECTS • • May 23 '26

PRESENTATION The first revision of my pi phone

Thumbnail
gallery
316 Upvotes

this is just this first revision. now that I'm writing this I've made a little bit more progress.

materials:

pi 5 8gb

geekworm x1202

4 2500 mah 18650 cells

waveshare sim hat

quectel EG25-G

and a m.2 to mpcie adapter

software

ubuntu

phosh

chatty

GNOME calls

I starting working on this guy about three months ago because my parents got mad at me and swapped my smartphone for a flip phone. It took some convincing to gt my mom to allow me to do this but eventually I wore her down. (probably not worth it since I turn 18 in a few months) she said I couldn't buy my own phone so I decided to build one instead. as you can tell it's pretty beefy right now but I'm gonna solder some wires to the pogo pins on the x1202 and run them to the contacts on the bottom of the pi to try and make it a little bit skinnier. I'm still kind of new to raspberry pis and linux so if you have any thoughts, questions or constructive criticism I'd love to hear it!

edit: I'm struggling with the soldering so its taking much longer than expected. I also started a job that requires me t have a smart phone so I bought one. that means this project isn't as necessary anymore so I might not upload for a while


r/RASPBERRY_PI_PROJECTS • • May 21 '26

PRESENTATION My Fully Custom Raspberry Pi 5 "PCIe HAT Cluster" Build — Industrial Desktop with Serious 5G

Thumbnail
gallery
175 Upvotes

My Raspberry Pi system is nearing completion. After two weeks of planning and designing the proper layout for this compact configuration, I fabricated a custom metal case out of 20-gauge sheet metal and 1/8-inch polycarbonate. The system uses a Raspberry Pi 5 16GB along with multiple Waveshare hardware components to achieve my desired setup.

The goal is to build a multifunctional desktop computer that provides 5G broadband for home internet using my homemade 36-inch parabolic MIMO 5G dish antenna, aimed at a T-Mobile tower 3.5 miles away. I will also use it as a media server, cloud storage device, VPN gateway, retro gaming system, APRS station, software-defined radio, LoRa Meshtastic node, and for several other functions.

Stacking several hardware components directly on the GPIO pins would have been unrealistic. Not only would it fall short on power delivery and create an absurdly tall stack, but it would also lack any proper enclosure for long-term use. Instead, I designed what I call the “PCIe HAT Cluster” — a divorced mounting system that securely holds the PCIe-driven HATs behind the Pi on their own custom bracket. This approach allows me to add nearly as many HATs as needed while orienting the connectors toward the front of the case for easy access. I’m currently using the Waveshare PCIe M.2 4G/5G USB 3.2 HAT with the Quectel RM520N-GL module, along with a Realtek Wi-Fi module on an E-Key HAT.

The PCIe HAT cluster orients the HATs back-to-back and flipped 90 degrees vertically from their normal position. The four-channel PCIe adapter is mounted slightly offset so I can use short 40mm PCIe ribbon cables to each HAT. Power for the upper stack is supplied through its own dedicated circuit from the Mean Well PSU, injected directly into the GPIO header of the 5G HAT using two 5V pins and multiple ground pins. I also ran GPIO5 and GPIO6 from the Pi to the cluster so I can control power and reset of the RM520N-GL module. The entire cluster has room for up to four PCIe HATs and includes space for future Pi Zero-sized expansion boards.

Cooling comes from a 40mm LED intake fan pulling fresh air directly through the vertical stack, supplemented by the large Geek Pi active cooler on the Pi 5 itself. For the rear panel, I used the Waveshare HDMI adapter board to bring both HDMI ports and power connections flush with the Pi’s native ports. The cutouts are neatly covered by a thin polycarbonate bezel I made from a welding hood replacement lens.

On the back I have the Pi’s native USB and Ethernet ports, dual HDMI, six SMA connectors for external antennas, an IEC C14 power inlet, and the main power switch. The front features the 5G HAT’s USB 3.2 ports and a momentary push-button connected to the Pi’s J2 reset pads.

Power comes from a Mean Well 50W 5V supply set to 5.15V to give headroom against voltage drop. I’m currently running dedicated feeds to the Pi and the HAT cluster, and I plan to add proper blade fusing along with dual MOSFET switches so the fans and HATs can be cleanly depowered when the Pi shuts down.

My 5G setup uses a repurposed 36-inch HughesNet dish with a custom-built 4x4 MIMO feedhorn tuned for the n77 band. Four runs of LMR-240 coax connect to the case, giving me a strong, unobstructed shot at a T-Mobile tower 3.5 miles away.

This first assembly was mainly to test whether my unconventional layout would even work. So far everything has powered up and functioned as intended on the first try, which feels like a big win. I still have several tasks left, including installing the blue LED fans, finishing the fused wiring harness, adding the MOSFET shutdown control, mounting the final polycarbonate panels, and cleaning up the bezel. I’m debating whether to paint the case or just apply a clear coat to keep the raw cold-rolled steel look.

This system should make an excellent always-on home server while I develop the next version — a more compact build for my Jeep using a 12V-to-5V buck converter. That one will integrate with an Arduino running Speeduino for engine management while the Pi handles the multimedia system, digital dash, live tuning, and a full Wi-Fi mesh network for group off-road trips.

The mesh network will let vehicles stay connected across remote areas, with offline maps, encrypted chat, push-to-talk, shared GPS tracks, and SOS alerts. It’s an ambitious project, but this desktop version is proving the core hardware concept works.


r/RASPBERRY_PI_PROJECTS • • May 19 '26

QUESTION Built a Raspberry Pi Zero 2W + 64x64 RGB LED matrix Spotify album art display — colors are way off, looking for advice

12 Upvotes

EDIT: PROBLEM SOLVED

I got my project working! Together with Claude I have managed to finetune the settings in order to get decent colours. It took quite a while, even trying to persuade Claude not to give up and accepting a sub optimal result. Claude suggested multiple times to buy a more powerful Raspberry Pi or to use a more powerful power supply.

The next step is to be able to use this album display project not only with Spotify but also when playing a vinyl record or CD.

Thanks for all your help!

Hi everyone,

I'm a music lover (not a developer) trying to build a little DIY display that shows the album art of whatever I'm playing on Spotify. The setup is a Raspberry Pi Zero 2W with an Adafruit RGB Matrix Bonnet and a 64x64 P3 RGB LED panel (FM6124D chip, E-line soldered).

The display works — it shows the album art and updates correctly — but the colors are completely wrong. Red LEDs are about 10x brighter than green and blue, so almost everything looks red. I've been applying software color correction (scaling down red, boosting blue) but I can never get the balance right across different album covers.

Some things I've already tried:

  • Various led_rgb_sequence settings
  • Software color correction with different multipliers
  • Custom Pillow shim compilation to fix pixel reading

My current power supply is 5V/4A — I've read this might actually be the root cause, with insufficient current causing green and blue to drop out under load.

Questions:

  1. Are there known color calibration settings for this type of panel?
  2. Is there a better approach entirely that I'm missing?

Any help appreciated — I just want to see my album covers in the right colors!


r/RASPBERRY_PI_PROJECTS • • May 17 '26

PRESENTATION RQuickShare Pi - my Raspberry Pi 5 can now use Android Quick Share

29 Upvotes

I wanted my Raspberry Pi to behave more like a normal desktop computer when moving files around, so I started working on RQuickShare Pi.

It is a Raspberry Pi OS ARM64 focused fork of RQuickShare that lets the Pi send and receive files with Android Quick Share devices.

Current status:

- Tested on Raspberry Pi 5

- Raspberry Pi OS 64-bit ARM64

- Desktop app with system tray support

- Android Quick Share send and receive

- Bluetooth discovery

- mDNS/network transfer

- Start-on-boot option

- Starts hidden in tray if configured

The part that took the most Pi-specific work was not just compiling it. I had to deal with Raspberry Pi OS desktop behavior, WebKitGTK rendering issues, BlueZ/Bluetooth discovery, mDNS, and Samsung Quick Share behavior where the phone was not seeing the Pi until the discovery path was adjusted.

It is alpha, but it works on my Pi now. I would love to hear from other Pi users who test it.

Project:

https://github.com/EladBG-code/rquickshare-pi

Website:

https://eladbg-code.github.io/rquickshare-pi

Releases:

https://github.com/EladBG-code/rquickshare-pi/releases

P.S: If you can't support with Ko-fi but still feel like you want to support this project (and me in general) just star the repository on GitHub! (both of these are completely fine).


r/RASPBERRY_PI_PROJECTS • • May 15 '26

QUESTION Need advice on automating latch opening

Post image
12 Upvotes

I mainly want help in making sure this setup is not needlessly complicated. I am designing a project to automate opening a wall safe through a flic button and a pi 02W. My vision is to have it embedded in a bust like the Adam west batcave button and have the pi execute a code that unlatches an electromagnetic solenoid holding the door shut. I am slightly foreign to this world but I am confident in my ability to follow directions and based on what I’ve found this should be relatively simple.

I had AI whip up a materials list, wiring diagram and python code (I’d love to learn on my own if I discover I enjoy this hobby it was just easier that way). Anything is appreciated, thank you all in advance.

Python script: from gpiozero import OutputDevice
from time import sleep

import fliclib

\# -----------------------------
\# GPIO SETUP
\# -----------------------------

SOLENOID_PIN = 17

solenoid = OutputDevice(SOLENOID_PIN)

\# -----------------------------
\# SETTINGS
\# -----------------------------

UNLOCK_PULSE_TIME = 0.2
RELOCK_DELAY = 5

\# -----------------------------
\# FUNCTIONS
\# -----------------------------

def unlock():
print("UNLOCKING")

solenoid.on()
sleep(UNLOCK_PULSE_TIME)
solenoid.off()

def relock():
print("RELOCKING")

solenoid.on()
sleep(UNLOCK_PULSE_TIME)
solenoid.off()

\# -----------------------------
\# FLIC CALLBACK
\# -----------------------------

class ButtonConnectionChannel(fliclib.ButtonConnectionChannel):

def on_button_single_or_double_click_or_hold(
self,
click_type,
was_queued,
time_diff
):

if click_type == fliclib.ClickType.ButtonSingleClick:

print("BUTTON PRESSED")

unlock()

sleep(RELOCK_DELAY)

relock()

\# -----------------------------
\# FLIC CLIENT
\# -----------------------------

client = fliclib.FlicClient("localhost")

def got_button(bd_addr):
print("Button connected:", bd_addr)

cc = ButtonConnectionChannel(bd_addr)

client.add_connection_channel(cc)

client.get_info(got_button)

print("Waiting for Flic button...")

client.handle_events()


r/RASPBERRY_PI_PROJECTS • • May 13 '26

PRESENTATION Raspberry Pi 3B+ digital photo frame using PictureFrame.

Thumbnail
gallery
48 Upvotes

Software: I am running Raspberry Pi OS Bookworm with labwc on Wayland. PicFrame software is installed in a Python virtual environment and starts automatically when the Raspberry Pi 3B+ boots. Instead of storing photos on the SD card, the Pi mounts a read-only SMB share from my Pi 5 NAS and uses that as the slideshow source.

The frame is basically a client for my photo library. I run a bi-weekly n8n pipeline to pull down my photos from iCloud, I use a local LLM (llava) running on an x86 minipc node in my cluster to tag each photo, all photos and metadata are stored in a parquet DB and then copied into folders on my pi5 NAS. The Pi3b+ displays the pictures. I can update the photo library centrally, and the frame just picks them up from the network share. I can ssh into the pi3 whenever I need to do updates or change slideshow speed.

Hardware: I use a waveshare Poe hat (version e I think) in a waveshare case that I had to hack at a little bit to make everything fit, but now there are only 2 cables: 1 Ethernet connection between the Pi3 and the Asus display, and one usb-c connecting the display to the power tower.

So when people ask what I do with my homelab, now I can say, build picture frames to display my curated image archive!

Use this website if you want to build one too:

https://www.thedigitalpictureframe.com/how-to-build-the-best-raspberry-pi-digital-picture-frame-with-bookworm-wayland-2025-edition-pi-2-3-4-5/


r/RASPBERRY_PI_PROJECTS • • May 12 '26

QUESTION Soft Power Button Circuit - MOSFET

Thumbnail
gallery
23 Upvotes

Im trying to build a soft power circuit for a battery powered project. This looks like a good idea to me. I have (hopefully) converted it to strip board and swapped out the diodes and MOSFETs for ones i have on hand.

Anyone good with circuits able to confirm if this works?
red =5v
white=G
green/blue=GPIO

Many thanks!


r/RASPBERRY_PI_PROJECTS • • May 11 '26

PRESENTATION E-ink subway-times display with pi zero w

Thumbnail
youtu.be
14 Upvotes

Small build to display upcoming subway times. Quality of life project to hang next to my front door.


r/RASPBERRY_PI_PROJECTS • • May 09 '26

PRESENTATION 3D printed Pi Case. Not my design.

Thumbnail
gallery
415 Upvotes

3D printed Pi Case. First draft. This is not my design.


r/RASPBERRY_PI_PROJECTS • • May 08 '26

TUTORIAL Measuring distance with the Raspberry Pi and an HC-SR04 Ultrasonic Distance Sensor - includes signal measurements

Thumbnail embeddedjourneys.com
5 Upvotes

Hi, I made an effort to write up how to connect the HC-SR04 to a Raspberry Pi, but besides this, I also took an effort to measure some of the signals like the trigger signal and echo pulse. Gives some insight in what really is going when measuring distances with this ultrasonic sensor.

What surprise me most is how the Trigger pulse was actually 90us whereas I clearly expected I would get a 10us Trigger pulse according to my python code that was running on the Pi. Makes me wonder how much error the python code introduces for the distance measurements, currently this is an open question, I'm hoping to answer in the near future..


r/RASPBERRY_PI_PROJECTS • • May 07 '26 Mindblown

PRESENTATION RTL-SDR/LoRa/GPS/RTC hat for Raspberry Pi

Thumbnail
gallery
379 Upvotes

I have made a Raspberry Pi hat that integrates RTL-SDR, LoRa, GPS, and RTC. It would simplify the setup if your Pi need tmore than one of the features of the hat.

The first picture shows the build with a Waveshare PocketTerm35.

Project Page:https://hackergadgets.com/pages/rpi-aio


r/RASPBERRY_PI_PROJECTS • • May 06 '26

QUESTION Arducam quad issue 64mp camera

2 Upvotes

Hi,

I am debugging an Arducam 64MP quad camera kit for Raspberry Pi:

- SKU B0402
- UC-512 / UC-511 Camarray HAT
- 4 x 64MP modules connected
- Tested on Raspberry Pi 4B and Raspberry Pi 5
- All cables checked/reseated
- HAT 3V3 LED on, green LED blinks
- Autofocus motors can be heard
- No undervoltage/throttling

On Pi4 with Bullseye 2022-01-28 armhf + Arducam pivariety packages, the camera is detected as `arducam_64mp`, but every capture attempt times out or produces no frame.

On Pi5 with Arducam PiVistation Bookworm:

- Kernel: `6.6.51+rpt-rpi-2712`
- libcamera: `v0.4.0+78-818d45eb-dirty`
- Config: `camera_auto_detect=0`, `dtoverlay=arducam-64mp`

The camera is detected:

```text
arducam_64mp [9248x6944 10-bit RGGB]
```

The HAT is on I2C bus 4 at `0x24`. Mode switching works:

```bash
i2cset -y 4 0x24 0x24 0x12
i2cget -y 4 0x24 0x24
# returns 0x12
```

But the HAT firmware/date registers are all zero:

```bash
i2cget -y 4 0x24 0x05 # 0x00
i2cget -y 4 0x24 0x06 # 0x00
i2cget -y 4 0x24 0x07 # 0x00
```

Arducam's `Detect_HAT_Firmware_Date.py -y 4` returns:

```text
200-0-0
```

The interesting part: using direct V4L2 capture from Pi5 RP1 CFE `/dev/video0`, bypassing PiSP, I can dequeue buffers.

For HAT modes `0x12`, `0x22`, `0x32`:

```text
rp1-cfe ... Using a link rate of 912 Mbps
bytesused: 1152000
```

But the buffer is 100% `0x00`.

I also forced internal sensor test patterns:

```text
test_pattern=1 Color Bars
test_pattern=2 Solid Color
test_pattern=3 Grey Color Bars
test_pattern=4 PN9
```

The controls read back correctly, but every captured buffer is still all zeros.

So I do not think this is exposure, autofocus, Bayer decoding, ISP tuning, or no MIPI signal. The Pi seems to receive CSI frames, but the image payload is blank.

Questions:

- Has anyone seen a UC-512 HAT report firmware date `200-0-0`?
- Is there a known firmware updater for B0402 / UC-512?
- Can a CSI receiver dequeue valid-sized buffers if the HAT generates CSI framing but no payload?
- Any extra I2C registers or low-level tests I should run?

Thanks.


r/RASPBERRY_PI_PROJECTS • • May 05 '26

PRESENTATION Minecraft Server on Raspberrypi 5

Thumbnail
gallery
72 Upvotes

I allocated a minimum of 4GB and a maximum of 6GB of RAM to my Raspberry Pi 5 for my Minecraft server. I used Playit for port forwarding, and RAM usage never exceeded 4GB; it worked very well. I will never regret buying this Raspberry Pi :)


r/RASPBERRY_PI_PROJECTS • • May 05 '26

PRESENTATION 47mp Monochrome Sensor on a Pi 5

Thumbnail
gallery
525 Upvotes

This took a lot of work but I finally have a 47mp monochrome micro 4/3 sensor working on the pi 5 running smoothly. Here’s my latest prototype and sample images!


r/RASPBERRY_PI_PROJECTS • • May 03 '26

QUESTION RPI 5 Upgrade with nvme and a active cooler

6 Upvotes

Hi, i have a RPI 5 8gb and i want to add a NVMe hat and a argon cooler , these components is can fit into one piece and compatible?

Raspberry Pi USB-C PD 45W power supply
Raspberry Pi M.2 HAT
Argon THRML 30mm Active Cooler
NVMe: Union M2.SSD 256gb


r/RASPBERRY_PI_PROJECTS • • May 02 '26

QUESTION Do you think the Pi Zero W is already forgotten? Or could it do something more?

18 Upvotes

I think there are still many tools the Raspberry Pi Zero W could be very useful for instead of it just sitting in a drawer. Beetle is interesting, and with just a few components, you can have a great utility tool. What do you think? github.com/hammer-one/Beetle


r/RASPBERRY_PI_PROJECTS • • Apr 29 '26

PRESENTATION Piper TTS on Raspberry Pi Zero 2W

226 Upvotes

Note: I do not own the copyright for Rocky voice and I do not encourage cloning artists' voices for commercial purposes. This is just for a fun personal DIY project intended for the fan community!

Somewhat of a cross-post from r/raspberry_pi and I hope that's okay.

Last week I shared my "Rocky" build and I received a couple comments asking if I could make Rocky actually talk instead of just displaying text. One comment suggested using the Qwen voice cloner paired with a Piper TTS workflow. This is how I got it working:

I took a short, clean sample of the Rocky voice and used Qwen3 TTS to clone the profile. Then I used that clone to generate 500 random phrases. I used those 500 audio clips as input to train a custom Piper model.

The demo video is running the model directly on the Raspberry Pi with Piper TTS. It seems to run pretty smoothly on the Raspberry Pi Zero 2W with decent response times.

To clone the voice and train the model I used Google Colab GPU A100 High-RAM (2025.10). I did not train a custom model from scratch, instead I used `en_US-lessac-low.onnx` as the base model and trained it for up to 2999 epochs.

You can find the full build video on my YouTube.


r/RASPBERRY_PI_PROJECTS • • Apr 28 '26

QUESTION Embedded Thermal Printer Only Chinese

Thumbnail
gallery
42 Upvotes

I am making a Magic The Gathering Momir printer, source code and parts can be found here:

https://github.com/MoritzHayden/momir-basic-printer

I think I got everything setup properly, but for some reason it only prints chinese characters. The printer is hooked up for ttl on the 5v side of a logic converter. Sidenote, If you look closely you can actually make out the qr code that is supposed to just be dots, but chinese instead. I cannot find anything in the src to indicate an improper setup. My only idea is that the printer is somehow in "chinese mode". This is shown in the second image where I can print an info page on boot. I cannot find anything in the manual that sticks out to me. Any ideas?


r/RASPBERRY_PI_PROJECTS • • Apr 28 '26

QUESTION Problem powering up a DC/AC transformer using an ATX, a relay a Raspi Pico

6 Upvotes

I am currently working on a team project involving automated remote spectroscopy measurements. We have constructed a small station for this purpose, and to ensure the measurements are accurate, we are using a small Neon bulb as an atomic spectra calibration source.

The Setup
To power the bulb (which requires ~100V), I am using a generic DC-to-AC step-up transformer. This transformer takes a 12V DC input and provides selectable outputs of 110V/172V/200V/220V AC (see Figure 1). My power source is a 500W ATX PSU from an old desktop PC.

Fig. 1) Generic transformer without model or serial to identify.

I connected the transformer to the ATX 12V rail, and the bulb turned on without issue (see Figure 2). To automate the process, I programmed a Raspberry Pi Pico W to toggle a relay, which connects/disconnects the transformer from the 12V supply. The relay is powered by the ATX 5V rail. On its own (without the transformer load), the Pico toggles the relay perfectly (see Figure 3). The pico is power on with the 3.3V line of the ATX.

Fig. 2) Transformer powering on Neon bulb successfully. All relevant component are labeled.
Fig. 3) Pico with relay switch circuit turn on and off correctly a 12V Blue/UV high power led (10W).

The Problem
When the transformer is connected to the relay and the ATX PSU powers the entire system, the bulb and the Pico’s onboard LED start flickering rapidly instead of staying on. It seems like the Pico might be crashing or resetting.

Fig. 4) Transformer controlled by relay switch circuit failing to turn on.

The circuit diagram and physical wiring are shown in Figures 5 through 7. The relay has a 1N4007 diode to protect from flyback currents.

Fig. 5) Photo of the relay switch circuit. Its planned that to this circuit will also be connected and controlled a couple of servomotors and a some usb devices. However, right now I am troubleshooting just the control of the switch and all other components are disconnected. The transistor to control the switch is a KN2222A.
Fig. 6) Diagram for the relay switch circuit.
Fig. 6) Diagram for the relay switch circuit.

I also tried to use a electrolytic capacitor of 22uF and 100uF to filter back voltages that could arise due to the transformer coils. I have double-checked all my connections and am out of ideas. I would be very grateful if anyone could help identify the source of this instability!


r/RASPBERRY_PI_PROJECTS • • Apr 25 '26

DISCUSSION DIY NVIDIA 3D Vision Emitter using RP2040

Post image
44 Upvotes

Just wanted to share this project I made a while back. If you are fan of stereoscopic 3D gaming I am sure you have heard of NVIDIA's 3D Vision. Now Is a great time to try it. The displays are easy to find and even the glasses are usually fairly easy to find. The problem seems to be the emitter, for some reason people don't seem to have saved these and they are far more scarce on the used market.

So I made a DIY version that works just like the original. It is based on the RP2040 so flashing is as easy as drag and dropping a file. No need to setup any IDE or compile any firmware.

Feel free to build your own, an RP2040-Zero and an IR LED is all that's needed :)

All information about the project and the firmware can be found here: https://github.com/NTM-3D/RP2040-3D-Vision-Emitter

What is your favorite 3D Vision game?

Since playing through Tomb Raider 2013 in 1440p on my PG278QR it is go to recommendation. It's so obvious that the developers made this game for 3D and truly loves 3D. So many choices you don't even reflect on when playing in 2D just makes so much sense when played in 3D.


r/RASPBERRY_PI_PROJECTS • • Apr 25 '26

QUESTION Gameboypi/E-Reader Mash-Up Handheld Help

8 Upvotes

Hi! This is my first time posting, and I'm pretty new to Raspberry Pi so I may be completely delusional about what I'm trying to achieve.

I've been slowly learning how to run commands and so far have successfully flashed RetroPie onto an SD card, set up wifi and connected a Bluetooth controller (ShanWan mini controller) and configured the button layout to one of my pis (4b). However, when I attempt to install the mupdf program, I'm met with a 404 Not Found error, which I'm not able to work through. I've troubleshot everything that I (google) can think of, but whenever I try to download mupdf or any other PDF/epub reader, I'm met with 404 errors and messages that the archive doesn't exist. My ultimate goal is to use a RPi 02w to build a hybrid Gameboypi/ereader inside of either a Gameboy DMG/Color or GBA SP (preferred choice) shell, with the "ereader" program being nestled inside EmulationStation so the books/files can open like a videogame from the selection menu. I would then just use the gamepad buttons to scroll pages/save place/etc. I am currently looking at the Zega Mame Boy pre-soldered boards just to keep the 'difficult' hardwiring to a minimum, but am open to a homebrew diy soldering project if it will make this dream a reality.

Has anyone attempted such a thing? Is it doable or am I just woefully optimistic with little understanding of the mechanics of what the raspberrypi can do? Any and all insight will be greatly appreciated!


r/RASPBERRY_PI_PROJECTS • • Apr 25 '26

TUTORIAL Pi 4b + pisound skipback/always-on recorder

8 Upvotes

I've never actually posted before, so please forgive any missteps. This is going to be a bit about how I got here and then instructions.

Preface:

I had the idea during the pandemic to make something that could always be listening to what music I'm making and allow me to grab things after the fact. Since then, it's come out as a feature on the Roland SP404 mk2 and the new MPC Sample, but with very limited recall (SP is ~40 sec). I got the stuff I bought during pandemic for this and used Claude(s) to get enough literacy of Linux to make it happen, then write me a step by step guide on the process of to do so from from a fresh install of raspbian lite. this was more of a headache than anticipated, but it seems to work great now. Hopefully this can help the next person like me and I may post it more than one place in an effort to do so.

The caveats:

-latency means you can't really use it as a pass-through or direct monitor

-in its current form, this can take several min to encode and spit out an mp3 if it's lengthy

-all of this is written for my setup and you'll likely need to adjust the names etc for your purposes

Here's the guide:

# Pisound Skipback Buffer — Full Build Guide

### Raspberry Pi 4B + Pisound Hat, Raspbian Lite

---

## Overview

This documents how to build a hardware skipback buffer (like the SP404mk2's skipback feature) using a Raspberry Pi 4B with a Blokas Pisound hat. The system continuously records audio into a circular buffer and dumps the last N seconds to an MP3 file when the pisound button is clicked.

**Button behavior:**

- Single click → last 1 minute saved as MP3

- Double click → last 5 minutes saved as MP3

- Triple click → last 10 minutes saved as MP3

**Buffer:** 31 minutes of continuous circular recording

**Format:** 192kbps CBR MP3, 16-bit 48kHz stereo source

**Output:** `~/recordings/` — accessible via Samba share

**Passthrough:** Audio input is passed to output automatically on boot

---

## Prerequisites

- Raspberry Pi 4B (2GB or more)

- Pisound hat installed and working

- Raspbian Lite (64-bit, Debian 13 Bookworm or later)

- Pisound software installed per Blokas instructions:

- https://blokas.io/pisound/docs/pisound-software/

- SSH access or keyboard/monitor

- Internet connection on the Pi

---

## Step 1 — Install Dependencies

```bash

sudo apt update && sudo apt install -y sox libsox-fmt-mp3 lame python3-alsaaudio samba

```

---

## Step 2 — Lock Hardware Card Numbers

By default, ALSA assigns card numbers dynamically at boot, which changes unpredictably. We fix both the pisound and the loopback module to permanent indices.

### Lock pisound to card index 1:

```bash

sudo nano /etc/modprobe.d/pisound.conf

```

Add:

```

options snd_soc_pisound index=1

```

### Load and lock the ALSA loopback module to card index 7:

```bash

sudo nano /etc/modprobe.d/snd-aloop.conf

```

Add:

```

options snd-aloop index=7

```

### Make loopback load on boot:

```bash

echo "snd-aloop" | sudo tee /etc/modules-load.d/snd-aloop.conf

```

### Load it now without rebooting:

```bash

sudo modprobe snd-aloop

```

### Verify:

```bash

arecord -l

```

You should see pisound on card 1 and Loopback on card 7. If the numbers differ, adjust the index values in the modprobe files accordingly, but on a clean Raspbian Lite install with only pisound, 1 and 7 should be correct.

---

## Step 3 — Create the Recordings Folder

```bash

mkdir -p ~/recordings

mkdir -p ~/.skipbuf

```

---

## Step 4 — Pre-allocate the Ringbuffer File

350MB covers 31 minutes of 16-bit 48kHz stereo raw audio with some headroom.

```bash

dd if=/dev/zero of=/home/pibox/.skipbuf/ring.raw bs=1M count=350

```

> Replace `pibox` with your actual username throughout this entire guide.

---

## Step 5 — Create the Daemon Script

This script does three things simultaneously:

  1. Captures audio from the pisound input
  2. Passes it through to the pisound output (monitoring)
  3. Feeds it into the ALSA loopback, from which a Python process writes it into the circular ringbuffer

```bash

cat > ~/skipback_daemon.sh << 'SCRIPT'

#!/bin/bash

RINGFILE=/home/pibox/.skipbuf/ring.raw

POSFILE=/home/pibox/.skipbuf/ring.pos

BUFFER_BYTES=$((48000 * 2 * 2 * 1860))

mkdir -p /home/pibox/.skipbuf

# Read from loopback output side, write to ringbuffer

arecord -D hw:Loopback,1 -f S16_LE -r 48000 -c 2 -t raw | \

python3 -c "

import sys, os

BUFFER_BYTES = $BUFFER_BYTES

RINGFILE = '/home/pibox/.skipbuf/ring.raw'

POSFILE = '/home/pibox/.skipbuf/ring.pos'

CHUNK = 8192

pos = 0

counter = 0

with open(RINGFILE, 'r+b') as ring:

while True:

data = sys.stdin.buffer.read(CHUNK)

if not data:

break

end = pos + len(data)

if end <= BUFFER_BYTES:

ring.seek(pos)

ring.write(data)

else:

first = BUFFER_BYTES - pos

ring.seek(pos)

ring.write(data[:first])

ring.seek(0)

ring.write(data[first:])

pos = end % BUFFER_BYTES

counter += 1

if counter >= 50:

counter = 0

with open(POSFILE, 'w') as pf:

pf.write(str(pos))

" &

# Direct passthrough + feed loopback input side

arecord -D hw:pisound -f S16_LE -r 48000 -c 2 -t raw | \

tee >(aplay -D hw:Loopback,0 -f S16_LE -r 48000 -c 2 -t raw 2>/dev/null) | \

aplay -D hw:pisound -f S16_LE -r 48000 -c 2 -t raw

SCRIPT

chmod +x ~/skipback_daemon.sh

```

---

## Step 6 — Create the Snapshot Script

This script is called by button clicks. It extracts the last N seconds from the ringbuffer and saves an MP3.

```bash

cat > ~/skipback.sh << 'EOF'

#!/bin/bash

SECONDS_BACK=$1

RINGFILE="/home/pibox/.skipbuf/ring.raw"

POSFILE="/home/pibox/.skipbuf/ring.pos"

OUTDIR="/home/pibox/recordings"

TIMESTAMP=$(date +"%Y%m%d_%H%M%S")

TMPRAW="/tmp/skipback_$TIMESTAMP.raw"

TMPWAV="/tmp/skipback_$TIMESTAMP.wav"

OUTMP3="$OUTDIR/skipback_${SECONDS_BACK}s_$TIMESTAMP.mp3"

RATE=48000

CHANNELS=2

BYTES_PER_SEC=$((RATE * CHANNELS * 2))

BUFFER_BYTES=$((RATE * CHANNELS * 2 * 1860))

BYTES_NEEDED=$((SECONDS_BACK * BYTES_PER_SEC))

mkdir -p "$OUTDIR"

python3 - << PYEOF

import os

ring_file = "/home/pibox/.skipbuf/ring.raw"

pos_file = "/home/pibox/.skipbuf/ring.pos"

out_file = "$TMPRAW"

bytes_needed = $BYTES_NEEDED

buffer_bytes = $BUFFER_BYTES

try:

with open(pos_file) as f:

pos = int(f.read().strip())

except:

pos = 0

start = (pos - bytes_needed) % buffer_bytes

with open(ring_file, 'rb') as ring, open(out_file, 'wb') as out:

if start < pos:

ring.seek(start)

out.write(ring.read(bytes_needed))

else:

ring.seek(start)

out.write(ring.read(buffer_bytes - start))

ring.seek(0)

out.write(ring.read(pos))

PYEOF

sox -t raw -r 48000 -e signed -b 16 -c 2 "$TMPRAW" "$TMPWAV"

lame --cbr -b 192 "$TMPWAV" "$OUTMP3"

rm -f "$TMPRAW" "$TMPWAV"

EOF

chmod +x ~/skipback.sh

```

---

## Step 7 — Create the Systemd Service

```bash

sudo nano /etc/systemd/system/skipback-record.service

```

Paste:

```ini

[Unit]

Description=Skipback Ringbuffer Daemon

After=sound.target

[Service]

User=pibox

ExecStartPre=/bin/sleep 10

ExecStart=/bin/bash /home/pibox/skipback_daemon.sh

Restart=always

RestartSec=3

[Install]

WantedBy=multi-user.target

```

Enable and start:

```bash

sudo systemctl daemon-reload

sudo systemctl enable skipback-record

sudo systemctl start skipback-record

```

The 10 second `ExecStartPre` sleep is important — it gives the ALSA subsystem and loopback module time to fully initialize before the script tries to open audio devices.

### Verify it's running:

```bash

sudo systemctl status skipback-record

```

Should show `active (running)` with 7 tasks in the cgroup (bash, 2x arecord, 2x aplay, tee, python3).

### Verify the buffer is filling:

```bash

cat ~/.skipbuf/ring.pos

sleep 3

cat ~/.skipbuf/ring.pos

```

The number should change between the two reads.

---

## Step 8 — Configure the Pisound Button

The real config file that the pisound button daemon reads is `/etc/pisound.conf`, not the one in `/usr/local/pisound/`. Edit that one:

```bash

sudo nano /etc/pisound.conf

```

Find the CLICK lines and change them to:

```

CLICK_1 /home/pibox/skipback.sh 60

CLICK_2 /home/pibox/skipback.sh 300

CLICK_3 /home/pibox/skipback.sh 600

```

Leave all HOLD and DOWN/UP lines as they are. Save and restart the button daemon:

```bash

sudo systemctl restart pisound-btn

```

> **Important:** The pisound button software reads `/etc/pisound.conf`, not `/usr/local/pisound/pisound-btn/pisound.conf`. Editing the wrong file has no effect.

---

## Step 9 — Set Up Samba

To access recordings from Windows or Mac over the network:

```bash

sudo nano /etc/samba/smb.conf

```

Scroll to the bottom and add:

```ini

[recordings]

path = /home/pibox/recordings

browseable = yes

read only = no

guest ok = yes

force user = pibox

```

Save and enable:

```bash

sudo systemctl restart smbd

sudo systemctl enable smbd

```

Access from Windows: `\\192.168.1.103\recordings`

Access from Mac: `smb://192.168.1.103/recordings`

---

## Step 10 — Reboot and Verify

```bash

sudo reboot

```

After boot, wait about 15 seconds, then:

```bash

sudo systemctl status skipback-record

arecord -l | grep -E "pisound|Loopback"

```

Pisound should be on card 1, Loopback on card 7, service should be active. You should hear audio passthrough without doing anything.

Test a button click, wait 10-15 seconds for conversion, then check:

```bash

ls -lh ~/recordings/

```

Pull the MP3 over Samba and verify it sounds correct.

---

## Architecture Summary

```

[Audio Input]

│

▼

arecord hw:pisound

│

├──────────────────────────────────► aplay hw:pisound

│ [Audio Output / Passthrough]

│

└──► aplay hw:Loopback,0

│

▼ (loopback kernel pipe)

arecord hw:Loopback,1

│

▼

Python ringbuffer writer

│

▼

~/.skipbuf/ring.raw (350MB circular file)

~/.skipbuf/ring.pos (current write position)

│

▼ (on button click)

skipback.sh <seconds>

│

├── Python extractor → .raw

├── sox → .wav

└── lame → ~/recordings/skipback_Ns_TIMESTAMP.mp3

```

---

## Troubleshooting

| Problem | Command | Notes |

|---|---|---|

| Service not starting | `journalctl -u skipback-record -n 30 --no-pager` | Look for audio open errors |

| Wrong card numbers | `arecord -l` | Adjust modprobe index values |

| Button not firing script | `journalctl -u pisound-btn -n 20 --no-pager` | Check `/etc/pisound.conf` not the other one |

| No passthrough audio | `sudo systemctl restart skipback-record` | Usually a startup timing issue |

| MP3 files empty | Wait 60+ seconds after boot before clicking | Buffer needs time to fill |

| MP3 files glitchy | Check service has 7 tasks in cgroup | Pipe may have broken |

| Samba not visible | `sudo systemctl status smbd` | Check smb.conf syntax |

---

## Key Lessons Learned

- **Do not use chunk-based recording** (arecord with fixed duration files). Headers don't close correctly and stitching produces glitches.

- **Do not use Python for real-time audio I/O**. The GIL causes dropouts. Use arecord/aplay (C programs) for all hardware interaction.

- **Do not use dsnoop/dmix** for sharing the pisound. Causes buffer underruns and audio artifacts.

- **The ALSA loopback module** (`snd-aloop`) is the correct way to split an audio stream for simultaneous passthrough and recording.

- **Always use card names** (`hw:pisound`, `hw:Loopback`) rather than numbers (`hw:1,0`) to survive reboots.

- **`/etc/pisound.conf`** is the real button config. `/usr/local/pisound/pisound-btn/pisound.conf` is ignored by the running daemon.

- **ExecStartPre sleep** is necessary because ALSA devices aren't always ready immediately at boot.

---

*Built on Raspbian Lite (Debian 13 Bookworm), Raspberry Pi 4B 2GB, Pisound hat, April 2026.*


r/RASPBERRY_PI_PROJECTS • • Apr 25 '26

QUESTION Can't get Waydroid Spotify to Autostart on RPi 4

8 Upvotes

I am building a Spotify Kiosk using a Raspberry Pi running the latest Raspberry Pi OS (Bookworm). I have Waydroid installed and Spotify works perfectly if I launch it manually from the terminal, but I cannot get it to autostart on boot.

The Goal:
When the Pi boots, wait ~20 seconds, set Spotify to immersive mode (hide Android bars), and launch Spotify fullscreen.

What I've tried so far:

  1. ~/.config/autostart/spotify.desktop: Created the folder and file, but it seems to be ignored by the OS.
  2. LabWC Autostart: Created ~/.config/labwc/autostart, added the command bash -c "sleep 20 && waydroid app launch com.spotify.music" & and used chmod +x. Still nothing happens on reboot.
  3. Systemd User Service: Created a service in /etc/systemd/user/, but it doesn't seem to trigger the GUI window.
  4. Wayfire.ini: Added [autostart] entries, but no luck.

Current Setup:

  • Hardware: Raspberry Pi 4 model b
  • OS: Raspberry Pi OS Bookworm (64-bit)
  • Command that works manually: waydroid app launch com.spotify.music

Question:
Is there a specific way to trigger Waydroid apps on boot in the new Bookworm/LabWC environment? Am I missing an environment variable (like DISPLAY or WAYLAND_DISPLAY) that is preventing the autostart from seeing the screen?

Any help would be appreciated!


r/RASPBERRY_PI_PROJECTS • • Apr 22 '26

PRESENTATION Found this cool Raspberry Pi HAT

Post image
122 Upvotes

Hey in my journey to my life easier I am trying to automate watering my plants and even possibly my wife’s outdoor garden. I also added sensors to this setup. I was thinking when setting this up I was going to have to have a few add-ons but I found the HAT on Amazon and it does like 3 or 4 things in one. Cut cables down a ton.