Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm running a ubuntu server, I've configured it with a pulseaudio RTP multicast sink. This sink is in use for a multitude of applications.

What i'm looking for now is if there is a way to have an additional "channel" for RTP multicasts, so the same computer can multicast different streams at the same time, and if i can then configure my computer to just accept one of those channels.

It could be compared to different zones in a home audio sound system, where every zone would have it's own multicast "channel"

Is this possible, and in that case how would it be accomplished?

share|improve this question
add comment

1 Answer

It may be possible to send more than one concurrent RTP stream via your local network by assigning a different Multicast IP to each of them with:

# stream 1
pactl load-module module-null-sink sink_name=rtp1 format=s16be channels=1 rate=44100 sink_properties="device.description='rtp1'"
pactl load-module module module-rtp-send source=rtp1.monitor loop=0 destination=224.0.0.56
# stream 2
pactl load-module module-null-sink sink_name=rtp2 format=s16be channels=1 rate=44100 sink_properties="device.description='rtp2'"
pactl load-module module module-rtp-send source=rtp2.monitor loop=0 destination=224.0.0.57

and then listen on the receiver to the corresponding IP with

pactl load-module module-rtp-recv sap_address=224.0.0.56 # resp. 224.0.0.57

However I was unable to test if this really works how I think it should.

In addition, this method has several disadvantages:

  • for each RTP sending stream we need to define it's own (exclusive) sink.
  • sending multiple uncompressed audio streams via our network will inevitably lead to congestion, as these streams will take a lot of bandwith.
  • we need a script solution to be able to select a "channel" from the streams on the receiver side.
  • generating multiple simultaneous RTP streams will need quite some CPU power on the server, so this is possibly risky.

A much better alternative that I would like to suggest here is to set up an Icecast Server on your Ubuntu server. It is no so hard to do:

With this solution you will be able to

  • stream compressed audio data (e.g. ogg or mp3) in your network
  • send multiple audio channels (i.e. "radio stations") simultaneously
  • switch easily between these streams from the receiver (which could then also be an Internet Radio receiver, or a smartphone) just from the name of the stream
  • Ices2 resp. Ices help you to stream playlists, Darkice to stream data of your sound card.
share|improve this answer
    
Icecast would sound like a good solution, but does icecast support client synchronization to ensure simultaneous playback? From what i know it doesn't –  Delusional Logic Apr 30 '13 at 20:00
    
@DelusionalLogic: not that I know, I doubt you can do that with Icecast. Can you sync RTP? –  Takkat Apr 30 '13 at 20:20
    
From what I've read it would seem like pulseaudio supports syncing the different receivers of the multicast, assuming they all have a fairly tightly synced time. –  Delusional Logic Apr 30 '13 at 21:18
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.