Sunday, June 11, 2017

$15 Streaming Audio for Cars

I've already written a few Raspberry Pi audio blogs which include:

This blog is a follow-up to the USB Audio Cards blog. Here I evolve the discussion into using the Raspberry Pi W and one of the inexpensive, but good, USB cards. The W version has onboard wifi. I use it as an access point to interface with my phone over hotspot wifi which also provides the system with internet radio.

I have soldered the USB audio card terminals directly to the Raspberry Pi W board as shown in the below photo. A piece of paper is used between the two boards to help reduce any improper touching of the boards.
USB audio card soldered to Raspberry Pi W.

Raspberry Pi W with power cable and blue audio jack

Using my Android phone, I enable the hotspot before turning on the car. Then I can use a hotspot manager on the phone to find the IP address of the
Raspberry Pi W and interact with the music software. I use Moode Audio. The latest version costs $10 but an older version is still free and works just fine. I have many albums ripped to FLAC format on the SD card which are accessible by the software from my phone. The software also allows for internet radio in very high-quality format (for example Groove Salad). This project was specifically designed to fit into a tick tack box as shown in the below photo. $15 covers the cost of the two boards.


Tick tack box used to house the device.
The box fits just below my car stereo's and the short yellow audio jack goes from the project into my car stereo auxiliary input on the front of the car stereo. The USB power is supplied by the car through an adapter. With my phone, I control the music playing through the auxiliary input, streaming internet stations or my own library of high-quality FLAC audio files.

The project installed under car stereo into aux jack.
Hope this is an interesting project for those Raspberry Pi tinkerers. 

Tuesday, November 15, 2016

Grateful Dead Shows Streaming to Parks

Grateful Dead Shows Streaming to Parks


INTRODUCTION

I was a digital audio taper of live music performances for about 10 years, 1995 to 2005. A songcatcher (read Mickey Hart’s book of that title). Instead of attending Jerry Garcia’s funeral I purchased my first DAT deck and started digitally copying live shows as well as recording live performances. Archive.org has eliminated the need for that taper trading community, it was fun while it lasted. I retired my large DAT deck at the soundboard in Winters California at the Palms Playhouse where it probably caught some more good recordings from 2006 to 2010, or maybe longer. Still have a portable Sony DAT deck.

This past February I was invited to present at the Grateful Dead Scholars Conference held in Albuquerque. Good to meet all the people continuing the culture, but I was a little out of my element surrounded by academics. My presentation was on the collective consciousness of the audience and musicians. Most deadheads will understand this concept quite quickly.  IF at all interested please don't hesitate to request a copy of my academic presentation.


SOLAR POWERED MUSIC PROJECT

I am writing this blog because of a project I have been working on for sometime. It waxes and wanes but at the heart is a continuous stream of Grateful Dead music for any location. Technology is enabling the low cost, high quality sound to be amplified and presented in a solar powered package. Here are some of the components:

1. Archive.org like file access to a full dead show, ideally lossless quality
2. Raspberry pi computer to serve files
3. Low cost relatively high quality Digital Audio Converter (DAC)
4. Relatively low cost good amplifier and speakers
5. Way for community to select a show
6. Solar powered.

I have been experimenting with many different audio scenarios and think I am on the verge of one that makes sense. It is a DAC HAT that has an amplifier on top of a Raspberry Pi (Zero, Pi2 or Pi3) running a Linux OS and music serving software that is accessed by a cell phone like Moode Audio. The gizmo isn't as important as the vision. My vision is for Golden Gate State Park, or any park, to have tree mounted speaker systems that can play a show. Alternatively, Bluetooth output could be multicast to anyone with headphones who then could listen into the show simultaneously with others in the area.

I wanted to host an example of an audio box that plays grateful dead concerts. They played some 2,500 shows, most of which are available online at archive.org. Many of these shows are new streaming high quality versions of the taped shows. In particular, a new form of show is emerging that has mixed audience sounds, soundboard recordings plus taper versions of the shows. These matrix recordings can be an amazing blend of the best aspects of the shows. The hardware/software solutions will lend themselves to any other band hosted at archive.org, etree.org, or an internet radio station. Anything streaming can be now amplified in high quality for low cost.

The current state of development for this concept is below. A 20 watt PV panel, charging a 7 amp hour sealed lead acid battery with a pulse width modulation charge controller. This solar and battery powers the Rpi and DAC HAT with the amplifier to power the sony speakers. The speakers are not weatherproof, so this can not be pole mounted yet. The concept is coming along nicely.



DEMONSTRATIONS

On May 8th 20917 I was able to set up the music at Red Rocks stage and play the 40 year old, remastered version of May 8th 1977. Red Rocks is open to the public as long as there are no performances.
Photo: Solar powered system on the stage at Red Rocks broadcasting the remastered May 8, 1977 Cornell University's Barton Hall Grateful Dead show


I also set up the system near Folsom Field before a Dead and Company show 2017. The music seemed to be a draw for people to congregate around the 40 year old live performance, again May 8th 1977 Cornell Universty Barton Hall Grateful Dead show.

Stay tuned to this space as the audio solutions become packaged and tested for the playing of music in the parks.


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

And a related post, Uniqueness of the Rpi.

If you have read to this point, check back for updates on solar and actual park experiences. Don't hesitate to contact me if you want to join in the band, energyideas gmail.

Rpi with Supstronics x400 HAT



In this blog posting i am concentrating on combining the Raspberry Pi 2 or 3 with the Suptronics x400 which I picked up for less than $26 including shipping. This has gone up in price and took over a month to arrive. I picked this particular digital audio converter (DAC) because it connects directly to the RPi3 GIPO pins. An external DAC can increase the quality of music out of Raspberry Pi computers because they have better audio components than the low cost Pi components.  The x400 has three different outputs, RCA jacks that can be connected to an amplifier, headphone jack that uses an amplifier circuit and speaker connections for up to 20 watts of amplification per channel. I like that jumpers can be used to turn off sections of the x400 that aren't needed. I also like that it has onboard hardware volume control, even though I typically use the software volume control on the Moode Audio software. The jacks are not of high quality and are attached to the board in a flimsy fashion. This can be modified for anyone wanting a better connection.
Two GPIO pin extender shown, note gap.
Rpi2 with x400 HAT amplified for cube speakers.
x400 Hat on Rpi2 with USB FLAC files, note wires too big for lugs.
Above Rpi2 with x400 HAT running Polk Audio speakers
Moode Audio sets up the x400 Hat quite nicely. Just select the x400 DAC from the list of I2S audio devices, reboot then apply the MPD again. I set the system settings off an ethernet connection including the wifi settings, then reboot and removed the ethernet cable. Then the Moode Audio interactive software should be available on your web browser at the local wifi address and will play the selected music through the x400. You can use the RCA audio output jacks, the headphone jack or connect speakers to the wire lugs. Again, the audio connections on the x400 are a little flimsy so be careful not to break anything off.  

One reason I chose to experiment with Moode Audio is because it has a customization section which includes filter options for the Burr Brown PCM5122 chipset. The x400 includes this PCM5122 chip so you can on the fly change between different digital interpolation filter settings. Some fun discussions on the internet on these different filters (see links below). My old ears can’t tell the diff, but yours might.

Originally I installed the x400 on a Rpi3, then looked at my inventory of Rpi boards and thought it would be better on the Rpi2 with a $3.50 usb wifi dongle. Used an old laptop power cord who’s socket fit the x400 power input. For under $70 US (plus microsd and power supply) we have a system that is portable, low energy consumption, plays and amplifies music quite nicely with an interface off any web browser.  

Update to Rpi3 and Rpi2 discussion now includes using the $5 Rpi Zero. Soldered GPIO pins to the Zero and screwed it to the Suptronics x400 and after two attempts at soldering it worked! 
DAC HAT attached to Rpi Zero.
Wifi adapter and 32 gb sd card on USB, amplifier for two speakers.
Bottom view.
Side View.
Currently running RCA plugs through Carver to power some Paradigm speakers. FLACs sound excellent.

Three variations of Rpi's and DAC HAT.
These systems have been working very nicely with the latest version of Moode Audio software, amplifying the sound to various speaker configurations.

There are some new HATs from Suptronics which promise to provide affordable sound from Rpi integration. New boards and kits can be found at this web address: http://www.suptronics.com/ My own work is focusing on the x5000 series for solar powered music solutions. Stay tuned to this and other blog entries listed below for any updates. 15 second video of solar powered Suptronics HAT system: https://goo.gl/photos/w775JvDVJfxWM1YSA

Further reading:
Search on either Supstronics or Suptronics, it is out there under both names.

There are some foreign language websites that can be translated by google translate which have some interesting content too. Here are some links to other x400 content:

X400 DAC filters:
http://archimago.blogspot.com/2016/10/measurements-hifiberry-dac-pro-pcm5122.html?m=1

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

And a related post, Uniqueness of the Rpi.

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.

Rpi Zero w/ Two Different Inexpensive USB Audio Cards

Rpi Zero with a Generic Low Cost USB audio Card & Zero with USB and a PCM2704 chip from Texas Instruments.

Lowest cost Rpi audio solution I have found is using the Zero with a inexpensive wifi card and a USB music card, total cost $10. I found audio popping with this scenario. But at a slight increase to $11.50 the sound quality is much nicer using a USB with the PCM2704 chip from Texas Instruments. Both options require additional $'s evaluation for microsd card and power supply. My friends at the Raspberry Pi Discussion Forum turned me onto the PCM2704 low cost USB card that in my opinion outputs nice acceptable sound quality (thanks clacktronics for the suggestion).
MoOde software over wifi from Rpi Zero powered USB hub w/PCM2704 audio.
USB is complicated here, but will be simplified. Zero has a camera too.
Inexpensive USB audio, PCM2704 on bottom; both work on Zero w/MoOde, hot swapping is OK
I will be reducing the USB wiring by soldering the wifi and USB audio with PCM2704 in place above the zero, then put into a small case with power input and audio output jacks showing. My initial attempt to reduce the USB Hub was a complete disaster, disassembling the case and trying to solder the USB Audio card to the USB Hub did not work for me, mostly due to my poor soldering capabilities.
The USB Hub which was destroyed by trying to attach the USB Audio directly.
My goal is to get a tiny package, something like a tic tac container. As you can see, the Rpi0, USB Audio and wifi can easily fit except the USB Hub isn't there.

ENERGY
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. 
Solar powered w/Li-ion battery, Rpi0 with USB Audio, wifi and small speaker.




This tiny solution would enable an inexpensive car audio system controlled by a cell phone. Or just listen with headphones. 

CHROMECAST AUDIO
The comparison of these USB audio systems needs to be compared to a Google Chromecast Audio because the Chromecast has great functionality with lots of audio software. Other very low-cost solutions exist that don't have an amplifier including the items in the photo below (counterclockwise from the top: Rpi0, USB audio card, USB audio card with optical SPDIF, Chromecast Audio with analog and optical SPDIF).

The Chromecast Audio puck is $25 US and has the functionality of a wifi enabled Rpi with audio output, similar to the Rpi0 and USB SPDIF output card shown above. There may be audio quality differences. Through software, I am thinking that the USB audio can be configured to mimic the Chromecast Audio functionality. This may require some skilled software people. It is quite easy to connect many audio services to the Chromecast Audio puck.

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

And a related post, Uniqueness of the Rpi.

Wednesday, August 24, 2016

Breadmaker



It is ridiculous how much gluten free bread costs at the markets. And the loaves are tiny. I've been contemplating how to bake my own for a few years now. A well respected bread maker by Zojirushi of Japan became available to me. Purchased at a reasonable price. It had been at the 2nd hand store for a few months. I went on a particular day that made the price low with multiple discounts. A quick check on the internet showed these sell new for $200 or more, so I took a chance.

The n15 by Zojirushi
It is a bit industrial, lots of metal and an exposed heating element inside the baking compartment. Some clunky sounds while the dough is being prepared. One interesting aspect is that it only uses 500 watts of power. That means I can run it off my solar inverter. I've always been an advocate of solar cooking.

After getting it home, the internet revealed a user manual and some recipes. I wanted to try it out with a standard flour recipe first to determine if is working properly. So miraculously got all the right ingredients from our kitchen, and a couple from the store. Buttermilk and yeast was purchased.  I think the yeast was the problem on my first batch of standard white bread. I purposely purchased the yeast packages with the latest expiration dates, but that didn't seem to matter. It was dead for my purpose. The loaf didn't rise, only half a loaf, very dense and slightly burnt around the sides.
First attempt at bread making ingredients.
Ingredients placed into bread maker baking pan, yeast on top.
I went to the store to get some new yeast, instant yeast, a pound of it for less than $5.  While at the store, the puppy had jumped up on the stove and ate some of the first bread baking experience. He hasn't done anything like that since he was new born, a year ago. Bad dog.
Ingredients for second batch, salt (1t), sugar (2T), yeast (2.25t), butter (2T), flour (3C) by weight and buttermilk (1.25C).
The second loaf did the rising that it was supposed to, but for some reason collapsed. My son had been playing his euphonium at the loudest volume I had ever heard. After the second rise of the bread I had peeked into the maker and saw a nice dome on the loaf which had risen to near the top of the baking pan.When all the baking was finished, the dome had collapsed. No worries.
Collapsed bread next to baking pan.
Looks OK, right?
Taste testers indicated that the bread is good!
Bread, some eatin...
My next try will again be a white loaf during a quite part of the day, probably with powdered milk.  I am working towards the gluten free version very soon.

By the way, third try on the white bread was excellent.

Quick video of bread-maker completing and first look at white bread. still trying to upload the video.

Bread didn't collapse, yeah!
Looking better, and tastes....great!

********* Gluten Free *********
Customer service at Zojirushi said gluten free cannot be done with the n15. The recipes and instructions for gluten free are challenging.  The preset programs aren't right, and all the ingredients listed in any recipe were double what my breadmaker could handle, so I halved as best as possible. And I used a pre-packaged gluten free mix which included at least three of the parts needed. 

Ingredients with associated packages
From Left to Right: baking pan, yeast (1.5t), apple vinegar (1.5t), honey (1.5T), salt (0.75t), flour mix (2C), 2 eggs beaten, milk (0.75C). Not shown, vegetable oil (1.5T).

The program I selected does kneading, two rises for 2 hours, then 44 to 52 minutes of baking.
A newer model breadmaker with a specific program for gluten free shows 17 minutes knead, 5 minutes rise1, 5 minutes rise2, 25 minutes rise3 and 60 minute bake. So I'm just trying my best on this first attempt with a wrong program. Plus I was using some proven live instant yeast, instead of active dry yeast recommended on the newer model. This yeast stuff is quite complicated.

The first attempt for gluten free wasn't a success.
First rise took much too long, as did the second one. Note finger pressed into dough shows it had started to bake.
With at least 30 minutes left on the baking program, I took the loaf out because it looked done from the top.
Bread is edible, but not at all right.
This particular bread maker isn't set up for gluten free, unless you wanted to be uber creative and manually mix the yeast in an hour after the other ingredients were mixed, wait 5 minutes, punch it down, wait 5 minutes, punch it down and then keep an eye on the baking time. Let me know if you want me to try this.

So the moral of the gluten free breadmaker story is, get a bread making machine that specifically has a gluten free program, something like this: knead, rise for 5 minutes, knock down, rise for 5 minutes, knock down then wait a few minutes and bake. 

************ Back to White Bread ************
I purchased some powdered Buttermilk blend, 12 oz for $4.52: 1 C Buttermilk = 4 T blend + 1 C water. That is about $0.95 per loaf. I also picked up some flour at the bulk bin for $0.74/LB; about $0.60 per loaf. For powdered bread, just add water this is a very good scenario.

Successful Irish soda bread, with gluten.
A Irish Soda bread baking was successful using the following ingredients: salt (1t), sugar (2T), yeast (2.t), butter (2T), raisins (0.3C), flour (3.3C) by weight, caraway seeds (2t), water (1.3C) and buttermilk powder (1T). There were three rise sessions in the breadmaker. Took 260 watt-hours of energy, 4 hours to complete the cycle and 0.5 hour to cool down. The taste was dominated by the caraway seeds. Not like I remember as a child, perhaps it was coated in powdered sugar back then. Below is a picture. I ate that slice in the hopes that I can tolerate gluten if fresh baked.

I can now make a multitude of bread recipes with gluten in the old breadmaker. Trick for my high altitude of 6,000 feet is to use less yeast. Feel free to leave comments, hope this helps someone with their baking.

Sunday, July 31, 2016

$5 Music Box Server



After posting about the uniqueness of the Raspberry Pi 2 last year, I have purchased a 3 and a Zero.  This has all been tinkering, figuring out how low cost internet of things computers like the Raspberry Pi family can be put to good use.

This Blog post is about using the Zero 1.3 version to host a music library and shuffle songs to a stereo for listening. I am using a standard Raspbian Jessie operating system that was originally built on the Raspberry Pi 3, but works in the Zero with no issues. It is loaded on a 16 GB microSD card which boots the Zero. My only issue with the Zero is limited USB ports. If I had one more USB available, I could remote control the Zero music using WiFi.

I like Banshee music player because it has a graphic equalizer and has an Android phone app for remote control. I can't say that I understand all the Banshee functionality, but it seems to work for this particular application. Here is the music box server story.

Busy photo showing Raspberry Pi Zero (lower right) and other peripherals.
A few years ago I ripped all my music CD's to FLAC files, a lossless format that I thought would be good for future use. I now have many music folders, and 7,000 music files to choose from that were originally my CD music collection. I put them all onto a $35 hard drive for archiving, the Western Digital PiDrive with 314 gigs of storage, of which about 200 gigs is used by the FLAC file storage.  You can get any storage device you choose, not endorsing the WD hardware. I don't consider this hard drive cost associated with the music server because it is a backup archive. That hard drive is shown in the photo above. It has a bright white light. That is connected to the USB power cord, which then sends the power to the Raspberry Pi Zero. The hard drive USB data cable is connected to the USB data hub (red light in above photo) which also has a wireless keyboard, wireless trackball mouse and USB audio card. The red wire is the analog music which delivers the music to my stereo amplifier. Lots of wires.

The Raspberry Pi Zero has a HDMI mini to standard plug which the monitor is plugged into.

The monitor, wireless keyboard and mouse can be removed from the setup once the music is playing and in shuffle mode.  I have checked the power usage, it is 37 watts with the monitor, and 4 watts without. The hard drive, Zero and USB hub with peripherals use only 4 watts of power.

4 watts of power used for music box server without monitor.
The power is managed by a plug-strip with monitor, high amp output USB power and the USB hub power. Turning the plug-strip on boots up the Zero and goes into desktop mode. I click on the Banshee program and wait until it is fully loaded by watching processor utilization. Then select all artists and hit play. It shuffles the songs, and I get to listen to a random selection of my own music. I assume I could automate the process of running Banshee and automatically playing if necessary.
Raspberry Pi Zero ver 1.3 Running Music Box Server
As far as the music quality is concerned, it is OK. The very inexpensive USB music card has both audio output and microphone input. I assume I can get a DAC solution with much higher quality, I just haven't seen the right solution for my purposes yet. Waiting on some Kickstarter Pi DAC that can provide a SPDIF input (Please don't tell me about the Cirris Logic DAC, way too complicated).

This $5 Zero version 1.3 isn't easy to purchase. I had to wait on vendors mailing lists until they were back in stock. It seems amazing the functionality/price ratio for these systems on a chip (SOC) devices. There are peripheral costs. The Raspberry Pi Foundation keeps the costs low by not having additional functionality which each use case may not require.

Hope this is an interesting Blog. Feel free to comment. Thanks.

This post has been included in an audio evaluation has been broken out into the following audio sections:

And a related post, Uniqueness of the Rpi.