Darkice avec toutes les librairies sur Raspberry Pi

Dans ce tutoriel, nous allons compiler Darkice pour qu’il puisse diffuser en  AAC, AACplus, MP3 et OGG. L’installation se fera sur un Raspberry Pi 3 avec Raspbian Jessie Lite. Le RPi n’étant pas assez puissant, il est  impossible de diffuser un flux au format OPUS (Buffer overun). Et en AAC+, vous ne pourrez régler le bitrate que jusqu’à 64kbps, cela est dû à l’implantation de 3GPP.

Préparation

$ sudo nano /etc/apt/sources.list

Et supprimer le # devant deb-src (Ctrl+O pour enregistrer et Ctrl+X pour quitter)

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install dh-autoreconf libtool libtool-bin libasound2-dev libfftw3-dev build-essential devscripts autotools-dev fakeroot dpkg-dev debhelper autotools-dev dh-make quilt ccache libsamplerate0-dev libpulse-dev libaudio-dev lame libjack-jackd2-dev libasound2-dev libtwolame-dev libfaad-dev libflac-dev libmp4v2-dev libshout3-dev libmp3lame-dev libopus-dev

Compilation de libfaac

$ mkdir /tmp/build && cd /tmp/build
$ apt-get -b source libfaac0 faac
$ sudo dpkg -i libfaac0_1.28-6_armhf.deb libfaac-dev_1.28-6_armhf.deb faac_1.28-6_armhf.deb
$ cd

Compilation de Libaacplus

$ mkdir src && cd src
$ wget http://tipok.org.ua/downloads/media/aacplus/libaacplus/libaacplus-2.0.2.tar.gz
$ tar -xzf libaacplus-2.0.2.tar.gz
$ cd libaacplus-2.0.2
$ ./autogen.sh --host=arm-unknown-linux-gnueabi --enable-static --enable-shared
$ make
$ sudo make install
$ sudo ldconfig
$ sudo reboot

Compilation et installation de Darkice

$ cd src
$ apt-get source darkice
$ cd darkice-1.2
$ ./configure --with-faac --with-faac-prefix=/usr/lib/arm-linux-gnueabihf --with-opus --with-opus-prefix=/usr/lib/arm-linux-gnueabihf --with-pulseaudio --with-pulseaudio-prefix=/usr/lib/arm-linux-gnueabihf --with-lame --with-lame-prefix=/usr/lib/arm-linux-gnueabihf --with-alsa --with-alsa-prefix=/usr/lib/arm-linux-gnueabihf --with-jack --with-jack-prefix=/usr/lib/arm-linux-gnueabihf --with-aacplus --with-aacplus-prefix=/usr/local --with-samplerate --with-samplerate-prefix=/usr/lib/arm-linux-gnueabihf --with-vorbis --with-vorbis-prefix=/usr/lib/arm-linux-gnueabihf
$ make
$ sudo make install

Configuration de Darkice

$ cd 
$ sudo nano /etc/darkice.cfg

Ajoutez et modifiez le texte suivant, pour l’adapter à votre serveur icecast :

# this section describes general aspects of the live streaming session
[general]
duration         = 0            # duration of encoding, in seconds. 0 means forev$
bufferSecs      = 5            # size of internal slip buffer, in seconds
reconnect       = yes         # reconnect to the server(s) if disconnected

# this section describes the audio input that will be streamed
[input]
# device         = /dev/dsp     # OSS DSP soundcard device for the audio input
device            = plughw:1,0  # OSS DSP soundcard device for the audio input
sampleRate      = 44100       # 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     = abr           # average bit rate
format          = aac               # format of the stream: ogg vorbis
bitrate         = 128                # bitrate of the stream sent to the server
server          = xx.xx.xxx.xxx   # host name of the server
port            = 8000               # port of the IceCast2 server, usually 8000
password        = xxxx            # source password to the IceCast2 server
mountPoint      = xxxx           # mount point of this stream on the IceCast2 server
name            = Darkice AAC   # name of the stream
description     = Darkice AAC   # description of the stream
url             = https://technic2radio.fr # URL related to the stream
genre           = my own        # genre of the stream
public          = yes           # advertise this stream?

[icecast2-1]
bitrateMode     = cbr           # average bit rate
format          = mp3           # format of the stream: ogg vorbis
bitrate         = 128           # bitrate of the stream sent to the server
server          = xx.xx.xxx.xxx # host name of the server
port            = 8000          # port of the IceCast2 server, usually 8000
password        = xxxx          # source password to the IceCast2 server
mountPoint      = xxxx.mp3      # mount point of this stream on the IceCast2 s$
name            = Darkice MP3   # name of the stream
description     = Darkice MP3   # description of the stream
url             = https://technic2radio.fr # URL related to the stream
genre           = my own        # genre of the stream
public          = yes           # advertise this stream?

Enregistrez et quittez l’éditeur (Ctrl+O puis Ctrl+X)
Vous pouvez maintenant lancer Darkice avec la commande suivante :

$ darkice

Auto start

$ sudo apt-get install daemontools daemontools-run
$ sudo mkdir /etc/service/darkice
$ sudo chmod 2775 /etc/service/darkice
$ sudo touch /etc/service/darkice/run
$ sudo nano /etc/service/darkice/run

Et ajoutez le texte suivant

#!/bin/sh
echo Running service
exec darkice

IP fixe

$ sudo nano  /etc/dhcpcd.conf

Et ajoutez le texte suivant

interface eth0
static ip_address=192.168.1.234/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1GPP

Notes et liens

Laisser un commentaire