What it does
At a high level we essentially built a bluetooth speaker system that synchronizes the audio it plays with an LED Strip. Our project consists of 4 separate parts: +The Hardware - The Raspberry Pi, the power source, and the speakers +The Bluetooth Speaker Part (A2DP sink on the Pi) +The Light Server (A Flask Server that abstracts away the physical LED Strip protocols and allows for network addressing of the LED strip) +The Pulse Audio Analysis Script
How we built it
We started by setting up the hardware (wiring up the lights, connecting the speakers), and then we followed that with getting audio to play over bluetooth to the pi and its speakers. From there, we worked on using the PulseAudio api to analyze the music being played, as well as created our own api for controlling the lights. We then merged these together.
Challenges we ran into
We ran into a variety of challenges from both hardware and software perspectives. We encountered a phantom speaker that would randomly crackle in and out, and would play popping and crackling noises at high volume without being prompted. We solved this by cutting the cords to that particular part of the speaker and ignoring it, instead continuing our project with one speaker out of the pair. Next we encountered an issue in our documentation for PulseAudio, as there weren't any updated Java libraries, and they didn't have support for the functionality we wanted from pi's audio stack. We solved this by finding suitable python libraries, and spending time refreshing our memory on these parts of python to set up both a flask server and a PulseAudio interface which we used to take the Pi's audio output and then communicate with the pi. Additionally, we had spotty connection issues with the pi over bluetooth, which we tracked down to the wifi and bluetooth modules relying on the same antenna, and solved by disabling the wifi on our pi.
Accomplishments that we're proud of
In particular, we are proud of the power setup we had for both the pi and the LED strip, as it, despite consisting of a laptop power supply and a hacked together power converter, managed to reliably power the LED strip throughout the hackathon.
What we learned
We learned python and both using and setting up flask as well as more about the linux audio stack through our interactions with PulseAudio and using it for streaming. We also learned about audio analysis and fast-fourier transformations, and how we could use them to get the magnitude of the audio waves at various points.
What's next for Iris - Sound and Color
We hope to add more sophisticated synchronization and improve the update speed of the LEDs, as well as work out any minor interference or issues of the like we have left.
Log in or sign up for Devpost to join the conversation.