Tuesday, November 15, 2016

Introduction to Music with Rpi’s

Introduction to Music with Rpi’s

Going to try and explain my experiences in setting up a music solution utilizing Raspberry Pi technology. The solutions may be applicable to older generation of Rpi’s, but I am working with Rpi2, Rpi3 and Rpi_zero.

As I have written previously, the Raspberry Pi lends itself to playing music (see posting about the uniqueness of the Raspberry Pi 2). The Rpi2 and Rpi3 systems have many options for outputting music including a headphone jack, HDMI port for high quality SPDIF 5.1 surround sound, and many USB options for both audio input and output. Various manufacturers also offer audio boards that connect to the Rpi GPIO pins; these boards are called HATs. Additionally, the Rpi3 has onboard bluetooth signal which can output audio to the many bluetooth audio devices available. I have been tasking myself to produce an audio system that is low cost, possibly solar powered, and ideally streaming music from the collection of live music hosted at archive.org. I think both the hardware, software and wireless technologies have recently come together to enable this vision.

HARDWARE
Raspberry Pi system on a chip combine functionality with low cost. There are many new versions of SOC solutions. I am sticking with the Raspberry Pi Foundation's because of their proven costs, as low as $5, fits the goals of my audio project. $5 is the cost of their hard to acquire Raspberry Pi Zero. I experiment on the Raspberry Pi 3, a $35 solution that has wifi and bluetooth wireless capabilities built into the board.

My goals for this project are to get the highest quality audio at the lowest cost. These are subjective terms. With the price point of Rpi gear so low, the audio solution should also be low, to a certain extent. Also, most of any challenges I've experience with Rpi gear is because I've either used inexpensive power supply or an inexpensive microsd card. It pays to not skimp on these important factors.

What I have noticed is a leapfrog in the ability to obtain and play music from all around the world using low cost devices. And the sound can be of quite high quality.

ENERGY
Because my goal is to make a stand alone solar powered music player I need the energy consumption to be low. Testing the RPi3 found that it uses between 3 and 4 watts, but often much less. Typically a Rpi with a USB audio solution will use about this much energy. With an amplifier connected the system will use a little more than the rated output of the amplifier if you are playing at the highest volume.  An important system factor is how many power supplies will be needed? Testing showed a complete energy useage of 4 watts for a Rpi and an amplifier. So a 5 watt solar panel could theoretically power the music system for as many hours of the day the sun is shining. A small battery charged by the solar panel would help during cloudy weather.

An important factor is what kind of power sources you have. If you are wanting to use only a standard Rpi USB 5v (and always have at least 2 amps), then you probably want to go with the USB audio card route. But if you need an amplifier and have a higher voltage supply, or 12 V battery from a car, then you may want something like a Suptronics x400 solution. Many of these solutions will work very well for a car application, headphone only, or amplified stereo.

A pi Zero running v3.0 MoOde used 5.16V and 0.19 amps which is 0.98 watts running a USB audio card and a wifi dongle through a USB hub. While starting up this used more power for a very short period of time. 1 watt powered the pi Zero headphones, slightly higher when performing wifi interactive communications. The Rpi3 used 0.26 amps or 1.35 watts for the same functionality. 

SOFTWARE
While evaluating the hardware, I was also evaluating software. Usability is important, so software and the user interface became another thing to evaluate. I like using my android phone as an input device for music selection, and in my opinion it is a plus if others can use their own devices to interface with playing music.

One of the interesting aspects of the Raspberry Pi computers is that they can use a variety of operating systems. At the time of this writing the operating system I prefer is called Pixel, Raspbian Jessie 16.04. For a stand alone project like this music project a customized music software/OS can be used like Volimo or in my case, Moode Audio.

For me, I’ve found Moode Audio to be an easy software package to use which meets my current evaluation needs. Using an android program called Fing I am able to see the Moode Audio wifi connection address on our local wifi network and then go to a browser to put in that numeric address. The Moode Audio user interface starts on your browser then you can change settings, pick music, create a playlist and more. People with laptops, tablets, iphones and androids are all able to access the music server, control volume, choose an internet streaming site, or pick from my many FLAC files.

Had one small challenge when our wifi setting mysteriously disappeared on Moode Audio. Had to reconnect to the ethernet, put in the wifi name and password again and everything was working once again. One thing that that Moode Audio doesn't stream music from archive.org directly, but does using Airplay.
Rpi3 with USB thumbdrive, USB Harddrive and USB audio with a PCM2704 chip feeding Carver amplifier.
There are some software developers who work on donations and Moode Audio is one of them. When I find software and obtain value from it I try to send some Paypal bucks off in support as I have with Moode.

The evaluation has been broken out into the following audio sections:

And a related post, Uniqueness of the Rpi.

No comments:

Post a Comment

Thanks for any comments you may have.