Two way audio

Two way audio

  • I am trying to get two way audio to work on my Leopardboard 365 running RR free SDK with 7/30/2010 Arago Kernel GIT + Gstreamer.

      I use the dmaienc_aac and rtpmp4apay elements to send data to a foreign hot (udpsink).  Works great.

    Now, in the reverse direction I try to use the same approach except, of course, my Ubuntu x86 PC soesn't have any HW assist stages to I use ffenc_aac ubstead.  In Leo I tried with and without the dmaidec_aac gst element and a handful of other combinations in both one two-part and two one-way pipelines   No matter what I do, the receiver pipe on Leo doesn't seem to get cycles.  It can be playing along just fine till I start the other pipeline then it just stops playing sound, doesn't die, juist stops as if it were getting no cycles.

     

    Anyone know if Leo/dm365 can support two way audio?  What I need to do to make this work?

     

    Wes

  • Wes,

    First, share your pipelines.  I want to collect them all and put the in a wiki (maybe even have a section of non-working pipelines with an explanation of why it doesn't work).

    You are asking lots of questions at the same time.

    1) I would be very surprised if the leo hardware had a problem capturing and playing audio at the same time.  Hardware is likely fine.

    2) ALSA audio driver, this could be a problem.  I wonder if aplay and arecord running at the same time works?

    3) Using DMAI hardware accelerator for both encode and decode from different processes (could be a problem).  Try one pipeline using ARM decode and the other using DMAI encode and see if it works.

    Todd

  • Todd,

    Here are my pipes with some comments.  I should point out that i have quite a bit of practice with Gstreamer, just not on embedded systems.

    Wes




    To establish two way communication between a Leo 365 and, in my case, two hosts I used this setup:

    LEO                        is 10.253.5.201    RR Free SDK for Leopardboard-365

    Note the Leo linein jack is linelevel, not microphone.  I used a DVD player to feed the audio from a DVD into my Leo.

    LISTENER HOST is 10.253.5.156    Ubuntu 10.04

    SENDER HOST is 10.253.5.214      Ubuntu 10.04


    SENDER HOST

    Outbound

    gst-launch-0.10 alsasrc device=hw:1,0 ! udpsink host=10.253.5.201 port=5555


    LISTENER HOST


    Inbound

    gst-launch-0.10 udpsrc port=5555 caps="application/x-rtp, media=audio, clock-rate=44100, encoding-name=MP4A-LATM, cpresent=0, config=40002420, payload=96" ! rtpmp4adepay !  decodebin ! alsasink sync=false


    LEO

    Inbound

    gst-launch udpsrc port=5555 caps="audio/x-raw-int, endianness=1234,signed=true, width=16, depth=16, rate=44100, channels=1" ! alsasink

    Outbound

    gst-launch alsasrc ! queue ! audioresample ! dmaienc_aac outputBufferSize=10000000 outputformat=2 ! rtpmp4apay ! queue2 ! udpsink port=5555 host=10.253.5.156


    On Leo, I put these commands into shell scripts named send and recv, one launch command per script.  I then issued  ./send & and ./recv at the command prompt.  (note the & after ./send to cause ./send to run in the background).  I started the other pipes on their hosts and was easily able to hear my DVD and using a microphone on the SSENDER HOST and  headphones on Leo, I could talk to myself.

     


     

    I also tried build a combined pipeline:

    gst-launch          alsasrc ! queue ! audioresample ! dmaienc_aac outputBufferSize=10000000 outputformat=2 ! rtpmp4apay ! queue2 ! udpsink port=5555 host=10.253.5.156        udpsrc port=5555 caps="audio/x-raw-int, endianness=1234,signed=true, width=16, depth=16, rate=44100, channels=1" ! alsasink      

    which did nit work.  I was sending the DVD audio but not getting any voice back.

    I noticed that as two separate pipes, I was able to use port 5555 for both input and output.  I wondered if perhaps being in the same pipeline might tie up port 5555 for, say, outbound traffic only.  I rewrote the pipe to use port 5556 for listening (udpsrc) and adjusted t he pipes on the SENDING HOST, but that didn't work either. 

    I went back and tried just ./recv on Leo, edited to use port 5556, and still used port 5556 on the SENDING HOST.  That did work, so we know port 5556 and 5555 are open and working.  (note, my port 6666 did not work).

     

     


     

  • All,

    A word of caution, my outbound stream was c0ming from a DVD player and had a HUGE brackground hum.  I replaced the inpput with my BlackBerry and the output on the LISTENER HOST is very choppy and somewhat sped up.  I am searching for improvements for the pipeline and will post them when I find them.

    Wes