mast_cast [options] <address>[/<port>]


mast_cast(1) recieves audio from a JACK live audio source, encodes the audio to the chosen payload foramt and sends it out encapsulated in an RTP packet.

The address can either be a unicast, multicast, IPv4 or IPv6 address.

The port number should be an even number (RTCP reports are sent one port higher). If no port number is specified, then the default RTP port number (5004) is used.



Return usage and version information.

-t <ttl>

Sets TTL (Time To Live) for packets sent. Packets will ignored after they have passed this number of routers. Default is 5, maximum is 127.

-p <payload>

Payload type of the encoded packets. MAST currently only supports the following four static payload types. The default is L16.

  • PCMU - 8khz, Mono

  • PCMA - 8khz, Mono

  • GSM - 8khz, Mono

  • LPC - 8khz, Mono

  • L16 - 44.1khz, Mono or Stereo

  • MPA

-o <name=value>

Set a MIME Type parameter option for chosen payload type. Supported options are:

  • MPA - MPEG Audio

    • bitrate (in kbps)

    • mode (joint_stereo, stereo, single_channel, dual_channel)

-z <size>

Maximum Payload size of the packets. Allows you to choose the length of the payload data (in bytes) for each packet transmitted. This is usually a number between 300 bytes and 1450 bytes. The actual packet size will be determined by the number of blocks of 160 samples of audio that can be stored in the packet's payload. The maximum transmission unit (MTU) is determined by your networking equipment. Also be careful of IP-in-IP tunnelling as packets will have two IP headers which makes it more likely that the packet will be too big and get fragmented.

-s <ssrc>

By default a random SSRC is generated, however if you want to ensure that an SSRC remain constant between invocations of the program, then you may specify it here as a hexadecimal number.

-d <dscp>

The Differentiated Services Code Point (DSCP) value specifies a packet's Per-Hop-Behavior (PHB) along its path to its destination. It is a Quality of Service (QoS) technique that can be used to provide better than best effort packet delivery. The default PHB is Best Effort. Valid arguments are:

  • BE Best Effort

  • EF Expedited Forarding

  • AF11 to AF43 Assured Forwarding

  • CS0 to CS7 Classes 0 to 7

-r <msec>

JACK Ringbuffer duration in milliseconds. If you suffer from buffer under-runs then you might like to try increasing the size of this buffer, and if the latency is too high, then you could try reducing the size of this buffer. The default is 100ms.

-c <channels>

Number of JACK input ports. The default is to use 2 ports (left and right).

-n <name>

The name of the JACK client. The default is mast_cast. This option might be useful to you if you are running multiple copies of mast_cast on your system.


Auto-connect the JACK input ports to the first output ports it finds. This will usually be the first two capture ports on your soundcard. If you do not use this option, then use jack_connect to connect up the ports.


mast_cast -c 2 -p MPA -o bitrate=160 -o mode=stereo

Send live stereo, MPEG Audio Layer 2, at 160 kbps to the IP address, port 5004.

mast_cast -c 1 -a -p PCMU -s 0x4692CA65

Send a mono audio stream, compressed using G.711 to a multicast group, with port 1234. The JACK input ports will automatically be connected to the first two output ports it finds.


Written by Nicholas J. Humfrey, <>


Main web site:

RTP Payload types:


mast_rawcast(1), mast_filecast(1)


Copyright © 2003-2007 Nicholas J Humfrey. Free use of this software is granted under the terms of the GNU General Public License (GPL)