Spiral Speaker Build

The team at Pi Supply was kind enough to send me a Justboom Amp Zero pHAT to play with. The Amp Zero combines both DAC (Digital to Analog Converter) and Amp (Amplifier), making it a great choice for a DIY Pi Zero speaker build. To distinguish this build from the many other existing Pi related audio projects, I decided to give it a special twist, literally. The build is inspired by the spiral plywood vase by Bob from I Like to Make Stuff.

Electronics

The electronics are centered around the Amp Zero, but to add a bit of dynamicity to the whole, a Scroll pHAT is used to display the spectrum of the audio in real time.

This makes the list of electronics components, the following:

Justboom Amp Zero

In the Box

When unboxing the Amp Zero, following items were included in the box:

  • two Justboom stickers (yay stickers!)
  • getting started link
  • Max2Play 30-day voucher, a Pi OS for home-entertainment
  • Roon Labs 60-day voucher
  • Amp Zero pHAT
  • DC barrel jack adapter
  • IR receiver
  • four spacers with screws

  

Assembly

Connecting the Amp Zero to a Pi Zero requires standard male header pins to be soldered on the Pi. After having screwed on the spacers, the pHAT slides on top of the header pins, onto the Pi Zero, resulting in a very slim package capable of fitting in a small Altoids-like tin.

 

This is how the Pi Zero and Amp Zero pHAT will be integrated into my speaker build.

Case

If you don’t feel like building your own enclosure, it is possible to purchase a case to accommodate the Pi Zero and Amp Zero. It makes for a very compact controller for your speakers!

For detailed assembly instructions, be sure to check out the official guide!

Software

I’m using the latest Raspbian image, as I require the Scroll pHAT software and some custom scripts to run. If you are using only the Amp Zero, other distributions like OSMC or Volumio for example, already have integrated support for the pHAT.

Enabling support for the Amp Zero is a piece of cake though, as it only requires you to add or comment following lines in the /boot/config.txt file:

 

Scroll pHAT

The Scroll pHAT is used to display the spectrum of the audio. I based myself on an example by Pimoroni, which also contains the installation procedure. Pimoroni’s example processes audio files, but with some minor modifications, I was able to have it display the spectrum of an audio stream instead.

Loopback

To feed the spectrum analyser with an audio stream, a loopback device has been created. This was achieved by modifying the ALSA config in /etc/asound.conf:

This means that by default, audio is sent to output device “both”, which consists of two outputs: the DAC and a loopback device. The loopback device’s counterpart will then be used to feed the stream to the spectrum analyser.

Spectrum Analyser

The modified code, visualising the spectrum on the Scroll pHAT:

To take into account possible crashes of the spectrum analyser, a script has been created to restart it in case it is not or no longer running.

Enclosure

Inspired by Bob’s spiral vase, I attempted to recreate something similar for the speaker. By offsetting square pieces of wood, a spiral is obtained. One of the pieces is larger, serving both as a stand and a place to install the Scroll pHAT in.

The Pi Zero and Amp Zero are housed inside the speaker, exposing the wifi dongle and power connector at the back.

Too special? You be the judge!

 

 

 

12 thoughts on “Spiral Speaker Build”

    1. Thanks! A professional speaker builder would probably murder me over this build, but I thought it was a fun experiment!

      Yeah, we moved this summer, now I have my very own garage turned into workspace. I can make the mess I want, without being yelled at 😀

  1. Hey, thanks for this great tutorial 😀
    Do you have to power down both pi zero and justboom amp phat ?
    Or do you just power down the justboom amp phat, and it powers down the pi zero ?

  2. I installed all the required modules but for some reason list_devices cannot find anything and I get the following error:

    ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
    ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
    ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
    ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
    ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
    ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
    ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
    ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
    ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
    ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
    ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
    ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
    ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
    ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
    ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
    ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
    ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
    ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
    ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
    ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
    ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
    Cannot connect to server socket err = No such file or directory
    Cannot connect to server request channel
    jack server is not running or cannot be started

    aplay -L is showing the cards:

    aplay -L
    null
    Discard all samples (playback) or generate zero samples (capture)
    both
    default
    sysdefault:CARD=sndrpihifiberry
    snd_rpi_hifiberry_dac,
    Default Audio Device
    dmix:CARD=sndrpihifiberry,DEV=0
    snd_rpi_hifiberry_dac,
    Direct sample mixing device
    dsnoop:CARD=sndrpihifiberry,DEV=0
    snd_rpi_hifiberry_dac,
    Direct sample snooping device
    hw:CARD=sndrpihifiberry,DEV=0
    snd_rpi_hifiberry_dac,
    Direct hardware device without any conversions
    plughw:CARD=sndrpihifiberry,DEV=0
    snd_rpi_hifiberry_dac,
    Hardware device with all software conversions

Leave a Reply

Your email address will not be published. Required fields are marked *