CL Command-line tools

Each .CL library offers some command-line programs.

They can be used to provide input/output audio to the processing library.

Each tool support -h parameter to get help.

sound4.any.cl-proc

This is the generic processor, which can be used for RTP or raw audio.

It is the preferred way to use it in a container (see Cloud Containerization).

Some parameters can be passed via environment variable. In this case, the help shows those variable.

License

You need to provide license information to the instance.

  • loginkey : User ID for License (default from env S4LOGINKEY)
  • radioname : Radioname for License (default from env RADIO_NAME)
  • env only S4_AWS_ACCESS_KEY_ID : the license key ID
  • env only S4_AWS_SECRET_ACCESS_KEY : the license key secret

Web interface

Start a web browser to setup this instance.

Parameters:

  • http_port : port to listen for HTTP (current:0)
  • https_port: port to listen for HTTPS (current:0)

HTTPS needs a certificate, which information is in env variables:

  • SSL_CERTIFICATE_PATH : the certificate
  • SSL_PRIVATE_PATH : the certificate private key

Storage

The instance needs to have a storage directory to save its state and its presets.

Parameters:

  • storepath : Storage path (default: STATE_DIR)

You can have multiple instances using the same storage folder, so they can share their presets.

But in this case, you should give each a different statename, so each has its own settings and onair preset.

  • statename : Storage state filename, if sharing storepath between instances

Also, if you want instances to follow the onair preset, you can set them the same onairname : changing preset on one instance will change for all at the same time.

  • onairname : Storage onair filename, if sharing storepath between instances

See also Cloud Process Configuration Storage

Special storage information :

  • R : Storage is read-only
  • S : Storage state is read-only

Audio I/O

Parameters:

  • ip|lwr : Livewire channel in or UDP listening specific IP (use for broadcast) (default RTP_SRC_IP)
  • port : UDP listening port (default: RTP_SRC_PORT=5000)
  • dstip|lwr : Livewire channel out or Send back to this IP if zero (default RTP_DEST_IP=0.0.0.0)
  • dstport : Send back to this port (default: RTP_DEST_PORT=5004)
  • ip : IP to bind for input. Uses source IP if not given (default RTP_BIND_IP=0.0.0.0)
  • ip : IP to bind for output (default: RTP_OUT_BIND_IP=0.0.0.0)
  • pt : Rcv/Send Payload Type (default: RTP_PAYLOAD=96). NOTE: payload 97 allows receiving payload 96 or 97, to ease compatibility
  • format : Sample format (default: RTP_SAMPLE_FORMAT=S16_BE) (S16_LE, S16_BE, S24_LE, S24_BE, S32_LE, S32_BE, F32_LE, F32_BE)
  • frames : Frames Per Output Packet. Same as input if zero (default: RTP_FRAMES=0)
  • channels : Channels in RTP stream (default: RTP_CHANNELS=2)
  • r : RAW mode, get audio from stdin in float32 native 48000Hz stereo, send it to stdout.

RTP Input/Output

Example: process locally received audio on port 5004, send the processed to 10.3.1.25 port 5004

sound4.impact.cl-proc -i 127.0.0.1 -p 5004 -I 10.3.1.25 -P 5004 -F S16_BE -w 8080

AES67 Input/Output

Example: receive from 239.4.27.1, send to 239.4.83.1

sound4.impact.cl-proc -i 239.4.27.1 -p 5004 -I 239.4.83.1 -P 5004 -F S24_BE -w 8080

Note: there is no advertising

Livewire Input/Output

Example: receive from channel 1001, send to 2001

sound4.impact.cl-proc -i 1001 -I 2001 -w 8080

Note: there is no advertising

Raw audio

This uses stdin and stdout for audio, so you can use another program to provide and to play audio.

Example: process RTP stream received on port 5000 and play it

ffmpeg -i rtp://127.0.0.1:5000 -ar 48000 -ac 2 -f f32le - | sound4.impact.cl-proc -r -w 8080 | ffplay -f f32le -ar 48000 -ac 2 -i -

For this sample, audio can be sent with ffmpeg -re -i myfile.mp3 -map a:0 -acodec libmp3lame -f rtp udp://127.0.0.1:5000

Advanced parameters

  • key=value : Add parameter
  • key=value : Add metadata

For parameters and metadata, see libraries documentation.

Kubernetes Leader Election

Linux only, with environment variables:

  • LEADERELECTION_LEASENAME : lease name
  • LEADERELECTION_NAMESPACE : lease namespace
  • Optional:
    • LEADERELECTION_IFACE_IP : define ID with this interface IP instead of hostname
    • LEADERELECTION_WAITFORCREATE : block before creating instance instead of after
    • LEADERELECTION_LEASEDURATION : lease duration
    • LEADERELECTION_RENEWDEADLINE : lease renew deadline
    • LEADERELECTION_RETRYPERIOD : lease retry period

When both LEADERELECTION_LEASENAME and LEADERELECTION_NAMESPACE are set and working, only one pod will process.

Duration are Go duration strings, like 3s, 100ms, ...

The pod needs access to apiGroups 'coordination.k8s.io' resources 'leases' for 'get', 'update', 'list' (and 'create' if not pre-created).

Advanced access

  • json_port : port for TCP JSON (default: PROC_PORT=0)

This starts a server for the Cloud JSON Protocol. It can be used to have a separate interface web server

Warning: there is no authentication protection on this socket, even if the web interface has some set up.

Web access authentication

Details are in the process library documentation.

If the storage is not yet initialized, you can choose how to protect the web access.

There are 2 modes:

  • Setup mode: you define a setup account, which can then create an administrator account. The setup account always keeps the access and can delete the administrator.
  • Admin mode: you define the administrator, which will be the single administrator.

To select the mode, you have to put in the parameters

  • SETUP_USER (and optionally SETUP_SECRET) to select Setup mode
  • ADMIN_USER (and optionally ADMIN_SECRET) to select Admin mode
  • none: the web access is opened, no login will be asked

If you do not set the xxx_SECRET, then the setup password will be randomly generated and print in logs (at info severity).

sound4.any.cl-server

Separate interface web server, which can be used if you want a different container for processing and interface.

  • process_ip : IP address of the process to connect to (env PROC_IP)
  • process_port : port of the process to connect to (env PROC_PORT)

For other parameters, see Web interface :

  • http_port : port to listen for HTTP (env HTTP_PORT)
  • https_port : port to listen for HTTPS (env HTTPS_PORT)

sound4.any.cl-jack

Linux JACK Audio Connection Kit support.

Parameters :

  • jack_name : JACK client name
  • jack_session : JACK session name

See also Web interfaceStorage and Advanced access.

sound4.any.cl-pipewire

Linux PipeWire support.

Parameters :

  • name : client name