Seren
Introduction
Seren is a simple VoIP program based on the Opus codec that allows you to create
a voice conference from the terminal, with up to 10 participants, without having
to register accounts, exchange emails, or add people to contact lists. All you
need to join an existing conference is the host name or IP address of one of the
participants.
Seren creates a dynamic peer-to-peer network of equivalent nodes which exchange
text and audio data using a udp connection, and offers the user the ability to
change the quality/bitrate on the fly, encrypt the traffic and record the calls.
License
Seren is released under the GNU GPLv3 license.
How to compile Seren
Seren is written in C and uses alsa to access the sound card and libopus to compress the audio stream. In order to compile Seren you need:
- gcc
- make
- libasound
- libopus
- libogg
- libgmp
- libncurses
Under Debian/Ubuntu all the dependencies should be satisfied by installing
the following packages:
build-essential libasound2-dev libopus-dev libogg-dev libgmp-dev libncursesw5-dev
If your distribution is too old and does not provide a package for libopus, you
can build it from source by running the following commands:
$ mkdir src $ cd src $ wget http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz $ tar xvf opus-1.1.tar.gz $ cd opus-1.1/ $ ./configure $ make $ sudo make install $ sudo ldconfig # you can later uninstall with: #$ sudo make uninstall
Once the dependencies are satisfied, you can compile the program simply with:
$ ./configure && make
The resulting binary can be run from the local directory or can be installed with:
$ make install
To clean the build directory run:
$ make clean
or if you want to reset the configuration before running the configure again:
$ make distclean
Using Seren
You can access the help by running:
$ seren -h Seren, ver. 0.0.21 Usage: seren [option...] Options: -h print help -v increment verbosity level -L logfile log messages to logfile ($HOME/.seren/seren.log) -N disable ncurses interface -t theme set ncurses theme 0-simple, 1-dark, 2-clear (1) -n nick set nickname (login name) -p port set udp listening port (8110) -b bitrate set bitrate in bit/s (16000) -C complexity set encoder complexity [0-10] (10) -d audiodev set playback audio device (hw:0,0) -D audiodev set capture audio device (playback device) -c host[:port] autocall host on startup -a autoaccept calls -S disable STUN
This will show you a list of command line options. The values in parentheses on
the right are the default values. Refer to the man page for more information
about these options.
To create a conference the first node starts the program with:
$ ./seren -n NICK
where NICK is of course your nickname. If you do not specify the nickname it
will default to your login name. The program will now listen for incoming
connections on udp port 8110 (you can change this port with -p option).
Note that if you are using a router from a home connection and want people to
be able to call you from the outside, you'll most likely need to forward this
port.
On the status bar on the bottom, you can see a logarithmic vu-meter and a peak
indicator for the microphone input. Make sure that the peak never reaches 100%
and that the vu-meter moves enough when you speak into the microphone.
People that want to join a conference will need the IP address or host name of
one of the participants. After starting the program with the same command line
as above, they will type /c host[:port] to connect to an active conference,
where host can be either an IP address or a hostname, and port can be omitted
when using the standard 8110 port.
On the right part of the window there is the list of the participants, together
with the logarithmic vu-meter indicating their audio level. This allows you
to easily understand who is talking. Also, the nicknames are shown in different
colors depending on their packet loss: the green, yellow and red colors refers
respectively to a packet loss <= 0.5 %, between 0.5% and 5% and > 5%.
While the program is running, type /h to access the online help. The available
commands include /i or F4 to print information about the status of the program
and the network/participants, /m or F5 to mute the microphone, /g to set a
software gain for the microphone and /b to change bitrate on the fly.
Node modes and encryption
Seren supports three basic modes of operation:
- Clear mode: both traffic and handshake are sent in clear.
- Secure mode: traffic is encrypted but the initial handshake is sent in clear. It uses DHM key exchange and a different key for each link.
- Pre-shared key (PSK) mode: everything is encrypted using a pre-shared key.
Depending on which mode is currently selected, the letters "CLR", "SEC" or "PSK"
will appear in the bottom left corner of the window.
The default mode of operation is Secure. To set the mode of operation of your
node you can use the /e command, usually before joining or hosting a conference.
If necessary, though, these modes can be changed on the fly while the conference
is running, providing that all the nodes switch mode within 6 seconds to avoid
node timeouts.
When using the Secure mode, Seren by default uses the XTEA block cipher in cbc
mode (unless this is changed with /X before calling a host), together with a
128-bit key exchanged using Diffie–Hellman–Merkle algorithm.
When using the PSK mode the user has a choice of five different block ciphers
(XTEA, CAST-128, Blowfish, Camellia and Twofish) and a symmetric key with
maximum length of 384-bit. People wanting to make an encrypted conferences using
this mode must choose the same block cipher and the same common key. The typical
procedure to use this mode is as follows:
- Choose PSK mode with /e
- Choose the encryption algorithm with /X
- Set the key with /x. Note that with this command the key is passed to Seren as a hexadecimal number. For example a 128-bit key can be represented by a 32-char hexadecimal number (a key composed of less than 32 characters will be padded with '0's)
- Use /c to join a conference or wait for other nodes to call you
Note that a 128-bit key could be created from a passphrase with the following
command:
$ echo -n "put passphrase here" | md5sum | cut -b 1-32
Log and configuration files
Seren creates a log file in $HOME/.seren/seren.log , where it reports everything
the program does. Inspecting this file can be useful in case you encounter any
problem. In such situations, using -v -v on the command line to increase the
verbosity level can also help understanding what went wrong.
Options for Seren can be specified on the command line or by using the
configuration file in $HOME/.seren/seren.conf . Options specified on the command
line take precedence over the ones in the configuration file.
Audio options
Seren uses alsa for audio capture and playback. You can specify the alsa device
to use with -d option. Note that internally Seren uses the following format:
2 channels, 48000Hz sampling rate, s16_le format. If your sound card does not
support this format you're likely to get an error when alsa is initialized.
In this case try 'plughw:0,0' instead of the defaul device 'hw:0,0'.
Use the option -D to select a capture device different from the playback device.
It should be possible to use pulseaudio with both options using the device
'pulse'.
To choose the initial bitrate of the compressed Opus stream, option -b can be
used. The default is 16000 bit/s and should give very good quality with a
typical bandwidth of 2 kbyte/s for each stream.
The complexity of the Opus encoder can be set via -C option.
Seren also supports audio input and output via a pair of fifos. Refer to the
man page for more information about these fifos.
Calls recording
To start recording a call to a ogg/opus file you can use the /r command.
A message containing the name of the file will be printed to inform you that the
recording has been started, and the letters "REC" will appear in red on the
bottom left corner of the window, next to the call timer. Type /r again to end
the recording.
It is also possible to record in wave format using the /R command.
Raspberry Pi
Seren has been tested and works quite well on the Raspberry Pi, provided that you do the following things:
- Configure libopus with
./configure --enable-fixed-point
to select the fixed-point implementation and enable the assembly optimizations. - Launch Seren with command line option "-C 0" to select the lowest complexity for the Opus Encoder; this will make Seren run much faster.
Screenshots
Screenshots of Seren in action:
The values on the status bar on the bottom have the following meanings:
- Call timer, recording and encryption indicator
- Microphone vu-meter | peak detector or "MUTE" when the mic has been muted
- Upload and dowload network speed in kB/s
- Packet loss (pl) expressed as percentage
Download source code
The following versions of Seren are available for download.
We recommend you to download the latest version.
WARNING: Please note that Seren is in active development and should be considered
beta software. This means that new functions will be added and/or the protocol can
change, thus backward compatibility is not guaranteed.
- 9a0e31e68c682ea5b45efab86246448b seren-0.0.21.tar.gz (Fri, 05 Dec 2014)
- e7b0dbed8586e15c28b31cbf95354cc8 seren-0.0.20.tar.gz (Thu, 11 Sep 2014)
- b57579451138dd844ff0e65682a9f9b6 seren-0.0.19.tar.gz (Fri, 01 Aug 2014)
- 0271d4eba1672b98c97be5aa95fb62b4 seren-0.0.18.tar.gz (Sun, 25 May 2014)
- ab705d454b492b5ecbb6cf29d4a50fc0 seren-0.0.17.tar.gz (Sat, 18 Jan 2014)
- dc2626c6bb2e7c71a3b64d25712992e5 seren-0.0.16.tar.gz (Mon, 06 Jan 2014)
- 90656da28843b096e8ca9ab36aebdc33 seren-0.0.15.tar.gz (Thu, 26 Dec 2013)
Download binary packages
The following binary packages are available for download. Please note that these packages are still experimental. If you find any problem/bug please let me know.
- Debian 7 (wheezy)
- a49278e778fe6b0b83a9016fef2e054b seren_0.0.21-1_i386.deb (Fri, 05 Dec 2014)
- 70770ba4c1ea1a55e6ce390a025c9cd5 seren_0.0.21-1_amd64.deb (Fri, 05 Dec 2014)
- 4338183cb41933c36d97a52e258c6d19 seren_0.0.20-1_i386.deb (Thu, 11 Sep 2014)
- 4ac0f432646d8aba32cebfa72e2762a1 seren_0.0.20-1_amd64.deb (Thu, 11 Sep 2014)
- e4d3a0cf95365806c3bd6f18ea0768c0 seren_0.0.19-1_i386.deb (Fri, 01 Aug 2014)
- 4501acf80f5638567bd12ec1b230ab55 seren_0.0.19-1_amd64.deb (Fri, 01 Aug 2014)
- 4ba2fdbfd15734a3e2958d4e7ab1a2d3 seren_0.0.18-1_i386.deb (Mon, 26 May 2014)
- dcbfa5ae907a68f702beadeba4da1ce1 seren_0.0.18-1_amd64.deb (Mon, 26 May 2014)
- Ubuntu >= 13.04, Mint >= 16
- 4d56f055970a1933220ff462047a6860 seren_0.0.21-1_amd64.deb (Fri, 05 Dec 2014)
- a5feee54b82126acbb502311a486c11e seren_0.0.20-1_amd64.deb (Thu, 11 Sep 2014)
- 7918edaebbb624b32700d8d923e65efd seren_0.0.19-1_amd64.deb (Fri, 01 Aug 2014)
- 7b0e7f77231cb5c224753f1e7e5e20b6 seren_0.0.18-1_amd64.deb (Mon, 26 May 2014)
Download from repositories
Seren has been packaged for the following distributions:
- Fedora
Seren is available in Fedora official repositories (version 19, 20, rawhide). To install Seren, run the following command:
# yum install seren
This package is usually 1-2 weeks behind the latest Seren release. If a newer version is released and you want to test it before being marked as stable, run the following command:
# yum install seren --enablerepo="*-testing"
More information at: Fedora Packages - Seren - RHEL and its compatible derivatives
Seren is available for RHEL (version 6) and its compatible derivatives (CentOS, SL, OEL, etc.) from Fedora EPEL repositories (see how to install epel-release). To install Seren, run the following command:
# yum install seren
This package is usually 2-3 weeks behind the latest Seren release. If a newer version is released and you want to test it before being marked as stable, run the following command:
# yum install seren --enablerepo="*-testing"
More information at: Fedora Packages - Seren - Arch Linux
Seren is available in the Arch User Repository (AUR). You can download the package description (PKGBUILD) from this page. If you need more information on how to compile and install the package please refer to this wiki page.
Donations
If you like Seren and want to support its development you can use the following button to donate:
Contact
Development chat, testing and support happens on the #seren IRC channel on the FreeNode IRC network. You can join the chat room through the following web interface if you do not have a IRC client:
Changelog
version 0.0.21: * Engine version bump * Added --without-ncurses option to configure * Added VPATH build functionality * Added selftest targets to Makefile * Added input.{h,c} for unified command parsing * Added tones.{h,c} * Added /f command * Added twofish block cipher * Added support for round trip time (RTT) estimation * Added reason field to REFUSE packets * Added opus packets bandwidth and channels decoding * Added bw/ch informations to ncurses lateral bar * Use the same encipher/decipher functions for all key sizes in camellia * Renamed config file option theme to ncurses_theme * nc_init() now sets print and die callbacks * Fixed fifout delay (now the fifo is opened in WRONLY mode) * Fixed functions prototypes in random.{h,c} * Small code improvements and fixes version 0.0.20: * Added /v command * Added event_type_verbose * Fixed buffer overflow in all ciphers when len is not a multiple of blocksize * Improved ciphers selftest routine * Factorized md5 code * Fixed potential buffer overflow in packet_encrypt() * Improved size check for received packets * Changed prefix for functions in udp.c * Other minor code changes version 0.0.19: * Fixed terminal resizing, now the content of the window is not lost anymore * Added support for input history (Up/Down keys) in ncurses gui * Improved lateral bar with more information about nodes * Added fcntl.h and gmp.h checks in build system * Initial support for counter mode in xtea.{h,c} * Small code changes and refactoring version 0.0.18: * New protocol, not compatible with older versions! * Support for node modes (clear, secure, psk) * Added raw audio input and output fifos * Added support for packet loss telemetry * Added cast-128 block cipher * Added blowfish block cipher * Added camellia block cipher * Added md5 hash function * Added random.{h,c} * Added libgmp dependency * Added Diffie–Hellman–Merkle key exchange * Factorized audio dsp code in adsp.{h,c} * Added support for node vu-meters * Improved checks for data coming from the network * Added /T, /H, /X commands * Changed /e command to set node mode * Changed /g command to accept gain in dB * Added event_type_ringtone, event_type_setmode, event_type_setalgo, event_type_setpsk and event_type_call_hangup events * Fixed ncurses compilation in arch * Factorized nc_scroll_input_text() * Added support for nick autocomplete * Added node list and vu-meters column in ncurses gui * Added colored nick list based on local/remote packet losses * Added -Wconversion compiler flag * Fixed a lot of -Wconversion warnings * Updated man page version 0.0.17: * Changed CALL and CONNECT packets format, protocol not compatible with older versions! * ncurses gui rewritten, now it supports UTF-8 input * Added --enable-default-pulse option to configure * Removed libncurses5-dev dependency, now only libncursesw5-dev is necessary * Fixed compilation with libopus < 1.0 * Added event_type_autoaccept_calls and event_type_incoming_call_lost events * Updated man page * Fixed various messages * Added -L option for setting log filename * Added -N option for disabling ncurses gui * Fixed high cpu usage when stdin was redirected * Added /t, /C, /a commands versions up to 0.0.16: * Lots of improvements/cleanups/refactoring/optimizations * Option to autocall host on startup * Option for setting encoder complexity * Added man page * Support for ncurses themes * Support for packet loss concealment (PLC) * Configuration file support * Call recording in ogg/opus or wave * Better/safer encrypted calls support * Option for auto answering calls * Individual nodes gain support * Synthesized ringtones * ITU-T E.180 calltone * Callers queue * STUN support * Commands and event-based system for the pc-engine * parole-conference-engine has been rewritten and separated from the gui * First internal release forked from parole-conference-010alpha17