INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Build: Another Raspberry Pi Based Audio Streamer  (Read 22822 times)

RussellS

  • Galactic Citizen
  • ****
  • Posts: 259
Build: Another Raspberry Pi Based Audio Streamer
« on: April 25, 2015, 04:11:51 pm »

I have just put the finishing touches on a project that I am quite proud of. The item in question is an audio streamer based on a Raspberry Pi that is optimised for sound quality. I know this has been done by others but I figure the more the merrier.

My design brief was to build a headless DLNA audio renderer that could be controlled from JRiver and play bit perfect audio at the best possible quality predominantly for headphone listening so minimal background noise and good signal to noise ratio were important factors.

One of the shortcomings of the Raspberry Pi as it stands is the audio performance. The standard analogue audio output can not be considered audiophile quality and, although I have not tried it myself, I am reliably informed that the HDMI audio is not great either. I also found connecting a USB DAC to be unreliable with occasional drop-outs and clicks etc. Therefore I decided to go for an I2S DAC which connects directly to connector P5 on the Pi which as it stands does not have a header soldered on the board so the first thing I had to do was to fit a two row by four pin header to this location. The benefit of the I2S interface is that there is very little CPU overhead required to drive it which is in contrast to a USB connected DAC. Basically the digital audio data is just decoded by the Pi and then the data is serially clocked out over the I2S data line into the DAC. Add to this the fact that there is no local GUI means that there is very low CPU overhead which means it can dedicate it's time to decoding the audio.

So firstly here is the finished device:





The case used for the project is the Power Cool Q6 Mini ITX case which is the perfect size measuring 200mm wide by 225mm deep by 55mm high. The case comes with an external brick type 12v 5A power supply and there is a switching regulator inside the case to generate the normal ITX motherboard voltages. However, I decided to do away with this power arrangement and instead put in a conventional analogue power supply consisting of a toroidal transformer with a dual 9v 30VA sedcondary which then feeds a variable analogue voltage regulator. The reason I went for a variable regulator instead of a fixed 5v one is that I find the Raspberry Pi is much more stable if the voltage is set at about 5.15v especially if a USB WiFi adapter is used.

The front power switch functionality is controlled by the excellent ATXRasPi unit (http://lowpowerlab.com/atxraspi/). This is a smart power controller which allows you to have an external shutdown/reboot button to safely shutdown the Raspberry Pi without needing to login and issue a shutdown or reboot command.

Here is a youtube video showing it's capabilities: https://www.youtube.com/watch?v=w4vSTq2WhN8

Here is the inside of my completed streamer with everything wired up:



I started of using an ESS9023 DAC which sounded great but had two problems. Firstly, it would cut off the first 0.4 seconds of the first song in a play list. This wasn't a problem in the vast majority of cases because generally there is a silent lead in but if a song didn't have silence at the beginning then you lost the first 0.4 seconds which was very noticeable. This can be seen in the following picture which shows the audio file being played compared to the output from the DAC. The top two traces are the original flac file and the bottom two traces are the output from the DAC.



As can be seen the audio file itself only has 0.2s of silence at the beginning but the output of the DAC has 0.4s of silence and so cuts off the beginning of the track. I could find no way around this and after discussing it with the software developer we decided it was probably the muting circuit in the DAC chip that was being a bit slow to unmute. The other problem with the ESS9023 DAC was that there was a fair amount of background noise which, although would not be noticeable if listening with speakers, it was very noticeable through headphones. Therefore another DAC had to be found.
I eventually settled on the HiFiBerry DAC (https://www.hifiberry.com/dac/) which uses the Burr Brown PCM5102 DAC chip. The board itself sits directly on the Raspberry Pi board so there are no wires to connect the two together which makes for a much neater arrangement. The performance of this board is excellent with no noticeable background noise and no cutting off the start of the songs.

With regards to the software there were three choices:

Volumio: https://volumio.org/
RuneAudio: http://www.runeaudio.com/
Pi MusicBox: http://www.woutervanwijk.nl/pimusicbox/

All three choices offer basically the same functionality so it comes down to personal preference. I have tried all three and quickly dismissed Pi MusicBox just because I didn't like the Web GUI layout. I am currently flitting between Volumio and RuneAudio because I find Volumio to be very stable and performs flawlessly but I'm not so keen on the Web GUI. RuneAudio on the other hand seems to be a little flakey and dissapears from the zone list in JRiver quite frequently. However I prefer the Web GUI on RuneAudio so once the stability is sorted out I will probably go with RuneAudio but for the time being I'm using Volumio as the every day system.

I can control the device from Gizmo or JRemote on my Android tablet or phone and enjoy bitperfect playback of my FLAC files including 24bit 192Khz files.

That's pretty much it really. The system sound great and also looks good sitting next to my Little Dot MKIII headphone amp:




Post editted 10th December 2017 to replace broken Photobucket images.
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5233
  • "Linux Merit Badge" Recipient
Re: Build: Another Raspberry Pi Based Audio Streamer
« Reply #1 on: April 25, 2015, 04:42:17 pm »

That looks awesome.

Good call on the Hifiberry BTW; I'm using one of those in a pi-powered portable boombox build, and I've been very impressed with its performance and low overhead.
Logged

RussellS

  • Galactic Citizen
  • ****
  • Posts: 259
Re: Build: Another Raspberry Pi Based Audio Streamer
« Reply #2 on: April 26, 2015, 12:53:40 pm »

That looks awesome.

Thanks very much for those kind words, I really enjoyed building it.

Due to the transformer in there is it quite weighty which gives it a good solid feeling.
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5233
  • "Linux Merit Badge" Recipient
Re: Build: Another Raspberry Pi Based Audio Streamer
« Reply #3 on: April 26, 2015, 01:19:47 pm »

BTW, is there any reason you didn't try the new ARM version of JRiver on the Pi, in lieu of Rune Audio or Volumio?

I run it on a little Pi I use to feed headphones at work, and it works a treat.
Logged

RussellS

  • Galactic Citizen
  • ****
  • Posts: 259
Re: Build: Another Raspberry Pi Based Audio Streamer
« Reply #4 on: April 26, 2015, 03:05:11 pm »

Well, I did think about it but because I wanted a headless system I came to the conclusion that JRiver ARM might not be the best solution.

It's not too late to try it though and It's only another SD card. Will JRiver be usable as a headless system and will it drive the I2S DAC. If it satisfies these two requirements then I will certainly have a play with it when I get some time. Bearing in mind I have no video connector on my box how would I configure it. Would I have to temporarily connect to the HDMI on the Pi inside to do the configuration and then run it headless.
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5233
  • "Linux Merit Badge" Recipient
Re: Build: Another Raspberry Pi Based Audio Streamer
« Reply #5 on: April 26, 2015, 03:32:10 pm »

Well, I did think about it but because I wanted a headless system I came to the conclusion that JRiver ARM might not be the best solution.

It's not too late to try it though and It's only another SD card. Will JRiver be usable as a headless system and will it drive the I2S DAC.

Yes and yes.  I have a box that does both right now.

Quote
If it satisfies these two requirements then I will certainly have a play with it when I get some time. Bearing in mind I have no video connector on my box how would I configure it. Would I have to temporarily connect to the HDMI on the Pi inside to do the configuration and then run it headless.

You don't need to connect the HDMI ever; you do need to do a little special configuration.  Check out my thread over here: http://yabb.jriver.com/interact/index.php?topic=95578.0, this post by Hilton http://yabb.jriver.com/interact/index.php?topic=95578.msg666290#msg666290, and this thread: http://yabb.jriver.com/interact/index.php?topic=91227.0

There's some brief discussion of headless operation in the first link, and some more detailed discussion down in the next two.  The long and short of it is that JRiver needs a running xserver to work, but that doesn't mean you actually need a display plugged in.  There are two main approaches (both of which are documented in the thread I linked):

1) Tweak some config.txt options to force video output even with nothing connected to the HDMI port, and then use x11vnc or an RDP server on the pi, and then connect to the xserver remotely, or
2) Use a vncserver like tigervnc or tightvnc to create a virtual x display, and connect to that xserver remotely.

Option two requires less configuration, but option one has some technical advantages.  I've setup both of them using ssh with no monitor attached to the Pi.  Once you get it working and get the commands sorted, you can create a cron script to start them on boot, or to check that they're running periodically.

Once it's configured how you want you can either use it as a DLNA renderer (like you're doing now), or connect to it directly with Gizmo or JRemote.
Logged

RussellS

  • Galactic Citizen
  • ****
  • Posts: 259
Re: Build: Another Raspberry Pi Based Audio Streamer
« Reply #6 on: April 26, 2015, 03:47:26 pm »

Thanks for that, it's really good to know. I will certainly check it out and have a play.

Of course the other thing I did think of is that I would have to purchase another JRiver license for the Linux version to run on the Pi (assuming it does get a proper release) and I don't think I could justify that expense just to run on one Pi. If the Linux version eventually attains the same functionality and stability as the Windows version then I may consider converting over to a linux based media system anyway as my desktop PC's are Linux Mint I'm already used to it and it would certainly be nice to be free of Windows.
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5233
  • "Linux Merit Badge" Recipient
Re: Build: Another Raspberry Pi Based Audio Streamer
« Reply #7 on: April 26, 2015, 03:53:24 pm »

Of course the other thing I did think of is that I would have to purchase another JRiver license for the Linux version to run on the Pi (assuming it does get a proper release) and I don't think I could justify that expense just to run on one Pi. If the Linux version eventually attains the same functionality and stability as the Windows version then I may consider converting over to a linux based media system anyway as my desktop PC's are Linux Mint I'm already used to it and it would certainly be nice to be free of Windows.

Yeah it is kind of a question mark whether the ARM version will get an official release, and if so, how it will be licensed.  For now it's free to play with I believe.  I'm kind of half-linux in the house right now, so I'm also hoping for a gradual increase in linux feature parity. 
Logged

Kemph1965

  • Member
  • *
  • Posts: 4
Re: Build: Another Raspberry Pi Based Audio Streamer
« Reply #8 on: August 05, 2015, 07:08:20 pm »

Very nice job on this build.  I would like to do the same build and was wondering if you could share the toroidal transformer and DC regulator info. If possible where purchased?
Logged

RussellS

  • Galactic Citizen
  • ****
  • Posts: 259
Re: Build: Another Raspberry Pi Based Audio Streamer
« Reply #9 on: August 14, 2015, 04:49:16 pm »

Very nice job on this build.  I would like to do the same build and was wondering if you could share the toroidal transformer and DC regulator info. If possible where purchased?
Sorry I haven't replied earlier, I have only just seen your reply.

Thanks very much for the kind words, I'm actually listening to some 24bit Pink Floyd on the unit as I type this message and it still sounds absolutely awesome.

Both the transformer and the regulator I purchased from eBay (links below).

http://www.ebay.co.uk/itm/30VA-Toroidal-Transformers-Supplied-With-Fixing-Kit-Various-Types-Stocked-/111626173091?var=&hash=item19fd703aa3
http://www.ebay.co.uk/itm/Voltage-Regulator-Module-Output-5A-1-5-32V-LM338T-/150793799534?hash=item231c02c76e

I could easily have made my own regulator module but I decided to go for the easy option. Just be aware that if you use the same case and regulator as I did then the heatsink on the regulator is too tall to fit in the case so I cut around 25mm off the top of the heatsink. I haven't suffered from any overheating as a result.


Good luck with your build.

Russell
Logged

Kemph1965

  • Member
  • *
  • Posts: 4
Re: Build: Another Raspberry Pi Based Audio Streamer
« Reply #10 on: August 15, 2015, 10:17:06 am »

Thanks for the reply.  I thought the regulator height looked high.  Sometimes pictures can be deceiving.
Logged

Kemph1965

  • Member
  • *
  • Posts: 4
Re: Build: Another Raspberry Pi Based Audio Streamer
« Reply #11 on: August 16, 2015, 06:04:42 pm »

I have another question.
Were you able to get the ATXRaspi working with scripts in the video or did you have to modify for Volumio?
I'm not very good with Linux.  Thanks for your help.
Logged

Kemph1965

  • Member
  • *
  • Posts: 4
Re: Build: Another Raspberry Pi Based Audio Streamer
« Reply #12 on: August 16, 2015, 09:44:23 pm »

Never mind, figured it out.
Logged

RussellS

  • Galactic Citizen
  • ****
  • Posts: 259
Re: Build: Another Raspberry Pi Based Audio Streamer
« Reply #13 on: August 26, 2015, 11:21:01 am »

Sorry, I didn't see your post again. I thought I had my profile set to email me when there was any reply to my posts but obviously not.

I have now changed it so hopefully I will be aware when I get a reply.

Anyway, I'm glad you got it working.

Anything else I can help with just ask.
Logged

DarkPenguin

  • Citizen of the Universe
  • *****
  • Posts: 1921
Re: Build: Another Raspberry Pi Based Audio Streamer
« Reply #14 on: October 19, 2015, 10:20:13 pm »

Pretty pleased with volumio with the raspberry pi 2 and hifi berry.

Much better than just doing DLNA to the Marantz.  Doesn't lock up willy nilly for one thing.
Logged

DarkPenguin

  • Citizen of the Universe
  • *****
  • Posts: 1921
Re: Build: Another Raspberry Pi Based Audio Streamer
« Reply #15 on: November 07, 2015, 01:37:28 pm »



Logged

netboy69

  • Member
  • *
  • Posts: 1
Re: Build: Another Raspberry Pi Based Audio Streamer
« Reply #16 on: April 16, 2017, 08:13:14 am »

Hi, can i please ask you how did you make the back plate???

Regards
Logged
Pages: [1]   Go Up