Raspberry Pi Media Center and Hats are a series of Raspberry Pi Zero-based media center devices. They share a similar look, and compared to my earlier designs, they have a great-looking aluminum case.
Raspberry Pi Media Center Hats are cost-effective versions of the above devices, sharing the same DACs and similar schematics, but being able to pair with any Raspberry Pi boards.
- Raspberry Pi Media Center and Hats
- Table of Contents
- Motivation
- Raspberry Pi HiFi and Hat
- Raspberry Pi HiFi-Amped
- Loud Raspberry Pi and Hat
- Louder Raspberry Pi and Hat
- Features
- Board Pinout
- Software
- DAC Configuration - HiFi Raspberry Pi and Hat
- DAC Configuration - HiFi-Amped Raspberry Hat
- DAC Configuration - Loud Raspberry Pi
- DAC Configuration - Louder Raspberry Pi
- Bare OS Options
- Bare OS + Standard client services
- Third-party Media Software
- Volumio
- Rotating MAC address on the W5500
- TAS5805M DSP Capabilities
- Hardware
- Demo
- Where to buy
- Press mentions
I did few audio projects in the past, some using ESP32, some using larger Orange Pi and Raspberry Pi devices. Each has its pros and cons, and with each iteration, I'm trying to focus on the details that were working best for me, while actually using those devices at home.
What is special about the Raspberry eco-system is of course its community support. Being a not-so-strong software developer, I often have to rely on the work that other people did and baked into the base Raspbian image. Attaching a DAC, Ethernet, and IR reader is as simple as adding 3 lines into the config.txt
file, which is a bit of magic really
dtoverlay=gpio-ir,gpio_pin=23
dtoverlay=w5500
dtoverlay=hifiberry-dac
All the device tree definitions, kernel drivers, and dependency packages are already in place, believe it or not.
Sure, compared to the ESP32 platform it is not as lightweight. It requires more power, it takes some time to boot. But when it comes to rapid development, there is nothing like the Raspberry Pi.
Raspberry Pi HiFi Media Center is a first-in-line product that uses the legendary PCM5100 series DAC with supreme audio quality. It exposes line-level output that you can plug into a stereo amplifier. Analog power comes through an Ultra-low-noise LDO, making sure no interference from Raspberry come through to your speakers. Spend as much as you need on the external amp to deliver the sound you like (personally I prefer late 80's audio gear).
Raspberry Pi HiFi Hat is the same DAC and power circuitry times two in a Hat shape. You can use it with any Raspberry Pi board, not only Zero. Raspberry Pi 5 users can use both outputs independently, while other Pis will produce the same audio on both outputs.
The PCM5100 HiFi DAC combined together with a highly efficient TPA3110D2 D-class amplifier. Times two (again, why not?). It brings all the best from the HiFi model and adds an onboard amp to form a complete solution that can be paired with speakers directly. It uses an external power source to feed hungry amps and host Pi using an onboard drop-down converter. Raspberry Pi 5 users can use both outputs independently, older boards will produce the same audio in parallel. Boards use 4-layer PCBs to ensure good signal protection to keep that noise low. Both amps can be shut down using GPIO pins, so you can be sure the speakers will be dead quiet when they are not in use.
The Media Center version of the HiFi-Amped model is in the ideation stage. I see it to be a little more than just the same DAC on the boxed shape. The benefit of having DAC and AMP separated is the ability to fiddle with the audio in the middle, so I'm looking to implement volume and tone controls available on the front panel, as well as a tone correction button. I'm thinking of pumping the visual with the LED matrix or small OLED screen, which requires mastering certain mechanical tasks. Long story short, this is a work in progress.
Loud Raspberry Pi Media Center uses a dual MAX98357 HiFi DAC with a built-in highly efficient D-class amp to deliver 3 to 5W of music power directly to your speakers. It is not too loud, but also very simple to use and fun to play with. When DAC is not in use, it goes into shutdown mode, making sure no hissing will keep you up at night. It powers from a standard USB-C power source, like a phone charger, etc.
Loud Raspberry Pi Hat is the same DAC and audio circuitry, again times two (because why not?). You can use it with any Raspberry Pi, while Raspberry Pi 5 users can use both pairs of speakers independently, while other Pis will produce the same audio on both ends. Hat will pull the juice from the Pi's 5V line, or power the Pi itself using screw connectors, so you can make sure enough power is delivered to both boards.
Louder Raspberry Pi | Louder Raspberry Pi NOPD |
---|---|
Louder Raspberry Pi Media Center is a top-of-the-range model that uses a modern highly capable TAS5805M DAC and is aimed to be paired with medium-to-large speaker systems. With 25W per channel stereo output, it packs a punch and can easily enliven living quarters or dorm rooms. It is highly efficient, but much more demanding for power when cranked, therefore it uses USB-C Power Delivery to pull up to 65W from the wall power adapter. It can be used both with Wi-Fi and Ethernet (to make sure bad Wi-Fi would not interrupt the stream)
Louder Raspberry Pi Hat drops the USB-PD in favor of an external power supply up to 28V (opposed to 20V over PD) and has a step-down converter onboard to deliver 5V to the Pi, so you need only a single power source for everything. Otherwise, it delivers audio through the same highly capable DAC, capable of driving large speakers or tearing apart small ones
HiFi Raspberry Media Center | HiFi Raspberry Hat | HiFi-Amped Raspberry Hat | Loud Raspberry Media Center | Loud Raspberry Hat | Louder Raspberry Media Center | Louder Raspberry Media Center NOPD | Louder Raspberry Hat | |
---|---|---|---|---|---|---|---|---|
Image | ||||||||
DAC | Single PCM5100A 32bit Stereo DAC | Dual PCM5100A 32bit Stereo DAC | Dual PCM5100A 32bit Stereo DAC + TPA3110D2 D-Class amp |
Dual I2S DAC MAX98357 with built in D-Class amp | Quadruple I2S DAC MAX98357 with built in D-Class amp | Stereo I2S DAC TAS5805M with built in D-Class amp | Stereo I2S DAC TAS5805M with built in D-Class amp | Stereo I2S DAC TAS5805M with built in D-Class amp |
Output | 2.1 VRMS Line level output -100 dB typical noise level | 2x 2.1 VRMS Line level output -100 dB typical noise level | 4x 25W (8Ω, 1% THD+N) at 22V; 4x 22W (4Ω, 1% THD+N) at 16V 2x 40W (4Ω, 1% THD+N) at 20V |
2x 3W (8Ω); 2x 5W (4Ω) | 4x 3W (8Ω); 4x 5W (4Ω) | 2x 22W (8Ω, 1% THD+N); 2x 32W (4Ω, 1% THD+N) at 20V 1x 45W (4Ω, 1% THD+N) at 20V |
2x 22W (8Ω, 1% THD+N); 2x 32W (4Ω, 1% THD+N) at 20V 1x 45W (4Ω, 1% THD+N) at 20V |
2x 32W (8Ω, 1% THD+N) at 24V 1x 55W (4Ω, 1% THD+N) at 24V |
RGB LED | yes | none | none | yes | none | yes | yes | none |
IR input | yes | header only | none | yes | header only | yes | yes | header only |
External relay driver | yes | none | none | no | none | yes | yes | none |
Onboard Serial Bridge | yes | none | none | yes | none | yes | no | none |
Ethernet | Wiznet W5500 SPI Ethernet | none | none | Wiznet W5500 SPI Ethernet | none | Wiznet W5500 SPI Ethernet | Wiznet W5500 SPI Ethernet | none |
Powers from | 5V USB-C power adapter (up to 1 A) Triple LP5907 3.3 V Ultra-Low-Noise LDO |
5V from the host 5x LP5907 3.3 V Ultra-Low-Noise LDO |
8..26V from external source powering host (up to 3A cont.) |
5V USB-C power adapter (up to 3 A) | 5V from the host (up to 4A) or 5V from screw connector (powering host) |
65W USB-C PD power adapter (25W/45W with limited power) | Up to 26V from external PSU | 7..28V from external source powering host (up to 3A cont.) |
Mechanical dimensions (WxHxD) | 88mm x 38mm x 100mm | 65mm x 30mm x 15mm | 70mm x 61mm x 20mm | 88mm x 38mm x 100mm | 65mm x 30mm x 20mm | 88mm x 38mm x 100mm | 88mm x 38mm x 100mm | 65mm x 56mm x 20mm |
I2S CLK | I2S DATA | I2S WS | MAX98357A EN, Loud Media Center | MAX98357A EN, Loud Hat | TPA3110 EN, HiFi-Amped Hat | |
---|---|---|---|---|---|---|
Raspberry Pi Zero | 18 | 21 | 19 | 4 | 5,6 | 5,6 |
Raspberry Pi 2,3,4 | 18 | 21 | 19 | 4 | 5,6 | 5,6 |
Raspberry Pi 5 | 18 | 21, 23, 25, 27 | 19 | 4 | 5,6 | 5,6 |
SPI CLK | SPI MOSI | SPI MISO | LAN RES | LAN CS | LAN INT | WS2812 RGB LED | RELAY EN | IR INPUT | |
---|---|---|---|---|---|---|---|---|---|
Raspberry Pi Zero (BCM) | 11 | 10 | 9 | 24 | 8 | 25 | 12 | 7 | 23 |
I2C CLK | I2C DATA | DAC PWDN | DAC FAULT | PD POWER GOOD | |
---|---|---|---|---|---|
Raspberry Pi Zero (BCM) | 3 | 2 | 4 | 26 | 16 |
Being a Raspberry Pi software selection is a vast space for experimentation. First things first, for any OS you need to configure DAC. Then we talk about different OS options.
You can use any distribution you like. The only change you need to make to enable hardware is to add 3 lines to the /boot/config.txt
dtoverlay=gpio-ir,gpio_pin=23
dtoverlay=w5500
dtoverlay=hifiberry-dac
Note that for Hat only the last line is applicable
Simple setup should only include single line into /boot/config.txt
, amp will be powered on all the time by default.
dtoverlay=hifiberry-dac
If you want to control the amp using GPIO you may use software integration to pull GPIO5/6 HIGH or LOW to switch the amp ON and OFF.
Starting from revision C it will be possible to use device-tree configuration to switch the amp ON and OFF when audio is playing (it is possible in earlier revisions as well, but I didn't manage to avoid fully the speakers popping sound)
As simple as the HiFi model, just add 3 lines to the /boot/config.txt
dtoverlay=gpio-ir,gpio_pin=23
dtoverlay=w5500
# pin 4 for Media center, pins 5,6 for Hat
dtoverlay=max98357a,sdmode-pin=4
Note that for Hat only the last line is applicable
TAS5805M DAC is not supported by default Raspbian distribution, therefore some work needs to be done to enable it. Linked repo contains code and instructions on how to configure it. It will take you 5 minutes and one reboot.
With the bare OS you're in full control of what to install and configure. It is totally up to your use case.
Raspbian | DietPi | PostmarketOS | |
---|---|---|---|
Link | link | link | link |
Code | link | link | link |
Based on | Debian | Debian | Alpine |
Type | Bare OS | Base OS | Bare OS |
This is a work in progress and the idea is to have a bare minimum OS (be it Raspbian, DietPi, or Armbian) and install the most used client services via the Ansible playbook. I will add more details, as soon as I have working samples, but planned things to add are
- Configure DAC (pick one of HiFi, Loud, or Louder)
- Pulseaudio server with network sink
- Spotify Connect
- Snapcast client (with autodiscovery)
- Slimproto client (with autodiscovery)
- Apple Airplay
- UPNP sink (gmediarender)
This will allow integration into existing media sources with Home Assistant, LMS, or Mopidy instance, including multi-room sync.
- Write the downloaded Armbian image onto an SD card of your choice. Start your Orange Pi and find its IP address. The next steps will assume that the IP address of each node stays the same after reboot. You might need to configure your router to lease static IP to Orange Pi to make it stable.
- Open media-center-via-ansible folder in vscode. In case you don't want to install vscode, you can run commands in plain terminal as well. Please use tasks.json file for reference
- Prepare hosts file. Add your node's IP address and name. If you prefer password auth, you need to add a password here, but ssh-key auth is recommended
- Run
0. install host prerequisites
task. It will install necessary tools on your laptop/PC, like Ansible client and such - Run
1-hifi-raspberry-pi.yml
,1-loud-raspberry-pi.yml
or1-louder-raspberry-pi.yml
playbook using1. apply without password
task depending on your hardware. - Run remaining playbooks the same way, pick those that you're planning to use
HifiBerry OS | PiCorePlayer | MupiBox | Mopidy | Volumio | Moode | Balena Audio | |
---|---|---|---|---|---|---|---|
Link | link | link | link | link | link | link | link |
Code | link | link | link | link | link | link | link |
Based on | Debian | Tiny Core Linux | DietPi | Debian | Debian | Debian | Balena |
Type | OS + Services | OS + Services | OS + Services | Services only | OS + Services | OS + Services | OS + Services |
Remote management | No | No | No | No | No | No | Yes |
SW support | |||||||
UI/UX features | |||||||
Web UI | Yes | Yes | Yes | Yes | Yes | Yes | |
Mobile App/UI | Yes | Yes | Yes | Yes | Yes | ||
IR Remote | ? | Yes | ? | ? | ? | ? | Custom |
Server features | |||||||
LMS server | Yes | ? | No | ? | ? | ? | |
Local library | Yes | Yes | Yes | Yes | Yes | ||
Radio providers | Yes | Yes | Yes | Yes | Yes | ||
Snapcast server | ? | ? | ? | ? | ? | ? | Yes |
Client features | |||||||
LMS Client/Squeezelite | Yes | Yes | ? | No | Yes | Yes | ? |
Airplay | Yes | Yes | ? | No | Yes | Yes | Yes |
Spotify | Yes | Yes | Yes | No | Yes | Yes | Yes |
Snapcast client (HA) | Yes | ? | ? | ? | ? | ? | Yes |
Pulseaudio sink | ? | ? | ? | ? | ? | ? | Yes |
UPNP/DLNA client | Yes | Yes | Yes | ||||
MPD | Yes |
Volumio is a great piece of software, extremely popular with media center devices like Raspberry Media Center.
With HiFi Raspberry and Loud Raspberry, things are fairly simple. Those DACs are supported out of the box. Select HiFiBerry DAC
and Adafruit MAX98357
in the DAC Model settings accordingly. Optionally you may also create a /boot/userconfig.txt
file and add the following config to enable W5500 Ethernet
[all]
dtoverlay=w5500
For Louder Raspberry, you'd need to perform a few more steps to configure a custom DAC.
Setup instructions
First, get access to the terminal either from USB-Serial or from SSH. To enter the Serial terminal you'd need to add this line to /boot/volumioconfig.txt
enable_uart=1
You can enable SSH at volumio.local/dev and log in using user volumio
and password volumio
We're about to build kernel modules, so we need to install a few dependencies first (all commands going forward are running on the target host, ie Raspberry Pi)
sudo apt update && sudo apt install git raspberrypi-kernel-headers build-essential -y
Assuming you're in, first install build prerequisites (this will take a while, grab a coffee)
volumio kernelsource
Next, pull the DAC driver from the GitHub
cd ~
git clone https://github.com/sonocotta/tas5805m-for-raspbian-paspberry-pi-zero
cd tas5805m-for-raspbian-paspberry-pi-zero
Build kernel driver
cd /usr/src/rpi-linux && sudo find . -type d -exec chmod 755 {} \; # no idea why permissions are not right, but this should fix it
cd ~/tas5805m-for-raspbian-paspberry-pi-zero
make all
If all goes well you should see no errors in the console
make -C /lib/modules/6.1.77+/build M=/home/volumio/dev/tas5805m-for-raspbian-paspberry-pi-zero modules
make[1]: Entering directory '/usr/src/rpi-linux'
CC [M] /home/volumio/dev/tas5805m-for-raspbian-paspberry-pi-zero/tas5805m.o
MODPOST /home/volumio/dev/tas5805m-for-raspbian-paspberry-pi-zero/Module.symvers
CC [M] /home/volumio/dev/tas5805m-for-raspbian-paspberry-pi-zero/tas5805m.mod.o
LD [M] /home/volumio/dev/tas5805m-for-raspbian-paspberry-pi-zero/tas5805m.ko
make[1]: Leaving directory '/usr/src/rpi-linux'
Copy over kernel drivers to the filesystem
sudo make install
Now let's compile and copy the device tree
sudo apt install device-tree-compiler -y
sudo ./compile-overlay.sh
Next, we need to update the Volumio settings. Navigate to /volumio/app/plugins/system_controller/i2s_dacs/dacs.json
file and add this line as the first choice in the Raspberry PI section
{"id":"louder-raspberry","name":"Louder Raspberry","overlay":"tas5805m,i2creg=0x2d","alsanum":"2","alsacard":"LouderRaspberry","mixer":"Master","modules":"tas5805m","script":"","needsreboot":"yes"},
Restart the Volumio service
sudo systemctl restart volumio.service
Now you should be able to select Louder Raspberry in the DAC list, which will restart the Raspberry
At this stage it is not changing DT overlay automatically, I need to figure out why, but for now let's add it manually to the end of the /boot/config.txt
file
#### Volumio i2s setting below: do not alter ####
dtoverlay=tas5805m,i2creg=0x2d
After reboot, you should be able to see the new sound card via aplay -l
card 2: LouderRaspberry [Louder-Raspberry], device 0: bcm2835-i2s-tas5805m-amplifier tas5805m-amplifier-0 [bcm2835-i2s-tas5805m-amplifier tas5805m-amplifier-0] ^F Forward
Subdevices: 1/1
Subdevice #0: subdevice #0
Volumio will start playing using the right DAC on its own. Congratulations!
On some systems, the W5500 driver will rotate the chip's MAC address on each boot, which is quite annoying if you're binding the DHCP server to them. There is a manual fix that can help with that
- Downloaded the w5500 overlay file
- uncomment this line and change the MAC to your liking // local-mac-address = [aa bb cc dd ee ff];
- save the file as w5500-overlay-custom.dts
- create the binary with the following command:
dtc -I dts -O dtb -o w5500-custom.dtbo w5500-overlay-custom.dts
- backup the original w5500.dtbo:
sudo mv /boot/overlays/w5500.dtbo /boot/overlays/w5500.dtboBACKUP
- move the new .dtbo into the overlays directory:
sudo cp w5500-custom.dtbo /boot/overlays/w5500.dtbo
- reboot and ip a will report the new MAC address
TAS5805M DAC (and his big brother TAS5825M) has quite a sophisticated DSP inside, which is mostly undiscovered by the community at the moment. Documentation of it is scarce. The only reasonable way to use it is to obtain a TI PurePath license and Hardware Development kit ($250 if you find it). This should allow the following skills
- 2.0, 1.1, 2.1, 0.1, and pretty much any other speaker configuration
- Loudness correction (or Tone correction)
- Soft clipping
- Individual EQ (16 of them I think)
- True mono and other routing configurations
- And many more
I'm planning to dive deep into the topic (whenever I have time, haha) and provide an optional setting for the most common configurations. This is a work in progress with no deadline set.
Please visit the hardware section for board schematics and PCB designs. Note that PCBs are shared as multi-layer PDFs as well as Gerber archives.
Front | Back | PCB |
---|---|---|
Image |
---|
Image |
---|
Front | Back | PCB |
---|---|---|
Image |
---|
Front | Back | Back (NOPD) | PCB |
---|---|---|---|
Image |
---|
According to the manufacturer Raspberry Pi Zero requires at least 1 Amp of 5V line, and each of the Loud Raspberry DAC needs at least 1 Amp extra. With the total budget requirement of 3 Amps, it is within specs for a non-PD USB-C 5V power line. I've decided not to use USB-PD for The Loud model. Just make sure your power adapter is capable of 3 Amps (or keep a reasonable volume if it is not).
HiFi Raspberry barely uses extra power compared to what the Raspberry Pi Zero board itself needs. No special requirements are there.
For Louder Raspberry, it is clearly not an option. You'd need a PD-enabled power adapter to run the board. Ideally, you should supply a 20V 3.25 Amp capable power source, common for modern laptops (Dell, HP, and Lenovo all tested and work perfectly). However, pretty much any 9V/12V/20V PD-enabled power adapter will work, most typically phone chargers with a quick charge option. The smallest of the family is a 25W model, which is plenty enough for both Raspberry Pi and DAC.
The interesting part was all the phone and laptop chargers I used for the test (around five different makes of each), sounded great, with no hissing, no popping. (Apart from the Apple ones, they didn’t work. Likely they have Apple-specific PD protocol). This is probably because modern devices have become so noise-sensitive that manufacturers have been forced to do good work on noise levels.
Tested and perfectly working models are (others may be available)
Model | Image |
---|---|
65W USB-C Lenovo ThinkPad Laptop Charger Replacement Power Adapter | |
65W 45W 20V 3.25A Type-C PD Laptop Charger | |
120W Gan Type-C PD Charger | |
45W Type-C PD Mobile Phone Wall Adapter |
Because USB-PD is a bit of a Wild West in terms of standards, sometimes not everything goes as designed. Some people have run into this with power adapters that aren’t fully PD-standard compliant. In most cases, the worst that happens is the PD chip doesn’t trigger the 20V mode, so the Raspberry goes into the boot loop, not getting enough voltage on the 5V bus.
The “hammer-style” solution I came up with is a new NOPD version of the Louder Raspberry that lets you use a barrel power jack to supply raw voltage directly. The catch? Standard 2mm pins can’t handle high currents, so I’ve gone with a 2.5mm pin instead — it’s a bit unusual but still common enough in the laptop world.
With this setup, you can supply more than the 20V limit of PD, giving you a bit more power for the speakers. You probably won’t hear much difference (thanks to the way human hearing works), but it could help larger speakers that need a bit more to really “open up." Other than that, the NOPD version works just like the PD version — no software changes are needed.
One caveat is that, since Raspberry Pi requires 5V to run and the input voltage is in the range of 5 to 20 volts, I failed to find a step-down converter that (a) supports this wide input range and (b) can run in no-dropout mode (meaning keep 5V output on 5V input). If you know one, please let me know. But at this moment you have to supply more than 5V over USB (meaning 9V in PD standards) to start the Raspberry.
Now, you have USB power delivery and the Serial on the same bus, how should this work then? When you're developing, you may not require the full power of the DAC, and it will happily work with 5V input (limited to something like 5W of music power per channel). you just supply 5V to the Raspberry using a micro-USB cable, while USB-C will power the DAC with 5V and give you a Serial console at the same time
HiFi version of the Raspberry Media Center has an internal driver for the external relay. It has a back-facing diode to shunt any coil-inducted currents. Driver is an open-drain output with the following states
Driver Pin State (IO7) | Output state | Relay connected between OUT and +5V |
---|---|---|
Floating (pulled low with 100K resistor) or LOW |
High impedance | INACTIVE (switched OFF) |
HIGH | Pulled to GND | ACTIVE (switched ON) |
Schematics:
External relay can be connected directly between OUT and +5V pins (1st and 3rd pins, mid pin being GND)
Start by configuring IR device-tree overlay in the /boot/config.txt
file
Setup instructions
# Enable IR reader on GPIO23
dtoverlay=gpio-ir,gpio_pin=23
After reboot, you should be able to see /dev/lirc0
device
$ ls -al /dev/lirc0
crw-rw---- 1 root video 251, 0 Jun 17 21:51 /dev/lirc0
There are multiple ways you can capture IR signals using /dev/lirc0
device, one of them is to use lirc
utilities by installing them via
$ sudo apt install lirc -y
Next, we need to pull the remote configuration or create new one by training lirc
. First path is much easier, you may find your remote in the library here. Pull it into lirc config by running
$ cd /etc/lirc/lircd.conf.d/
$ sudo wget -O aa59-00741a.lircd.conf https://sourceforge.net/p/lirc-remotes/code/ci/master/tree/remotes/samsung/aa59-00741a.lircd.conf?format=raw
$ sudo service lircd restart
To be sure, I've updated also /etc/lirc/lirc_options.conf
changing 2 lines
driver = default
device = /dev/lirc0
Next, capture incoming IR codes by running
$ irw
00000000e0e0e01f 00 KEY_VOLUMEUP Samsung_TV
00000000e0e0e01f 01 KEY_VOLUMEUP Samsung_TV
00000000e0e0e01f 00 KEY_VOLUMEUP Samsung_TV
00000000e0e0d02f 00 KEY_VOLUMEDOWN Samsung_TV
00000000e0e0d02f 01 KEY_VOLUMEDOWN Samsung_TV
The tested method of controlling RGB LED is to use rpi_ws281x library, available as rpi-ws281x-python module. You can install it with pip
. This library uses PWN capabilities of the GPIO and does not require any specific device tree configuration. The only configuration that you'd need in any of the provided examples is below
Setup instructions
Install the library first
sudo apt install python3-pip git -y
sudo pip install rpi_ws281x --break-system-packages
Pull the example repo
git clone https://github.com/rpi-ws281x/rpi-ws281x-python/ && cd rpi-ws281x-python/examples
Update any of the example's header with the below configuration
# LED strip configuration:
LED_COUNT = 1
LED_PIN = 12
LED_FREQ_HZ = 800000
LED_DMA = 10
LED_BRIGHTNESS = 255
LED_INVERT = False
LED_CHANNEL = 0
Now you're ready to run it
sudo python3 ./strandtest.py
Unfortunately, this library uses direct access to memory, so you need to run it as root
.
Raspberry Pi 5 is the first one that allows to drive multiple I2S data lines using the same interface. What it means in practice, is that while all older Pis have just 3 I2S lines (CLK, WS, DATA), Pi5 support up to 4 Data lines (CLK, WS, D0, D1, D2, D3), capable of driving 4 independent audio interfaces.
All Raspberry Pi hats have experimental support for alternative data lines. You need to short some solder bridge to use it though. In theory, it allows to configure Hats to use different pins and stack them together to create 4 individual stereo interfaces (8 channels in total) using the same device.
HiFi Hat | HiFi-Amped Hat | Loud Hat |
---|---|---|
Configuration value that allows this is quite simply
dtoverlay=hifiberry-dac8x
You may support our work by ordering this product at Tindie