Audio streaming from Ubuntu / darkice / pulseaudio to remote icecast server

It's a hard dutty to migrate from the comfortable Windows environment to Linux, but when the computer got to old, Linux will always be the answer.

I had to find how to re-use the old windows computers to save money and keep the audio streaming to a remote icecast server (I'm not fan of the multi-purpose equipment so my icecast server is running on another machine), myfirst guess, was some linux distribution teamviewer capable and internet browser with no limitations to browse. After I few minutes I decided to install Ubuntu 14 x64, my computer is kind of old(Intel core duo, 2G ram and 80GB hard drive), so probably the latest version could be a problem.

This is the process I followed:

A. Ubuntu 14 04 LTS x 64. It's way too easy (specially if not sure about the performance after installation) to install from USB (I used Universal USB installer from www.pendrivelinux.com). In case this particular distribution release was a problem I could try another one.

B. So important!!! Use Ubuntu software updater right after the installation, this will take just a few minutes depending on your hardware and internet speed connection.
C. Now the easy thing of installing darkice to encode the audio and send it to icecast
apt-get install darkice
or In my case
sudo apt-get install darkice 
because in my case the user does not belong to the sudoers group.

D. darkice configuration. In my case and I can't say if in all linux systems will be the same, but the config file will be in /etc so  once you are in etc
gedit darkice.cfg
or
sudo gedit darkice.cfg
I'll show the configuration that works for me

[general]
duration      = 0       # duration of encoding, in seconds. 0 means forever
bufferSecs    = 2       # 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          = default # 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          = mp3     # format of the stream: ogg vorbis
bitrate         = 128     # bitrate of the stream sent to the server
quality         = 0.4
server          = YOUR SERVER IP OR FQDN
        

# host name of the server
port            = 8000      # port of the IceCast2 server, usually 8000
password        = Yourpsswd # source password to the IceCast2 server
mountPoint      = yourmount  # mount point of this stream on the IceCast2 server
name            = your Radio name  # name of the stream

description     = Your description # description of the stream
url             = http://www.myradio.net # URL related to the stream
genre           = various               # genre of the stream
public          = yes                   # advertise this stream?
localDumpFile   = dump.mp3              # local dump file


 My notes:
* Always duration= 0 to keep enconding to the server.
* device= default if you are not sure what to setup. In my case there's no special sound card.
* If you want stereo sound samplerate, bitspersample and channel remains like mine.
* bitrate has 3 possible values cbr, vbr and abr. There's no big difference in sound quality but in the amount of data you use. See
* format can be vorbis or mp3
* bitrate it's very important this will control sound quality sent to the server and it doesn't work like simplecast, butt or other streaming software. There will be a lot of difference between 64 and 128, personally I don't like the sound set in 64. This will increase the amount of data used.
* quality will affect also the amount of data and how good the sound will be available, play with values from 0.1 to 1.0 and find the one that works for you.

E. Install pulse Audio Volumen Control
apt-get install pavucontrol
or
sudo apt-get install pavucontrol

F. Run darkice from any terminal
darkice
or
sudo darkice

You should see a screen like this

Review any error on the screen, error will avoid darkice from running. Normally if you see the lines Using config and Using ALSA or any other driver, means darkice is running.

G. Setup the Pulse Audio Volumen Control (pavucontrol)
If darkice is running pavucontrol will show in the recording tab ALSA plug-in. There just change to monitor. This will make that every sound on the sound card (even system sounds) go to the icecast server.


So play youtube, some mp3 in you USB or sing loud with your microphone!!!!
If this article helps, please donate!!!

Comentarios

Entradas populares de este blog

Enable MP3 codec on Windows 10 (Fraunhofer IIS MPEG Layer-3 Codec / l3codecp.acm)

La de Clave entidad federativa DIF no corresponde con las opciones del catalogo del SAT CFDI 4.0 Nomina