Instalar Dependencias

sudo apt-get install build-essential libmp3lame-dev libshout3-dev libopus-dev libfaac-dev libasound2-dev libpulse-dev pavumeter vim

Descargar

cd /home/matias/
wget https://sourceforge.net/projects/darkice/files/darkice/1.3/darkice-1.3.tar.gz

Descomprimir

tar xzvf darkice-1.3.tar.gz
cd darkice-1.3

Compilar

./configure

Para verificar si las dependencias se cumplen, al final de ./configure debe decir esto:

checking for lame library at /usr ... found at /usr 
checking for VORBIS... yes
checking for OPUS... yes
checking for faac library at /usr ... found at /usr 

Continuar compilando

make
sudo make install

Archivo de Configuracion

sudo vim /etc/darkice.cfg
[general]
duration	= 0			# duration of encoding, in seconds. 0 means forever
bufferSecs    	= 5           	        # size of internal slip buffer, in seconds
reconnect       = yes                   # reconnect to the server(s) if disconnected
realtime        = yes                   # run the encoder with POSIX realtime priority
rtprio          = 3                     # scheduling priority for the realtime threads

# this section describes the audio input that will be streamed
[input]
device        	= default          	# Alsa soundcard device for the audio input
sampleRate    	= 48000            	# sample rate in Hz. try 11025, 22050 or 44100
bitsPerSample 	= 16               	# bits per sample. try 16
channel       	= 2   	             	# channels. 1 = mono, 2 = stereo

# this section describes a streaming connection to an IceCast2 server
# there may be up to 8 of these sections, named [icecast2-0] ... [icecast2-7]
# these can be mixed with [icecast-x] and [shoutcast-x] sections
[icecast2-0]
bitrateMode   	= cbr   	        # variable bit rate
format        	= opus              	# format of the stream: mp3
bitrate	      	= 96
quality       	= 0.5
server        	= 127.0.0.1        	# host name of the server
port          	= 8000             	# port of the IceCast2 server, usually 8000
password      	= hackme	  	# source password to the IceCast2 server
mountPoint    	= default         	# mount point of this stream on the IceCast2 server
name          	= DarkIce            	# name of the stream
description   	= DarkIce 	 	# description of the stream
url           	= http://localhost 	# URL related to the stream
genre         	= my genre         	# genre of the stream
public        	= no               	# advertise this stream?

WatchDog

sudo vim /usr/local/bin/watchdog-darkice.sh
#!/bin/bash
for pid in $(pidof -x watchdog-darkice.sh ); do
    if [ $pid != $$ ]; then
        echo "[$(date)] : $0 : Process is already running with PID $pid"
        exit 1
    fi
done

while :
do
  export DISPLAY=:0
  xterm -e "darkice -v 5"
done
sudo chmod +x /usr/local/bin/watchdog-darkice.sh

Crontab

sudo vim /etc/crontab
*/1 *   * * *   matias  /usr/local/bin/watchdog-darkice.sh > /dev/null 2>&1
sudo service cron restart

Entrada de sonido, niveles y entrada

sudo alsactl store