ESP32 Becomes Music Player In Under 40 Lines Of Code

The demo code for [XTronical]’s ESP32-based SD card music player is not even 40 lines long, though it will also require a few economical parts before it all works. Nevertheless, making a microcontroller play MP3s (and other formats) from an SD card is considerably simpler today than it was years ago.

Part of what makes this all work is I2S (Inter-IC Sound), a format for communicating PCM audio data between devices. Besides the ESP32, at the heart of it all is an SD card reader breakout board and the MAX98357A, which can be thought of as a combination I2S decoder and Class D amplifier. The ESP32 reads audio files from the SD card and uses an I2S audio library to send the I2S data stream to the MAX98357A (or two of them for stereo.) From there it is decoded automatically and audio gets pumped though attached speakers.

A few economical components, and only a handful of connections between them.

It’s amazing how much easier audio is to work with when one can take advantage of shuffling audio data around digitally, and the decoder handles multiple formats with an amplifier built in. You can see [XTronical]’s ESP32 player in action in the video embedded below.

Continue reading “ESP32 Becomes Music Player In Under 40 Lines Of Code”

How Did They Get Sampled Sounds From An SN76489 8-bit Sound Chip?

If you were lucky and had well-off parents in the early 1980s, your home computer had a sound chip on board and could make music. There were a variety of chips on the market that combined in some form the tone generators and noise sources of a synthesiser, but without the digital-to-analogue converters of later sound chips designed for sampled audio. They gave birth to chiptune music, but that was all they were made to do. The essence of a hack lies in making something perform in a way it was never intended to, and some game developers for the Acorn BBC Micro had its SN76489 producing sampled audio when it should never have been possible. How did they do it? It’s a topic [Chris Evans] has investigated thoroughly, and his write-up makes for a fascinating explanation.

So, how can a set of audio tone generators be turned into a sampled audio player, and how can it be done when the CPU is a relatively puny 6502? There’s no processor bandwidth for clever Fourier transform tricks, and 1980s tech isn’t set up for high data bandwidths. The answer lies in making best use of the controls the chip does offer, namely frequency and volume of a tone. A single cycle of a tone can be given a volume, and thus can be treated as a single sample of an unintended DAC. By using a tone frequency well above the audio range a suitable sample frequency can be found, and thus an audio stream can be played. The write-up has links to some examples in an emulator, and while they’re hardly hi-fi they’re better than you might expect for the hardware involved. Still, even at that they don’t approach this amazing 48kHz playback on a Commodore 64.

Header: SN76489, on a Colecovision console motherboard. Evan-Amos / Public domain.

Pulling Data From News Feed Telemetry

We are used to seeing shots from TV news helicopters every day, they are part of the backdrop to life in the 21st century. But so often we hear them overlaid with studio commentary, so it’s interesting to hear that their raw audio contains telemetry. It caught the attention of [proto17], who took some audio pulled from a news helicopter video and subjected it to a thorough investigation to retrieve the data.

The write-up is at a very in-depth level, and while there’s an admission that some of the steps could have been performed more easily with ready-made tools, its point is to go through all steps at a low level. So the action largely takes place in GNU Radio, in which we see the process of identifying the signal and shifting it downwards in frequency before deducing its baud rate to retrieve its contents. The story’s not over though, because we then delve into some ASCII tricks to identify the packet frames, before finally retrieving the data itself. It still doesn’t tell you what the data contains, but it’s a fascinating process getting there nonetheless.

It’s easy to forget that GNU Radio has signal processing capabilities far beyond radio, but it was the subject of a fascinating Superconference talk. We even jumped on the bandwagon in the non-foolish part of our April Fool this year.

Swap Your Microwave For A High Voltage Stereo

When building a new project, common wisdom suggests to avoid “reinventing the wheel”, or doing something simple from scratch that’s easily available already. However, if you can build a high-voltage wheel, so to speak, it might be fun just to see what happens. [Dan] decided to reinvent not the wheel, but the speaker, and instead of any conventional build he decided to make one with parts from a microwave and over 6,000 volts.

The circuit he constructed works essentially like a Tesla coil with a modulated audio signal as an input. The build uses the high voltage transformer from the microwave too, which steps the 240 V input up to around 6 kV. To modulate that kind of voltage, [Dan] sends the audio signal through a GU81M vacuum tube with the support of a fleet of high voltage capacitors. The antenna connected to the magnetron does tend to catch on fire somewhere in the middle of each song, so it’s not the safest device around even if the high voltage can be handled properly, but it does work better than expected as a speaker.

If you want a high-voltage speaker that (probably) won’t burn your house down, though, it might be best to stick to a typical Tesla coil. No promises though, since working with high voltages typically doesn’t come with safety guarantees.

Continue reading “Swap Your Microwave For A High Voltage Stereo”

A Transmission Line Speaker With The Design Work To Back It Up

We love the world of audiophiles here at Hackaday, mostly for the rich vein of outrageous claims over dubious audio products that it generates. We’ve made hay with audiophile silliness in the past, but what we really like above that is a high quality audio project done properly. It’s one thing to poke fun at directional oxygen free gold plated USB cables, but it’s another thing entirely to see a high quality audio project that’s backed up by sound design and theory to deliver the best possible listening. [Davide Ercolano]’s transmission line speakers are a good example, because he’s laid out in detail his design choices and methods in their creation.

Starting with the Thiele-Small parameters of his chosen driver, he simulated the  enclosure using the Hornresp software. As a 3D-printed design he was able to give it paraboloid curves to the convoluted waveguide, making it a much closer approximation to an ideal waveguide than a more traditional rectangular design. In the base is a compartment for an amplifier module, with additional Bluetooth capability.

We’d be curious to know how well 3D printed plastic performs in this application when compared for example to something with more mass. However we like these speakers a lot; this is how a high quality audio project should be approached. We’ve delved into speakers more than once in the past, but if you’re looking for something really unusual then how about an electrostatic?

Peek At The Off-Ear Speaker Prototypes For Valve’s VR

The Valve Index VR headset incorporates a number of innovations, one of which is the distinctive off-ear speakers instead of headphones or earbuds. [Emily Ridgway] of Valve shared the design and evolution of this unusual system in a deep dive into the elements of the Index headset. [Emily] explains exactly what they were trying to achieve, how they determined what was and wasn’t important to deliver good sound in a VR environment, and what they were able to accomplish.

First prototype, a proof-of-concept that validated the basic idea and benefits of off-ear audio delivery.

Early research showed that audio was extremely important to providing a person with a good sense of immersion in a VR environment, but delivering a VR-optimized audio experience involved quite a few interesting problems that were not solved with the usual solutions of headphones or earbuds. Headphones and earbuds are optimized to deliver music and entertainment sounds, and it turns out that these aren’t quite up to delivering on everything Valve determined was important in VR.

The human brain is extremely good at using subtle cues to determine whether sounds are “real” or not, and all kinds of details come into play. For example, one’s ear shape, head shape, and facial geometry all add a specific tonal signature to incoming sounds that the brain expects to encounter. It not only helps to localize sounds, but the brain uses their presence (or absence) in deciding how “real” sounds are. Using ear buds to deliver sound directly into ear canals bypasses much of this, and the brain more readily treats such sounds as “not real” or even seeming to come from within one’s head, even if the sound itself — such as footsteps behind one’s back — is physically simulated with a high degree of accuracy. This and other issues were the focus of multiple prototypes and plenty of testing. Interestingly, good audio for VR is not all about being as natural as possible. For example, low frequencies do not occur very often in nature, but good bass is critical to delivering a sense of scale and impact, and plucking emotional strings.

“Hummingbird” prototype using BMR drivers. Over twenty were made and lent to colleagues to test at home. No one wanted to give them back.

The first prototype demonstrated the value of testing a concept as early as possible, and it wasn’t anything fancy. Two small speakers mounted on a skateboard helmet validated the idea of off-ear audio delivery. It wasn’t perfect: the speakers were too heavy, too big, too sensitive to variation in placement, and had poor bass response. But the results were positive enough to warrant more work.

In the end, what ended up in the Index headset is a system that leans heavily on Balanced Mode Radiator (BMR) speaker design. Cambridge Audio has a short and sweet description of how BMR works; it can be thought of as a hybrid between a traditional pistonic speaker drivers and flat-panel speakers, and the final design was able to deliver on all the truly important parts of delivering immersive VR audio in a room-scale environment.

As anyone familiar with engineering and design knows, everything is a tradeoff, and that fact is probably most apparent in cutting-edge technologies. For example, when Valve did a deep dive into field of view (FOV) in head-mounted displays, we saw just how complex balancing different features and tradeoffs could be.

3D Printed Speakers With Many Lessons Learned

Although we all wish that our projects would turn out perfect with no hiccups, the lessons learned from a frustrating project can sometimes be more valuable than the project itself. [Thomas Sanladerer] found this to be the case while trying to build the five satellite speakers for a 5.1 surround sound system, and fortunately shared the entire process with us in all its messy glory.

[Thomas] wanted something a little more attractive than simple rectangular boxes, so he settled on a very nice curved design with few flat faces and no sharp corners, 3D printed in PLA. Inside each is an affordable broadband speaker driver and tweeter, with a crossover circuit to improve the sound quality and protect the drivers. The manufacturer of the drivers, Visatron, provides very nice speaker simulation software to select the appropriate drivers and design the crossover circuit. The front of each speaker consisted of a 3D printed frame, covered with material from a cut-up T-shirt. These covers attach to the main body using magnets and really look the part.

After printing, [Thomas] soaked all the parts in water to clean of the PVA support structures but discovered too late that the outer surfaces are not watertight and a lot of water had seeped into the parts. In an attempt to dry them he left them in the sun for a while which ended up warping some parts, so he had to reprint them anyway. The main bodies were printed in two parts and then glued together. This required a lot of sanding to smooth out the glue joints, and many cycles of paint and sanding to get rid of the layer lines. When assembling the different pieces, he found that many parts did not fit together, which he suspects was caused by incorrect calibration on the delta-bot printer he was using.

In the end, the build took almost two years, as [Thomas] needed breaks between all the frustration, and eventually only used one of the speakers. We’re glad he shared the messy parts of the project, which will hopefully spare someone else a bit of trouble in a project.

Listening to a high-quality audio setup is always a pleasure, and we’ve covered several projects from audiophiles, including affordable DML speakers, and 3D printed speaker drivers.

Continue reading “3D Printed Speakers With Many Lessons Learned”