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
  • You say you want all the sound routed to your speakers over wireless, but then the types of "sound" you list are only media related. Do you want everything that you would hear on your laptop (even the little terminal bell) routed over wireless to the speakers, or just media related audio? – syb0rg Aug 11 '13 at 18:16
  • Well in practice I only care about media. My point though is that most of the media comes from sources such as the web browser/flash/youtube etc, so routing everything from the computer to the speakers would be the most reasonable. I know I could use VLC for example to stream media to the Pi, but that's not what I want. – Narek Aug 11 '13 at 18:37
  • I think what you want are just wireless speakers. No raspbi required. – Andrew Sledge Aug 11 '13 at 22:40
  • Wireless speakers don't really cut it for me , because I already have a very nice speakers which are definitely better than any reasonably priced speakers on the market. I had an alternative wireless soundcard system, which worked ok (again no great sound quality) but broke. The advantage I see from having a raspberry pi do the job is that I can have a good DAC plugged in and play high quality audio from a network store or even pandora running on the Pi, and at the same time stream youtube from my laptop at decent quality. – Narek Aug 11 '13 at 23:54
  • @Narek - Have you found a solution to this yet. Please post here. I am also looking for a solution to the same problem. – kapad Nov 24 '13 at 14:12

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
  • Thanks for this reply. I actually installed Volumio and it's a great project, however I'm unable to use Airplay from Linux. It wasn't clear to me from your post whether you've actually been able to stream from Linux or not.

    My situation is this. I can see the volumio sink in pavucontrol, however when I select it I don't hear anything and the linux playback stops. I've tried running shairport separately with all the verbose settings on and I see a 400 Error. You can see the full error log here:

    https://github.com/abrasive/shairport/issues/363

    – Narek Aug 16 '14 at 17:39
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
  • 8
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