How to Turn a Raspberry Pi into a Bluetooth Audio Receiver with OpenClaw
A single Raspberry Pi can receive Bluetooth audio from phones and laptops, stream from AirPlay 2 and Spotify Connect, and run an OpenClaw agent that automates pairing, volume scheduling, and source routing. This guide covers PipeWire setup, Odio's REST API for zero-touch pairing, and how to connect it all to a Fastio workspace for config management and agent handoff.
Why a Pi Bluetooth Receiver Still Makes Sense
The go-odio-api project benchmarks at under 50ms p95 response time and 0% CPU at idle, even on a 2012 Raspberry Pi Model B. Those numbers explain why REST-controlled Bluetooth audio works on the Pi at all: the overhead from running an HTTP API alongside PipeWire is negligible, leaving headroom for an AI agent on the same hardware.
Most "turn your Pi into a Bluetooth speaker" tutorials still walk through manual bluetoothctl pairing and PulseAudio sink configuration. That approach worked, but it required hands-on terminal access every time a new device wanted to connect. In 2026, the stack has moved on. PipeWire replaced PulseAudio as the default audio server on Raspberry Pi OS Bookworm, bringing native Bluetooth A2DP support with high-quality codecs like LDAC, aptX HD, and SBC-XQ. WirePlumber, PipeWire's session manager, automatically routes incoming Bluetooth audio to whatever output device you connect, without any manual graph configuration.
The remaining gap is automation. Commercial Bluetooth speakers handle pairing, reconnection, and volume without user interaction. A bare Pi running PipeWire still needs someone to accept connections and manage paired devices from the command line. Odio's REST API solves the pairing side by exposing Bluetooth as HTTP endpoints. OpenClaw solves the intelligence side by running an agent on the Pi that calls those endpoints, schedules volume changes, and routes between audio sources based on time of day or connected device.
This guide covers the full stack: PipeWire for audio, Odio for Bluetooth management, OpenClaw for automation, and Fastio for config storage and agent coordination.
What Hardware and Software You Need
The Raspberry Pi 5 with 4GB RAM is the best choice for this project. It has enough headroom for PipeWire, Odio, and an OpenClaw agent gateway running simultaneously. A Pi 4 with 4GB works nearly as well. Older models like the Pi 3B+ can run the audio receiver stack on their own, but OpenClaw's minimum requirement of 64-bit Raspberry Pi OS and 1GB RAM makes the Pi 4 the practical floor if you want agent control.
USB Bluetooth Adapter
The built-in Bluetooth on every Raspberry Pi model shares an antenna with WiFi. The Raspberry Pi Audio Receiver project's documentation is blunt about this: the internal chipset "is not suited for audio playback and causes connectivity problems." A USB Bluetooth 5.0 adapter like the TP-Link UB500 or ASUS BT500 costs under $15 and eliminates the dropout issues that plague the onboard chip.
Audio Output
You have four output options:
- 3.5mm headphone jack: Built into every Pi with a standard audio port. Connect directly to powered speakers or a stereo receiver's AUX input
- USB DAC: Better audio quality than the built-in jack. Budget options like the Apple USB-C to 3.5mm adapter start around $10
- HDMI: Sends audio to a TV or AV receiver. Works well but ties up the display port
- I2S DAC HAT: Best audio quality. HiFiBerry DAC2 Pro (~$45) or similar boards connect directly to the Pi's GPIO header
Software
Flash Raspberry Pi OS Lite (64-bit) using the Raspberry Pi Imager. The Lite variant skips the desktop environment, saving RAM for the audio stack and agent runtime. Run sudo apt update && sudo apt full-upgrade before installing anything else.
How to Set Up Bluetooth A2DP with PipeWire and Odio
Raspberry Pi OS Bookworm ships with PipeWire pre-installed, but you need the Bluetooth integration packages:
sudo apt install pipewire-pulse wireplumber libspa-0.2-bluetooth
Enable the user services:
systemctl --user enable --now pipewire.service pipewire-pulse.service wireplumber.service
PipeWire handles A2DP audio with codec support that includes SBC-XQ, LDAC, aptX, aptX HD, aptX-LL, and FastStream. WirePlumber acts as the session manager, automatically bridging incoming Bluetooth audio to your output device. When a phone connects, WirePlumber detects the new A2DP source and routes it to the active audio sink without manual configuration.
Configuring BlueZ for Headless Pairing
Edit the Bluetooth configuration to allow re-pairing without interaction:
sudo nano /etc/bluetooth/main.conf
Add under the [General] section:
JustWorksRepairing = always
This setting lets devices reconnect without prompting for confirmation, which is critical for a headless audio receiver that has no screen or keyboard attached.
Installing Odio for REST-Controlled Bluetooth
While raw PipeWire and BlueZ handle audio playback, managing Bluetooth pairing through bluetoothctl on a headless Pi gets tedious. Odio wraps the entire Bluetooth and audio stack into a REST API. The quickest install method:
curl -fsSL https://odio.love/install | bash
For more control, install via apt:
curl -fsSL https://apt.odio.love/key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/odio.gpg
echo "deb [signed-by=/usr/share/keyrings/odio.gpg] https://apt.odio.love stable main" \
| sudo tee /etc/apt/sources.list.d/odio.list
sudo apt update && sudo apt install odio-api
systemctl --user enable --now odio-api.service
Once running, Odio exposes Bluetooth and audio controls at http://localhost:8018. The key endpoints for a Bluetooth receiver:
POST /bluetooth/power_uppowers on the adapterPOST /bluetooth/pairing_modeopens a 60-second window for incoming connections, no PIN requiredPOST /bluetooth/scandiscovers nearby devicesGET /bluetooth/deviceslists paired and connected devicesGET /eventsstreams real-time state changes via Server-Sent Events
From the Odio web UI, tap the pairing button and any phone within range connects automatically. Once connected, the phone appears as a media player with current track info, play/pause controls, and volume, all working through Bluetooth AVRCP. Spotify, YouTube, Apple Music, or any app that exposes media controls over Bluetooth shows up in the interface.
Multi-Source Audio: Bluetooth, AirPlay 2, and Spotify Connect
A Bluetooth-only receiver limits you to one protocol. The Raspberry Pi Audio Receiver project extends the Pi to handle Bluetooth A2DP, AirPlay 2, and Spotify Connect simultaneously. If you want all three, the project's install script sets up each protocol:
wget https://raw.githubusercontent.com/nicokaiser/rpi-audio-receiver/main/install.sh
bash install.sh
The installer prompts you to choose which protocols to enable. It configures Shairport Sync for AirPlay 2 and Raspotify for Spotify Connect alongside the Bluetooth A2DP receiver. All three protocols share the same audio output, so you can switch between streaming from an iPhone via AirPlay, a laptop via Bluetooth, and the Spotify app without touching the Pi.
Why Multiple Sources Matter
Bluetooth A2DP handles the universal case. Every phone and laptop supports it. AirPlay 2 adds Apple-specific features like multi-room sync and lossless audio. Spotify Connect lets anyone in your household take over the speakers from the Spotify app without pairing a device first.
The practical difference is convenience. Guests connect over Bluetooth. Your household uses Spotify Connect or AirPlay. The Pi handles all of it from a single audio output.
Managing Source Conflicts
When two sources try to play at the same time, the last one to connect typically takes over. Odio's REST API lets you manage this programmatically. An OpenClaw agent can monitor the /events SSE stream and apply rules: pause Bluetooth audio when Spotify Connect starts, or reject new Bluetooth connections during a scheduled listening session.
If you already have a Pi running as a HiFi music streamer, adding Bluetooth reception gives you a complementary input path. The streamer handles network-based sources. The receiver handles phone and laptop connections.
Store your Pi audio configs in one agent-ready workspace
generous storage with no credit card. Upload your PipeWire and Odio configs, search them with Intelligence Mode, and connect your OpenClaw agent through the MCP server at mcp.fast.io.
Adding OpenClaw for Agent-Managed Audio
OpenClaw turns the Pi from a passive Bluetooth receiver into an actively managed audio endpoint. The agent runs as a lightweight gateway on the Pi itself, using cloud-hosted LLMs for processing while keeping the local footprint minimal. A Pi running PipeWire, Odio, and an OpenClaw agent draws roughly 5W on average, costing about $0.50 to $1.00 per month in electricity.
Install OpenClaw on the same Pi after setting up the audio stack:
curl -fsSL https://openclaw.ai/install.sh | bash
openclaw onboard --install-daemon
OpenClaw requires 64-bit Raspberry Pi OS and at least 1GB of RAM. With a Pi 4 or Pi 5 running the audio stack, you have plenty of headroom. The setup wizard configures the agent as a systemd service that starts automatically on boot.
What the Agent Actually Does
The OpenClaw agent doesn't process audio. It acts as a control plane that interacts with Odio's REST API over localhost. Because go-odio-api exposes every Bluetooth and audio function as an HTTP endpoint, the agent can:
- Trigger pairing mode at scheduled times, opening the receiver to new connections only during certain hours
- Monitor the
/eventsSSE stream and respond to connection changes, such as sending a notification when a new device pairs or auto-adjusting volume for known devices - Call
/audio/outputsand/audio/server/muteto manage volume based on time of day - Restart audio services via
/services/{scope}/{unit}/startif PipeWire or Bluetooth encounters an error
The agent processes natural language commands through whichever messaging channel you configure: Telegram, Discord, Slack, or WhatsApp. Send "turn on pairing mode" from your phone, and the agent calls POST /bluetooth/pairing_mode on the Pi. Ask "what's connected right now?" and it queries GET /bluetooth/devices and returns the device list.
This is where the Pi receiver diverges from a commercial Bluetooth speaker. A JBL or Sonos handles one fixed set of behaviors. A Pi with OpenClaw adapts its pairing rules, volume curves, and source priorities to how you actually use it.
Managing Audio Configs with a Fastio Workspace
Running an OpenClaw agent on a Pi creates configuration files, pairing histories, and audio routing rules that you do not want to lose when a microSD card fails. Fastio provides a free workspace where the agent can store these files and where you can access them from any device.
The Business Trial includes 50GB of storage, included credits, and 5 workspaces, with no credit card required. That covers audio configuration backups with room to spare.
How the Workflow Fits Together
The OpenClaw agent on your Pi connects to Fastio through the MCP server at /mcp. From there, it can:
- Upload PipeWire and Odio configuration files to a workspace for backup
- Store Bluetooth device pairing records so they survive SD card reflashes
- Write agent activity logs that you review from the Fastio web interface
- Query stored configs using Intelligence Mode's semantic search
If you run Bluetooth receivers on several Pis around your home, each agent can write to the same workspace. Intelligence Mode auto-indexes uploaded files, so you can ask questions like "which Pi is paired with the living room phone?" and get answers with citations pointing to specific config files.
Ownership Transfer for Client Setups
If you build Pi audio receivers for clients or office installations, Fastio's ownership transfer feature lets you set up the entire workspace, including configs, documentation, and agent access, then hand ownership to the client. You keep admin access for ongoing maintenance while the client owns their data. This workflow fits audio installers and AV integrators who deploy Pi-based receivers across multiple rooms or buildings.
For the OpenClaw skill that connects to Fastio workspaces, see the Fastio storage for OpenClaw page and the MCP documentation.
Frequently Asked Questions
Can Raspberry Pi be used as a Bluetooth speaker?
Yes. With PipeWire and a Bluetooth adapter, any Pi running 64-bit Raspberry Pi OS can receive audio over Bluetooth A2DP and output it through the 3.5mm jack, USB DAC, HDMI, or an I2S DAC HAT. The Pi acts as a Bluetooth audio sink, so phones and laptops see it as a speaker and can stream audio wirelessly. A USB Bluetooth adapter is strongly recommended over the built-in chip for reliable audio quality.
How do I set up Bluetooth audio on Raspberry Pi?
Install PipeWire with Bluetooth support (pipewire-pulse, wireplumber, libspa-0.2-bluetooth), enable the user services, and set JustWorksRepairing = always in /etc/bluetooth/main.conf for headless pairing. For a more complete setup, install Odio, which adds a REST API and web interface for managing Bluetooth connections without the command line.
Is a USB Bluetooth adapter better than built-in on Raspberry Pi?
Yes. The Raspberry Pi Audio Receiver project documents that the internal Bluetooth chipset shares an antenna with WiFi and causes connectivity problems during audio streaming. A USB Bluetooth 5.0 adapter provides dedicated bandwidth and more reliable audio. Budget options cost under $15.
Can Raspberry Pi receive audio from iPhone?
Yes, through two protocols. Bluetooth A2DP works universally, and any iPhone can pair with the Pi just like connecting to a regular Bluetooth speaker. For better Apple integration, AirPlay 2 support via Shairport Sync provides lower latency and multi-room sync. Both protocols can run simultaneously on the same Pi.
What Bluetooth audio codecs does PipeWire support?
PipeWire supports SBC (baseline A2DP), SBC-XQ (higher quality SBC variant), LDAC (Sony's high-resolution codec), aptX, aptX HD, aptX Low Latency, and FastStream. Codec negotiation happens automatically between PipeWire and the connecting device. The actual codec used depends on what the sending device supports.
How much does it cost to run a Pi Bluetooth receiver?
The hardware runs $50 to $100 total. A Raspberry Pi 5 (4GB) costs about $60, a USB Bluetooth adapter about $15, and a USB DAC $10 to $50 depending on quality. Operating cost is roughly $0.50 to $1.00 per month in electricity at 5W average power draw. OpenClaw's agent runtime is free; you pay only for API calls to your chosen LLM provider.
Related Resources
Store your Pi audio configs in one agent-ready workspace
generous storage with no credit card. Upload your PipeWire and Odio configs, search them with Intelligence Mode, and connect your OpenClaw agent through the MCP server at mcp.fast.io.