Prosody installation guide: test programs: rtpplay

This is a very simple play application. It plays a file to a RTP stream. It normally keeps repeating the file until told to stop. The file is assumed to have no headers or other formatting of any kind - just the data. See also locplay which performs the equivalent function for TDM timeslots.

Go to directory $(TiNG)/test/rtpplay.

You must have downloaded firmware modules as listed below.

Run rtpplay with the appropriate options (the program is gen-LINUX_V6/rtpplay or gen-WINNT_V6/rtpplay depending on which operating system you are using).

Command line options are as follows. All options which configure a codec start with -C.

-CH Enables the high pass filter (G.723.1 only).
-CL frame_len The duration of a coded frame in ticks.
-CNm comfort_noise_payload_mapping The payload type code to use for comfort noise packets. Only relevant when comfort noise has been enabled.
-CV variant The codec variant to use (GSMFR only).
-Ca clerk_addr The address of the clerk daemon.
-Cb bitrate The bit rate of the RTP coded data in bits per second. Only relevant where the selected codec has more than one possible rate.
-Cp clerk_port The port of the clerk daemon.
-Ct pticks The number of samples to send in each packet. Note that many codecs normally describe the length of a packet in milliseconds, or some other related quantity, but this value is always in samples.
-Cv vad The VAD mode to use. The meaning of this value depends on the codec seclected. If the codec has a field called VADMode in its configuration parameters, then this value is used for that field. In addition, if the value is 2 comfort noise is enabled. For G.723.1, this value is used in the silence_compression field.
-F format format of the file to play. The known formats can be listed by specifying a question mark (?).
-O play file once only and then exit (default is to keep repeating the file)
-P per_mod The maximum number of channels to allocate on a single module.
-R randdelay Wait for a period before starting each channel. The delay will be randomly selected each time a channel is started and will be in the range 0..delay This allows a test to be run which avoids the channels all operating in step with one another.
-T threshold set the data transfer threshold
-X maxoctets Limit the length of all replays to this amount of data.
-a agc use AGC
-c codec Selects the codec to use. The known codecs can be listed by specifying a question mark (?).
-d dest_ip The address to which the RTP stream is to be sent. This can be set automatically by specifying a clerk daemon.
-f rfc2833tones The payload type to use for RFC2833 tones. If this value is zero, no RFC2833 tones are sent.
-m payloadmapping The payload type for data produced by the codec.
-n numchan start playing this many channels (default = 1)
-p dest_port The port to which the RTP stream is to be sent. This can be set automatically by specifying a clerk daemon.
-q source_port The source port to use for outgoing RTP packets.
-r Restart replay when it completes.
-s speed play faster or slower (as a percentage)
-v volume adjust volume of the playback by this (in dB)
-x identifier Use these Prosody processor modules, specified as described in Test programs: Specifying Prosody Processor modules
-y synchronised play - prepare channels but don't start them until the 'g' command is given
<file> name of file from which data is to be played.

For example,

	gen-WINNT_V6/rtpplay -x x:1.2.3.4/mykey -F ALawPCM@8000 -p 5555 -c alaw -d 10.11.12.13 rec1.dat

would play data assumed to be A-law encoded speech from rec1.dat from the card with address 1.2.3.4 to port 5555 at address 10.11.12.13.

The firmware modules that are required depend on the options you specify. Here are the details:

ModuleWhen needed
datafeed always
gainbg If you use '-a 1' for AGC or '-v' to adjust the volume
fast If you use '-s' to play the file faster than normal
slow If you use '-s' to play the file slower than normal
vmptx always
sixkout when the file format is ACUBLKPCM@6000, ALawPCM@6000, OKIADPCM@6000, or ULawPCM@6000
playA when the file format is ALawPCM@6000 or ALawPCM@8000
playima when the file format is IMAADPCM
playmu when the file format is ULawPCM@6000 or ULawPCM@8000
playoki when the file format is OKIADPCM@6000 or OKIADPCM@8000
amr-nb when the RTP codec is AMR (Adaptive Multi Rate) narrowband.
evrc when the RTP codec is EVRC (Enhanced Variable Rate CODEC).
g7231a when the RTP codec is G.723.1.
g726 when the RTP codec is G.726.
g728 when the RTP codec is G.728.
g729ab when the RTP codec is G.729A.
gsm-efr when the RTP codec is GSM-EFR (Enhanced Full Rate).
gsm-fr when the RTP codec is GSM-FR (Full Rate).
ilbc when the RTP codec is iLBC (Internet Low Bit Rate Codec).
smv when the RTP codec is SMV (Selectable Mode Vocoder).
sync when the -y option is used

When this program starts, it starts as many channels as specified by the -n option, and then prints a prompt and waits for commands. While waiting for commands any running channels will be serviced, but status changes will not be reported. The commands are:

CharacterMeaning
(i.e. blank line - no command) Print status
?Print summary of possible commands
+Start another channel
a NSet AGC for future channels to N
ggo - allow channels held for synchronisation by -y option to start
kNKill channel N.
ONSet 'once' option for future channels to N.
qQuit - exit without waiting for channels to finish.
s NSet speed for future channels to N
TNSet TiNGtrace to N.
uUpdate all running channels to use current agc, volume, and speed settings.
v NSet volume for future channels to N
wQuit - wait for all channels to finish.
x NSet maximum octets for future channels to N
# anythingdo nothing - used for comments

The status is shown in each prompt. The prompt starts with two characters for each current channel. The first character indicates the status of the play for that channel:

CharacterStatus
*Active - data was transferred since printing last prompt
.Idle - no data was transferred since printing last prompt
-Done - play has finished
 Channel is no longer in use
uUnderrun occurred since last printing prompt

The second character indicates the status of the VMP[tx] for that channel:

CharacterStatus
vIdle - VMP is idle (not yet started)
VBusy - VMP is running
tTone - VMP is producing tones
TTone Done - VMP has just finished producing tones
sSSRC has been chosen (reported only once)
SStopped
-Done - VMP has finished
 Channel is no longer in use

The source code for this program is provided (rtpplay.c).


This is one of the Prosody test programs .