This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to multiplex multiple audio streams with gstreamer on Sitara

I have 3 AM335x EVM boards.

I am trying to playback simultaneously 2 differents wav audio streams received from 2 Sitara EVMs sending RTP packets... kind like a 3-way telephone conversation where you can hear the 2 other callers if they talk at the same time (even if it is annoying)! 


I made following simulation with my 3 Sitara EVM boards (let's name them EVM1, EVM2, EVM3) running linux+Gstreamer: 
the host (receiver) test board is EVM1 with ip address=192.168.1.101. 

1) I setup up EVM1 as RTP streams receiver: 
gst-launch-0.10 -v udpsrc port=5555 caps="application/x-rtp" ! rtppcmadepay ! alawdec  ! alsasink 

2) The 2 other EVMs (EVM2 and EVM3) start sending RTP stream (differents audio streams for example) 
 - on EVM2:  > gst-launch-0.10 filesrc location=audio2.wav ! wavparse ! audioresample  ! alawenc ! rtppcmapay ! udpsink host=192.168.1.101 port=5555 

- on EVM3:  > gst-launch-0.10 fileserc location=audio3.wav ! audioresample  ! alawenc ! rtppcmapay ! udpsink host=192.168.1.101 port=5555 


From EVM1 audio Output, I am able to hear both audio sound coming from EVM2 and EVM3 at the same time, but the first audio playback that I started (audio2.wav from EVM2) sounds very corrupted as soon as I started the second audio playback (audio3.wav from EVM3). So, only audio3.wav sounds good while audio2.wav sound very corrupted at the same time. 

My goal is to hear both audio simultaneously on EVM1 (even if it is not intelligeable) as in 3-way phone call, but it seems to me that EVM2 and EVM3  RTP streams may need to be mux and demux somewhere? 

Can anyone give me a hint on how to achieve this task?

  • Hi,

    Which Linux version are you using? I seem to remember there was some issue with Gstreamer playing wav files, but I'll have to search to find what it was.

  • I am using linux v3.12 that comes with TI-AM335x SDK v7.0

    There is no issue with playing one wav file. My use case is to play 2 files at the same time from one board when it receives the audio streams through RTP (gstreamer rtp elements).  Please, see again my test steps in my first post.

    Thanks,

  • I've never tried to send 2 streams to the same network sink like you are attempting, but in "server" pipeline I don't see how it would properly handle mixing 2 separate streams.  Off the top of my head I don't know how to adjust for that, but one thing that you could try is to have two separate receive pipes running on your server (each listening on a different port).  Then, you will need to mix those streams together (you could use pulseaudio  or dmix (which isn't part of the SDK filesystem I don't think)).  The Linux SDK Audio page has some info on pulseaudio, though.