Hi list,
I'm trying to reverse engineer a RTP audio stream from and to a proprietary device. The data is sent in UDP packets to a multicast address (see the enclosed wireshark dump [1]) With the following gst pipeline I was able to hear the audio coming from the device. (The device sends data to 232.0.2.1 and receives data from 232.0.2.2) # 'client' pipeline gst-launch-0.10 udpsrc multicast-group=232.0.2.1 auto-multicast=true port=49253 \ multicast-iface="eth0" caps="application/x-rtp, media=(string)audio,clock-rate=(int)8000,encoding-name=(string)L16" \ ! rtpL16depay ! alsasink I haven't yet found a gstreamer setup for the opposite way, streaming to the device. The following pipeline just produced a crackling noise on the device: # 'server' pipeline gst-launch-0.10 audiotestsrc ! audioconvert ! \ audio/x-raw-int,depth=16,rate=8000 ! rtpL16pay ! udpsink host=232.0.2.2 port=49253 The output changes to a constant noise when adding channels=8 to the caps string. Based on the attached dumps [1], [2], do these pipelines make sense? What combination would you suggest for the server pipeline? How can I modify the RTP payload type and timing? Thanks for your help Sebastian ######################################################### [1]: Wireshark dump proprietary device (2 packets) ######################################################### No. Time Source Destination Protocol Info 8 0.026451 <localip> <multicastip> RTP PT=DynamicRTP-Type-98, SSRC=0x7D9AFD54, Seq=3, Time=240 Real-Time Transport Protocol 10.. .... = Version: RFC 1889 Version (2) ..0. .... = Padding: False ...0 .... = Extension: False .... 0000 = Contributing source identifiers count: 0 0... .... = Marker: False Payload type: DynamicRTP-Type-98 (98) Sequence number: 3 Timestamp: 240 Synchronization Source identifier: 0x7d9afd54 (2107309396) Payload: e7ff1900f8ffdeff19004400d6ff3b003b00bcff19000000... No. Time Source Destination Protocol Info 10 0.036594 <localip> <multicastip> RTP PT=DynamicRTP-Type-98, SSRC=0x7D9AFD54, Seq=4, Time=320 Real-Time Transport Protocol 10.. .... = Version: RFC 1889 Version (2) ..0. .... = Padding: False ...0 .... = Extension: False .... 0000 = Contributing source identifiers count: 0 0... .... = Marker: False Payload type: DynamicRTP-Type-98 (98) Sequence number: 4 Timestamp: 320 Synchronization Source identifier: 0x7d9afd54 (2107309396) Payload: 88000000a9001100effff8ffd6ffbcff35ffa3ff78ff67ff... ################################################################ [2]: Wireshark dump reverse engineered gstreamer 'server' pipeline (2 packets) ############################################################### No. Time Source Destination Protocol Info 2498 58.790631 192.168.0.30 232.0.2.1 RTP PT=DynamicRTP-Type-96, SSRC=0x37E90F89, Seq=34530, Time=2083047297 Real-Time Transport Protocol 10.. .... = Version: RFC 1889 Version (2) ..0. .... = Padding: False ...0 .... = Extension: False .... 0000 = Contributing source identifiers count: 0 0... .... = Marker: False Payload type: DynamicRTP-Type-96 (96) Sequence number: 34530 Timestamp: 2083047297 Synchronization Source identifier: 0x37e90f89 (938020745) Payload: dd50000022b0414658246496652459bc43b825b20337e05c... No. Time Source Destination Protocol Info 2501 58.831841 192.168.0.30 232.0.2.1 RTP PT=DynamicRTP-Type-96, SSRC=0x37E90F89, Seq=34531, Time=2083047627 Real-Time Transport Protocol 10.. .... = Version: RFC 1889 Version (2) ..0. .... = Padding: False ...0 .... = Extension: False .... 0000 = Contributing source identifiers count: 0 0... .... = Marker: False Payload type: DynamicRTP-Type-96 (96) Sequence number: 34531 Timestamp: 2083047627 Synchronization Source identifier: 0x37e90f89 (938020745) Payload: 398e52d8625666335dfa4aa52e7d0cd6e9a9c922af169e9d... _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
On Wednesday, September 28, 2011, Sebastian de Castelberg <[hidden email]> wrote:
(snip) > I haven't yet found a gstreamer setup for the opposite way, streaming > to the device. The following pipeline just produced a crackling noise > on the device: > > # 'server' pipeline > gst-launch-0.10 audiotestsrc ! audioconvert ! \ > audio/x-raw-int,depth=16,rate=8000 ! rtpL16pay ! udpsink > host=232.0.2.2 port=49253 Add "is-live=TRUE" right after audiotestsrc, otherwise you'll be flooding your device with packets. Cheers, Ole André _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
hi Ole,
thanks for your reply. I added the is-live parameter to the audiotestsrc. The audio output on the device is still chopped and a network trace does not show any change in the rtp stream. In the meantime I've found out how to set a more specific timing on the RTP stream by passing the following parameters to rtpL16pay: gst-launch-0.10 audiotestsrc is-live=TRUE ! audioconvert \ ! audio/x-raw-int,depth=16,rate=8000 ! rtpL16pay pt=98 mtu=172 seqnum-offset=0 timestamp-offset=0 timestamp-offset=80 \ ! udpsink host=232.0.2.2 port=49253 this results in the following RTP dump: 23:22:29.874071 IP 192.168.0.30.56674 > 232.0.2.2.49253: UDP, length 172 23:22:29.883607 IP 192.168.0.30.56674 > 232.0.2.2.49253: UDP, length 172 23:22:29.893871 IP 192.168.0.30.56674 > 232.0.2.2.49253: UDP, length 172 ... The timing and packet size seem to match the expectations from the original dump. The Sequence number is being incremented, the Timestamp increased by 80 and the time difference between two packets is ~0.01s. Nonetheless, the sound is still choppy (peak, silence, ... , silence, peak, ...). To me, it seems that the payload is somehow broken. (encoding, timing, ...). Any advices on how to analyze the whole pipeline? Here's a gst-launch -v output for the two pipes: ### working: device -> desktop ### gst-launch-0.10 -v udpsrc multicast-group=232.0.2.1 auto-multicast=true port=49253 multicast-iface="eth0" ! capsfilter caps="application/x-rtp, media=(string)audio,clock-rate=(int)8000,encoding-name=(string)L16,payload=(int)98" ! rtpL16depay ! audioconvert ! audioresample ! audio/x-raw-int, rate=8000 ! alsasink Setting pipeline to PAUSED ... Pipeline is live and does not need PREROLL ... Setting pipeline to PLAYING ... New clock: GstSystemClock /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = application/x-rtp, media=(string)audio, clock-rate=(int)8000, encoding-name=(string)L16, payload=(int)98 /GstPipeline:pipeline0/GstRtpL16Depay:rtpl16depay0.GstPad:src: caps = audio/x-raw-int, endianness=(int)4321, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)8000, channels=(int)1, channel-positions=(GstAudioChannelPosition)< GST_AUDIO_CHANNEL_POSITION_FRONT_MONO > /GstPipeline:pipeline0/GstRtpL16Depay:rtpl16depay0.GstPad:sink: caps = application/x-rtp, media=(string)audio, clock-rate=(int)8000, encoding-name=(string)L16, payload=(int)98 /GstPipeline:pipeline0/GstAudioConvert:audioconvert0.GstPad:src: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)32, depth=(int)32, rate=(int)8000, channels=(int)1, channel-positions=(GstAudioChannelPosition)< GST_AUDIO_CHANNEL_POSITION_FRONT_MONO > /GstPipeline:pipeline0/GstAudioConvert:audioconvert0.GstPad:sink: caps = audio/x-raw-int, endianness=(int)4321, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)8000, channels=(int)1, channel-positions=(GstAudioChannelPosition)< GST_AUDIO_CHANNEL_POSITION_FRONT_MONO > /GstPipeline:pipeline0/GstAudioResample:audioresample0.GstPad:src: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)32, depth=(int)32, rate=(int)8000, channels=(int)1, channel-positions=(GstAudioChannelPosition)< GST_AUDIO_CHANNEL_POSITION_FRONT_MONO > /GstPipeline:pipeline0/GstAudioResample:audioresample0.GstPad:sink: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)32, depth=(int)32, rate=(int)8000, channels=(int)1, channel-positions=(GstAudioChannelPosition)< GST_AUDIO_CHANNEL_POSITION_FRONT_MONO > /GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:src: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)32, depth=(int)32, rate=(int)8000, channels=(int)1, channel-positions=(GstAudioChannelPosition)< GST_AUDIO_CHANNEL_POSITION_FRONT_MONO > /GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:sink: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)32, depth=(int)32, rate=(int)8000, channels=(int)1, channel-positions=(GstAudioChannelPosition)< GST_AUDIO_CHANNEL_POSITION_FRONT_MONO > /GstPipeline:pipeline0/GstAlsaSink:alsasink0.GstPad:sink: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)32, depth=(int)32, rate=(int)8000, channels=(int)1, channel-positions=(GstAudioChannelPosition)< GST_AUDIO_CHANNEL_POSITION_FRONT_MONO > ### not working: desktop -> device (noisy/tinny chunks) ### akureyri :: ~ > gst-launch-0.10 -v audiotestsrc is-live=TRUE ! audio/x-raw-int,rate=8000,channels=1 ! audioresample ! audioconvert ! rtpL16pay pt=98 mtu=172 seqnum-offset=0 timestamp-offset=0 timestamp-offset=80 ! udpsink host=232.0.2.2 port=49253 Setting pipeline to PAUSED ... /GstPipeline:pipeline0/GstAudioTestSrc:audiotestsrc0.GstPad:src: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)32, depth=(int)32, rate=(int)8000, channels=(int)1 Pipeline is live and does not need PREROLL ... Setting pipeline to PLAYING ... New clock: GstSystemClock /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)32, depth=(int)32, rate=(int)8000, channels=(int)1 /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)32, depth=(int)32, rate=(int)8000, channels=(int)1 /GstPipeline:pipeline0/GstAudioResample:audioresample0.GstPad:src: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)32, depth=(int)32, rate=(int)8000, channels=(int)1 /GstPipeline:pipeline0/GstAudioResample:audioresample0.GstPad:sink: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)32, depth=(int)32, rate=(int)8000, channels=(int)1 /GstPipeline:pipeline0/GstAudioConvert:audioconvert0.GstPad:src: caps = audio/x-raw-int, endianness=(int)4321, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)8000, channels=(int)1 /GstPipeline:pipeline0/GstAudioConvert:audioconvert0.GstPad:sink: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)32, depth=(int)32, rate=(int)8000, channels=(int)1 /GstPipeline:pipeline0/GstRtpL16Pay:rtpl16pay0.GstPad:src: caps = application/x-rtp, media=(string)audio, clock-rate=(int)8000, encoding-name=(string)L16, encoding-params=(string)1, channels=(int)1, payload=(int)98, ssrc=(uint)3298703621, clock-base=(uint)80, seqnum-base=(uint)0 /GstPipeline:pipeline0/GstRtpL16Pay:rtpl16pay0.GstPad:sink: caps = audio/x-raw-int, endianness=(int)4321, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)8000, channels=(int)1 /GstPipeline:pipeline0/GstRtpL16Pay:rtpl16pay0: timestamp = 80 /GstPipeline:pipeline0/GstRtpL16Pay:rtpl16pay0: seqnum = 0 /GstPipeline:pipeline0/GstUDPSink:udpsink0.GstPad:sink: caps = application/x-rtp, media=(string)audio, clock-rate=(int)8000, encoding-name=(string)L16, encoding-params=(string)1, channels=(int)1, payload=(int)98, ssrc=(uint)3298703621, clock-base=(uint)80, seqnum-base=(uint)0 Thanks Sebastian On Wed, Sep 28, 2011 at 10:12 PM, Ole André Vadla Ravnås <[hidden email]> wrote: > On Wednesday, September 28, 2011, Sebastian de Castelberg > <[hidden email]> wrote: > (snip) >> I haven't yet found a gstreamer setup for the opposite way, streaming >> to the device. The following pipeline just produced a crackling noise >> on the device: >> >> # 'server' pipeline >> gst-launch-0.10 audiotestsrc ! audioconvert ! \ >> audio/x-raw-int,depth=16,rate=8000 ! rtpL16pay ! udpsink >> host=232.0.2.2 port=49253 > > Add "is-live=TRUE" right after audiotestsrc, otherwise you'll be flooding > your device with packets. > > Cheers, > Ole André > > _______________________________________________ > gstreamer-devel mailing list > [hidden email] > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel > > gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |