I am trying to access my InstantFM USB radio dongle using icecast2 and darkice.

I have it set up well enough that when I access the stream ( I do get sound but it is playing extremely slow. Can someone tell me what I am doing wrong? I am fairly proficient with linux, not so much with linux audio.

Using arecord I am able to capture from the device with the following

sudo arecord -q -d 60 -c 2 -D hw:1,0 -r 96000 -f s16_LE radio.wav

If I set the [input]sampleRate above 48000, when I run darkice I get the following:

joey@q6600:/var/log$ sudo darkice
DarkIce 1.0 live audio streamer, http://code.google.com/p/darkice/
Copyright (c) 2000-2007, Tyrell Hungary, http://tyrell.hu/
Copyright (c) 2008-2010, Akos Maroy and Rafael Diniz
This is free software, and you are welcome to redistribute it
under the terms of The GNU General Public License version 3 or
any later version.

Using config file: /etc/darkice.cfg
Using ALSA DSP input device: hw:1,0
Using POSIX real-time scheduling, priority 98
Home directory /home/joey not ours.
DarkIce: LameLibEncoder.cpp:261: lame lib initializing params error [0]

my darkice.cfg:

# sample DarkIce configuration file, edit for your needs before using
# see the darkice.cfg man page for details

# this section describes general aspects of the live streaming session
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

# this section describes the audio input that will be streamed
device          = hw:1,0
sampleRate      = 48000 #22050
bitsPerSample   = 16
channel         = 2

# 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
bitrateMode     = cbr       # average bit rate
quality         = 0.5
format          = mp3 #vorbis    # format of the stream: ogg vorbis
bitrate         = 96        # bitrate of the stream sent to the server
server          = q6600.home.lan
                            # host name of the server
port            = 8000      # port of the IceCast2 server, usually 8000
password        = ########   # source password to the IceCast2 server
mountPoint      = instantfm  # mount point of this stream on the IceCast2 server
name            = DarkIce trial
                            # name of the stream
description     = This is only a trial
                            # description of the stream
url             = http://www.home.lan
                            # URL related to the stream
genre           = my own    # genre of the stream
public          = yes       # advertise this stream?
localDumpFile   = dump.ogg  # local dump file

OS: Ubuntu 12.04.3 LTS icecast version: 2.3.2 darkice version: 1.0

Thanks in advance.

After installing and running liquidsoap as instructed below it still plays slowly.

Output from liquid soap:

joey@q6600:/var/log$ liquidsoap   'output.icecast(%vorbis,host = "q6600.home.lan", port = 8000,password="********",mount = "liq.ogg", mksafe(input.alsa(device="hw:1,0")))'
2014/05/24 19:55:12 >>> LOG START
2014/05/24 19:55:12 [protocols.external:3] Didn't find "ufetch".
2014/05/24 19:55:12 [protocols.external:3] Found "/usr/bin/wget".
2014/05/24 19:55:12 [main:3] Liquidsoap 1.0.0
2014/05/24 19:55:12 [main:3] Using: graphics=[distributed with Ocaml] pcre=6.2.2 dtools=0.2.2 duppy=0.4.2 duppy.syntax=0.4.2 cry=0.2.2 mm=0.2.0 xmlplaylist=0.1.3 lastfm=0.3.0 ogg=0.4.3 vorbis=0.6.1 speex=0.2.0 mad=0.4.4 flac=0.1.0 flac.ogg=0.1.0 dynlink=[distributed with Ocaml] lame=0.3.1 gstreamer=0.1.0 voaacenc=0.1.0 theora=0.3.0 schroedinger=0.1.0 gavl=0.1.4 bjack=0.1.3 alsa=0.2.1 ao=0.2.0 samplerate=0.1.1 taglib=0.2.0 magic=0.7.3 camomile=0.8.3 faad=0.3.0 soundtouch=0.1.7 portaudio=0.2.0 pulseaudio=0.1.2 ladspa=0.1.4 dssi=0.1.0 sdl=0.8.0 camlimages=4.0.0 lo=0.1.0 yojson=1.0.2 gd=1.0a5
2014/05/24 19:55:12 [dynamic.loader:3] Could not find dynamic module for aacplus encoder.
2014/05/24 19:55:12 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.0.0/plugins/cry.cmxs.
2014/05/24 19:55:12 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.0.0/plugins/flac.cmxs.
2014/05/24 19:55:12 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.0.0/plugins/pulseaudio.cmxs.
2014/05/24 19:55:12 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.0.0/plugins/taglib.cmxs.
2014/05/24 19:55:12 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.0.0/plugins/ogg.cmxs.
2014/05/24 19:55:12 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.0.0/plugins/alsa.cmxs.
2014/05/24 19:55:12 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.0.0/plugins/mad.cmxs.
2014/05/24 19:55:12 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.0.0/plugins/voaacenc.cmxs.
2014/05/24 19:55:12 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.0.0/plugins/lame.cmxs.
2014/05/24 19:55:12 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.0.0/plugins/faad.cmxs.
2014/05/24 19:55:12 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.0.0/plugins/flac_ogg.cmxs.
2014/05/24 19:55:12 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.0.0/plugins/vorbis.cmxs.
2014/05/24 19:55:12 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz master.
2014/05/24 19:55:12 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples.
2014/05/24 19:55:12 [frame:3] Targetting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks.
2014/05/24 19:55:12 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks.
2014/05/24 19:55:12 [threads:3] Created thread "generic queue #1".
2014/05/24 19:55:12 [threads:3] Created thread "generic queue #2".
2014/05/24 19:55:12 [threads:3] Created thread "src_4684" (1 total).
2014/05/24 19:55:12 [src_4684:3] Using ALSA 1.0.25.
2014/05/24 19:55:12 [liq(dot)ogg:3] Connecting mount liq.ogg for source@q6600.home.lan...
2014/05/24 19:55:12 [src_4684:2] Falling back on interleaved S16LE
2014/05/24 19:55:13 [liq(dot)ogg:3] Connection setup was successful.
2014/05/24 19:55:13 [threads:3] Created thread "wallclock_alsa" (2 total).
2014/05/24 19:55:13 [clock.wallclock_alsa:3] Streaming loop starts, synchronized by active sources.
2014/05/24 19:55:13 [mksafe:3] Switch to src_4684.

1 Answer 1


As Darkice don't like 96khz sample rate produced by the usb device,
you can give a try at Liquidsoap, another streaming software :

sudo aptitude install liquidsoap
sudo aptitude install liquidsoap-plugin-alsa

Then launch Liquidsoap replacing server ip and password in the following command:

liquidsoap   'output.icecast(%vorbis,host = "q6600.home.lan", port = 8000,password="your_password",mount = "liq.ogg", mksafe(input.alsa(device="hw:1,0")))'  

It will produce a stream at


Liquidsoap site http://savonet.sourceforge.net/

  • Took me about 3 minutes to follow your instructions and get the stream going. It is still slow. I have a edited my original post with the output from liquidsoap. Thanks again for the time.
    – shanham67
    May 25, 2014 at 0:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.