Audio Streaming On The Cheap With An RPi Zero

The minuscule size of the Raspberry Pi Zero makes it perfect for hacks where size is a factor. For example, a small, standalone device for getting streaming audio into your speakers. The RPi Zero doesn’t have an audio output on board, so PolyVection paired it up with their PlainDAC to build a minimal audio streaming device.

Their build uses a few lines from the GPIO header to drive an I2S digital to analog converter. The DAC is a PCM5142 from Texas Instruments that provides high quality sound output, and contains a built in programmable DSP.

The hardware fits into a 3D printed case, coming in at 68 mm by 48 mm. There’s no WiFi inside, but this can be added with an external USB device for wireless streaming. The DAC used is supported by the Linux kernel, so a simple configuration is all that’s needed to pipe audio out.

Once you have a device like this assembled, you can install a server like Music Player Daemon to remotely control the device and cue up internet radio channels.

Logic Noise: Digital To Analog With An R-2R DAC

Making sound with digital logic usually calls for a Digital to Analog converter. Building one can be very simple, and the sound quality out of an R-2R Ladder is actually pretty good.

In the last edition of Logic Noise, we built up a (relatively) simple VCO — voltage-controlled oscillator — that had roughly one-volt-per-octave response. I even demonstrated it working mostly in tune with another synth’s keyboard. But what if you don’t have a control-voltage keyboard sitting around or you want to combine all of the logic-based circuits that we’ve been building with other circuits under voltage control? That’s where the digital to analog (DAC) voltage converter comes in.

Continue reading “Logic Noise: Digital To Analog With An R-2R DAC”

Video FPGA With No External A/D

You have an old PC with a nonstandard RGB video out and you need to bring it to a modern PAL TV set. That’s the problem [svofski] had, so he decided to use an Altera-based DE1 board to do the conversion. Normally, you’d expect reading an RGB video signal would take an analog to digital converter, which is not typically present on an FPGA. Instead of adding an external device, [svofski] used a trick to hijack the FPGA’s LVDS receivers and use them as comparators.

Continue reading “Video FPGA With No External A/D”

ESP8266 As A Networked MP3 Decoder

Support libraries, good application notes, and worked examples from a manufacturer can really help speed us on our way in making cool stuff with new parts. Espressif Systems has been doing a good job with their ESP8266 product (of course, it doesn’t hurt that the thing makes a sub-$5 IOT device a reality). Only recently, though, have they started publishing completed, complex application examples. This demo, a networked MP3 webradio player, just popped up in Github, written by the man better known to us as Sprite_tm. We can’t wait to see more.

The MP3 decoder itself is a port of the MAD MP3 library, adapted for smaller amounts of SRAM and ported to the ESP8266. With a couple external parts, you can make an internet-connected device that you can point to any Icecast MP3 stream, for instance, and it’ll decode and play the resulting audio.

What external parts, you ask? First is something to do the digital-to-analog conversion. The application, as written, is build for an ES9023 DAC, but basically anything that speaks I2S should be workable with only a little bit of datasheet-poking and head-scratching. Of course, you could get rid of the nice-sounding DAC chip and output 5-bit PWM directly from the ESP8266, but aside from being a nice quick demo, it’s going to sound like crap.

The other suggested external IC is an SPI RAM chip to allow for buffering of the incoming MP3 file. WiFi — and TCP networks in general — being what they are, you’re going to want to buffer the MP3 files to prevent glitching. As with the dedicated DAC, you could get away without it (and there are defines in the “playerconfig.h” file to do so) but you’ll probably regret it.

In sum, an ESP8266 chip, a cheap I2S DAC, and some external RAM and you’ve got a webradio player. OK, maybe we’d also add an amplifier chip, power supply, and a speaker. Hmmm…. and a display? Or leave it all configurable over WiFi? Point is, it’s a great worked code example, and a neat DIY device to show your friends.

The downsides? So far, only the mono version of the libMAD decoder / synth has been ported over to ESP8266. The github link is begging for a pull request, the unported code is just sitting there, and we think that someone should take up the task.

Other Resources

In our search for other code examples for the ESP8266, we stumbled on three repositories that appear to be official Espressif repositories on Github: espressif, EspressifSystems, and EspressifApp (for mobile apps that connect to the ESP8266). The official “Low Power Voltage Measurement” example looks like a great place to start, and it uses the current version of the SDK and toolchain.

There’s also an active forum, with their own community Github repository, with a few “Hello World” examples and a nice walkthrough of the toolchain.

And of course, we’ve reported on a few in the past. This application keeps track of battery levels, for instance. If you’ve got the time, have a look at all the posts tagged ESP8266 here on Hackaday.

You couldn’t possibly want more resources for getting started with your ESP8266 project. Oh wait, you want Arduino IDE support?

Thanks [Sprite_tm] for the tip.

Hackaday Prize Entry: Dr. DAC

The theme of this year’s Hackaday Prize is. ‘build something that matters.’ A noble goal, but there’s also a second prize – the Best Product prize – that is giving $100k to one lucky team who can appeal to people with open jaws and wallets. It’s a fabulous prize that also includes a six month residency at the Hackaday Design Lab, but right now there aren’t many contenders for this part of The Hackaday Prize.

[drewrisinger]’s DrDAC USB Audio DAC is one of those project that’s in the running for the Best Product prize. He’s solving the problem of terrible low-quality built-in soundcards that seem to be everywhere. Yes, it’s a simple idea, but the execution is great.

The electronics for DrDAC are pretty much what you would expect for a DIY audio sound card; A PCM2706 takes USB audio and sends it out over I2S. A PCM1794 converts the I2S to analog audio, and an OPA2836  amplifies it and sends everything out through a 1/8″ jack or a pair of RCA plugs.

[drewrisinger] started DrDAC as a school project, and after receiving the PCBs, he noticed a problem. MultiSim’s footprint for a TQFP-32 package was too small, meaning the IC simply wouldn’t fit on the board. It was too late in the semester to order a new board, meaning some sort of rework needed to happen. [drew] fixed this problem by soldering jumper wires between the pads to the leads of the chip. Yes, it looks crazy, but apparently it works. You can check out a video of that whole process below.


The 2015 Hackaday Prize is sponsored by:

Continue reading “Hackaday Prize Entry: Dr. DAC”

HDMI Audio And Video For Neo Geo MVS

[Charlie] was killing some time hacking on some cheap FPGA dev boards he bought from eBay. Initially, he intended to use them to create HDMI ports for a different project before new inspiration hit him. Instead, he added an HDMI port to Neo Geo MVS games. The Neo Geo MVS was a 90’s arcade machine that played gems like the Metal Slug and Samurai Showdown series. [Charlie] has a special knack for mods, being featured on Hackaday before for implementing Zork on hardware and making a mini supergun PCB. What’s especially nice about his newest mod is that the HDMI outputs both audio and video.

[Charlie] obtained the best possible video and audio signal by tapping the digital inputs to the Neo Geo’s DACs (digital-to-analog converter). The FPGA was then used to convert the signals to HDMI, maintaining a digital signal path from video generation to display. While this sounds simple enough, there was a lot that had to be done. The JAMMA video standard’s lower resolution was incompatible with the various resolutions offered by the HDMI protocol. [Charlie] solved this problem by implementing scan doubling using the RAM on the Cyclone II dev board. He then had to downsample the audio to 32kHz (from 55.6kHz) in order to meet the HDMI specs. Getting the sound over HDMI required adding data islands to the signal, a feat [Charlie] admits was a frustrating one.

When he tested the HDMI with his monitor, it was out of spec but still worked. His TV, on the other hand, refused to play it at all. This was due to the Neo Geo outputting 59.1 fps – not the standard 60 fps. Using the FPGA, [Charlie] overclocked the NeoGeo by approximately 1% and used the 27Mhz pixel clock to change the FPGA output to a 720 x 480p signal.

For those that love the scan lines of yore, they can be enabled with the push of a button. [Charlie] notes that there are some slight differences in the shadow effects of some graphics, but he has done his best to minimize them. He also admits that the FPGA code contributes only 100 microseconds of delay compared to analog output, which is fast enough for even the most hardcore gamers.

Check out the video after the break to see how the Neo Geo looks in HDMI along with a side-by-side comparison to a CRT TV.

Continue reading “HDMI Audio And Video For Neo Geo MVS”

DIY USB Stereo Headphone Amplifier

The biggest and best audiophile projects are usually huge tube amps, monstrous speaker cab builds, or something else equally impressive. It doesn’t always have to be that way, though, as [lowderd] demonstrates with a tiny DIY USB DAC build that turns a USB port into a headphone output.

In the Bad Old Days™ putting a DAC on a USB bus would require some rather fancy hardware and a good amount of skill. These days, you can just buy a single chip USB stereo DAC that still has very good specs. [lowderd] used the TI PCM2707 USB DAC, a chip that identifies as a USB Audio Class 1.0 device, so no drivers are needed for it to work in either Windows or OS X.

The circuit fits on a tiny PCB with a USB port on one side, a headphone jack on the other, and the chip and all related components in between. There are some pins on the chip that allow for volume, play/pause. and skip, but these pins were left unconnected for sake of simplicity.

The board was fabbed up at OSH Park, and the second revision of the case laser cut out of bamboo and acrylic by Ponoko. It’s a great looking little box, and something that fits right inside [lowderd]’s headphone case.