Volumio Audio Streamer Enclosure With Raspberry Pi and Touch Screen

by pat_pending in Circuits > Raspberry Pi

2091 Views, 5 Favorites, 0 Comments

Volumio Audio Streamer Enclosure With Raspberry Pi and Touch Screen

IMG_4847.jpg
IMG_4845.jpg

Here's a quick Instructable for how to build the case Volumio and Raspberry Pi deserve! If you are not familiar with Volumio check it out here:

https://volumio.com/en/

In short: it's an OpenSource audio streamer project with premium integrations to the likes of Spotify, Tidal, Mixcloud etc and above all, plays local files and supports ridiculous HiRes formats. I downloaded it first of all to test out 352KHz@24bit HD files. Each track is about 400MB! Since then i've been playing with it and it's great with an active community developing cool plugins etc. I have some ideas for API integrations myself but need to retire to find the time to develop them unfortunately.

Anyway, when I was sure Volumio had a place in my setup, I needed to address the issue of the Raspberry Pi case. The plastic 3dPrinted enclosure with wires poking out wasn't the aesthetic i was going for and it needed a screen to show album art/now playing etc.

So I got to work and I'm really, really pleased with the result. I'm not finished with the project yet: I still need to mount a USB port at the rear and a power button at the front etc but its good to get started.

Word of warning to anyone trying this: Raspberry Pi USB Wifi install can burn hours/days of time. This was partly the reason for writing this up i.e preventing others from tearing their hair out/swearing out loud like I did.

Happy Making! Please share any pics of completed projects.

Patrick



Supplies

41B453B7-9FDD-44B4-9A22-4908847BA4A6_1_105_c.jpeg
9CCE8793-521B-4AD7-848B-DC9202F83E21_1_105_c.jpeg
FCD55F36-4FEE-41EE-B74B-C7D7AD4AA859_1_105_c.jpeg
IMG_4848.png

Raspberry Pi 4

Pimoroni HyperPixel 4 touch :

https://shop.pimoroni.com/products/hyperpixel-4?variant=12569485443155

GPIO 40 pin ribbon extension:

https://shop.pimoroni.com/products/hyperpixel-4?variant=12569485443155

Maxesia AC1300 USB3 WiFi adapter:

https://www.amazon.co.uk/Maxesla-AC1300Mbps-Adapter-Internet-Powerful/dp/B08MTY1FYW

RP SMA MALE to RP SMA FEMALE PIGTAIL LEAD EXTENSION CABLE RG316 10cm to 300cm

https://www.ebay.co.uk/itm/385643944962?var=653447140456

Super-sweet case!!

Douk Audio Aluminum Chassis HiFi Case Amplifier Enclosure DAC Cabinet DIY Box_UK

https://www.amazon.co.uk/Aluminum-Chassis-Amplifier-Enclosure-Cabinet/dp/B073WVQTJ8

Worth shopping around for these cases on Bangood/Ali etc. the price varies wildly. I must say I was very happy with the quality of this one. Really chunky and even the bottom plate was thick enough to tap to mount the Raspberry P. I thin you'd probably spend more money on aluminium plate if you were buying it separately.


Tools:

2.5mm drill

6.5mm drill for the wifi antenna mount hole

M3 Tap set

CNC mini engraver (Dremel and a steady hand can be used instead)

3d Printer - Not essential as you can see. Its just for the little mounts. Scrap wood would work just as well.

Callipers/ruler for measuring and marking out

Cut Out the Case

E104FAEF-AE8B-4BBE-81CE-17E35AA861F7_1_105_c.jpeg
E2B88569-B5A0-41E4-8347-9CA99FA572A6_1_105_c.jpeg
05EEECC4-B5CB-49FC-A15E-C532D8768F1C_1_105_c.jpeg
030E37B3-54FC-43B2-9DA4-4E7852924D11_1_105_c.jpeg
Screenshot 2023-12-17 at 14.21.17.png

Ok this step is self-explanatory. I accept I cheated by using a AliExpress CNC Router here but I have uploaded all my measurements here if you want to print a template and get going with a Dremel/other rotary tool. If you are going the CNC route I have included my Fusion360 file so you could go in there and build a toolpath yourself.

Thinking about this some more, if I were doing this without a CNC router, I would cut a hole using an electric jigsaw as neatly as I could and then 3dPrint a nice bezel to go in the hole to neaten up and cover any imperfections. This might make it easier to mount the screen too.

I mounted the faceplate to the spoilboard directly and the cut was really nice from the front as you can see with only minor deburring needed. The router took FOREVER to get through that 8MM aluminium!

Design decisions

I offset the screen as far to the left as I could because I want to add buttons in the future.

Mount the Touchscreen

E641B208-0FDC-4201-8C88-60E9A4699C92_1_105_c.jpeg
D2984CAF-0CFC-4E4E-8E77-988AC11CFF3B_1_105_c.jpeg
9DF49A65-5BC8-4D4E-9510-7701E482E681_1_105_c.jpeg

Nothing fancy here, the screen fitted into the recess beautifully! All i needed to do was drill 4 holes with the 2.5mm drill and tap to 3mm. Make sure the holes are as close to the screen recess as possible as there isn't a lot of space between that and the side of the case when assembled.

Mount the Pi and Fit Everything Into the Case

96501239-7EF3-418B-8918-9E4235BD0FCA_1_105_c.jpeg
BC6D5AC1-5CA0-4E0E-83C5-90CC5AB4195A_1_105_c.jpeg
Screenshot 2023-12-17 at 14.34.22.png

Again pretty simple. I mounted the pi on a 3dPrinted base as shown. I have included the Fusion F3d if you want to print it yourself. This was a good opportunity to stick a heatsink onto the CPU too. The case is nice and airy so shouldn't be a problem but better to do anyway.

Connecting up the screen with the Ribbon cable was a bit of hassle as I needed to butcher the plastic shroud off one end of the cable for it to fit into the display. I used a dremel for this but a pair of pliers or hacksaw would work just as well.

Downloads

Install Volumio

Simple. get the Image from here:

https://volumio.com/en/get-started/

And flash using Balena Etcher:

https://etcher.balena.io/

Start up the pi and follow the Volumio instructions to get the base install running OK and connecting to your network etc.

Take a while to get familiar with the UI and the iOS/Android apps. v cool.

IMPORTANT BIT:

you need to enable SSH to be able to log in to the pi. To do this, go to your Volumio web URL and add a /dev to the URL string. This takes you to a 'behind the scenes' page with options not meant for most users. There is an option to enable SSH there. Then reboot.

Enable the HyperPixel

Now you need to enable the touchscreen.

  1. sudo apt-get update
  2. sudo apt install apt-utils
  3. sudo apt install device-tree-compiler
  4. sudo apt-get install rpi.gpio
  5.  sudo git clone https://github.com/pimoroni/hyperpixel4 -b pi4
  6.  cd hyperpixel4/
  7.  sudo ./install.sh
  8. sudo reboot

The above steps have been rock solid for me. I had to install and reinstall countless times to get the whole thing working but never had a failure here.

Enable the Touchscreen Plugin in Volumio

Screenshot 2023-12-17 at 14.50.56.png

Go into your Volumio web UI and install the TouchScreen plugin and configure the options. This takes a while as it is installing tons of libraries and the whole XWindows system on an otherwise headless base image.

After this completes, go to the options and set the screen rotation to 90degrees and set your screensaver options.

Bang! After a reboot, your Hyperpixel should be showing the lovely UI and responding to touchscreen events.

Build the Drivers for the 88x2bu USB Wifi Dongle

IMG_4849.png
IMG_4848.png

I never for the life of me thought this could be so much hassle!!!! I wasted hours on this but eventually cracked it.

Riding on the shoulders of giants, all the real work done by the OpenSource community and this chap called morrownr on GitHub: https://github.com/morrownr

The pages he maintains has a lot of info on different Linux versions Including the Raspberry Pi (Debian). I got lost very quickly. In the end I adapted the guide I found at PiHut and adapted it for my precise chipset:

https://thepihut.com/blogs/raspberry-pi-tutorials/how-to-setup-a-rtl881cu-usb-wifi-adapter-with-the-raspberry-pi-4

Incidentally: to find out what chipset your driver is use the lsusb command.

First turn off some 64bit options and onboard wifi.

  1. sudo nano /boot/config.txt
  2. add the line: arm_64bit=0
  3. dtoverlay=disable-wifi

Now install the kernel headers and tools required to build the driver:

  1. sudo apt install -y build-essential
  2. sudo apt install -y bc
  3. sudo apt install -y dkms
  4. sudo apt install -y git

BUT... this wont download the correct kernel headers for some reason. You need to use a useful little tool to get the headers for the exact kernel version Volumio uses (Raspberry Pi (6.1.58-v7l+ armv7l)).

  1. sudo apt install -y rpi-source

will this just work as is?... what do you think ? :-)

I figured out this script requires Python3 but the old build Volumio is based around (Buster) still has Python 2.7 as the default.

To make Python 3 default:

  1. sudo cp /usr/bin/python ~/python_backup_incase_i_need_it
  2. sudo rm /usr/bin/python
  3. sudo ln -s /usr/bin/python3 /usr/bin/python

now you can run rpi-source which will pull all the correct headers and build a load of stuff. This takes a while but is strangely satisfying to watch.

Now download the driver source code from GitHub.

  1. git clone https://github.com/morrownr/88x2bu-20210702.git
  2. cd 88x2bu-20210702/
  3. sudo ./install-driver.sh

This should now whizz into life and compile the driver without errors and at the end prompt you to configure the driver options.

Reboot and that should be it!! Check the wifi adapter to see if the blue light is flashing to indicate activity. You can configure SSID etc as per normal using rpi-config or editing the files directly though doing dso is out of the scope of this instructable. To see if the driver is worlking OK type ifconfig and you should see something like:

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500

    inet 192.168.0.230 netmask 255.255.255.0 broadcast 192.168.0.255

    ether 90:de:80:2d:97:3c txqueuelen 1000 (Ethernet)

    RX packets 83240 bytes 73359674 (69.9 MiB)

    RX errors 0 dropped 95 overruns 0 frame 0

    TX packets 27897 bytes 5765983 (5.4 MiB)

    TX errors 0 dropped 2 overruns 0 carrier 0 collisions 0


DONE!


Conclusion

Very happy with the result but without the effort getting the Wifi to work I probably wouldn't have bothered writing it up. Hindsight is a wonderful thing but if I were doing this again I'd go with a wifi adapter that is on the Raspberry Pi compatibility list so its directly supported / Plug n Play per this list here:

https://elinux.org/RPi_USB_Wi-Fi_Adapters

That said, this is still quite a minefield due to the many chip variations and OS versions. I might end up needing to recompile the driver if a future Volumio update breaks it. At least I know how to do this now!

Hope you got something out of this tutorial. Send pics if you build one. I will also add pics once i figure out how to make some nice looking buttons for the front panel.

Thanks for looking,

Patrick