6

Okay, I know there are tons of Raspberry Pi audio setups out there and I've probably read thru most of them by now. My understanding is that the common use case is using the Raspberry Pi to play off a network store or Pandora. What I'm trying to do is have the Raspberry Pi act as a remote speaker system for my ubuntu laptop. I.e. I want to rout all sound (mp3s, youtube, flash, etc) out of my laptop to the Pi over wireless. For the sake of completeness I'm using the HiFimeDIY Sabre USB DAC.

Things that I have tried so far.

  1. Pulse audio TCP network sink on Pi and enabling Make Discoverable Network Cards in paprefs on the laptop as suggested here: http://seagrief.co.uk/2013/04/yhttp://seagrief.co.uk/2013/04/yet-another-musical-raspberry-pi/et-another-musical-raspberry-pi/

This actually works pretty decently, however there is lag and sporadic pauses. I can't help thinking that TCP is the real culprit here and all my networking knowledge suggests that sound should really go thru UDP.

  1. I then tried the Multicast RTP option in Pulse. As soon as I select the RTP soundcard in sound settings this floods the network with packets and severely cripples it. The sound will play but the quality is horrible and the network is overall unusable (ping to an external website will jump to ~3000ms). This is apparently a known and unsolved bug with Pulse.

  2. I then thought of turning the Pi into an Airplay receiver as is well documented and using Pulse to send to an airplay device. I am able to run shairport on the Pi and I can see the airplay sound card in my sound settings however sound won't play. Google suggests that this is a known and active bug:

https://bugs.freedesktop.org/show_bug.cgi?id=42804

I'm wondering if anyone has other suggestions that I might try. This clearly works in TCP it's just crappy and I can't see any reason why this should not work (better) with UDP.

Thanks!

Narek
  • 61
  • 1
  • 3

3 Answers3

3

I would recommend you to install Volumio on your boot sd card volumio It is an really awesome distribution for the raspberry. It´s basically a musicplayer with a network interface. You can connect your NAS to the system, stream internet radio and stream music over airplay and DLNA. I use PulseAudio to stream my sound output to volumio Pulse Audio and on my Mac it is even easier, you can select any Airplay speaker in your network. Webinterface Mac audio

user13272
  • 71
  • 2
  • 5
1

I will suggest you to use MPD. I will describe you my own configuration. May be can you inspire yourself from what I did.

I currently have two MPD servers on my raspberry. One is to directly read music from a HDD to the RPi speakers. It is configured to listen port 6600

The second one outputs to an icecast2 server. Doing this, I can read the music on my HDD from anywhere, just like connecting to a web-radio. It is configured to listen to port 6601.

A small demonstration

I made a small test: I created a playlist for my first server to read from my second. Content of stream.m3u (which I placed into /var/lib/mpd/playlists/ dir of my RPi):

#EXTM3U
http://localhost:8000/mpd.ogg

I set my first server to play stream.m3y playlist. I set a song to play on my second server. Result: the song is played from the RPi.

Well of course, no interest here (the song is played from the server where the audio content is). But

The suggestion

Setting up a MPD server on a RPi is easy to do (there is a lot of articles on the web explaining this).

If you set a streaming server on your Ubuntu and redirect all your audio to it, you should be able to play it on your RPi.

Apparently (see here) you can redirect your sound card output and stream it (using ices2 and icecast2).

You could also use DarkIce (see this link) to do this.

Let us know if it works and if the quality is correct !

lauhub
  • 334
  • 3
  • 9
0

Have you tried this? Using Pi to stream all audio output from my pc to my stereo

I want to do exactly the opposite but over the network =).

Your latency problems might be due to the fact that you are using wireless. I don't know if this is a general issue or not, but I noticed that my raspberry pi even with wired connections has some weird behavior over the network, so perhaps the processor is not powerful enough to process realtime applications, or maybe it just has some networking processing issues, not sure. I would suggest you to try the same thing you have done over wired networking to see if it works better.

Regards.

Albert Vonpupp
  • 310
  • 1
  • 2
  • 7