我正在尝试使用 icecast2 和 darkice 访问我的 InstantFM USB 收音机加密狗。
我已经设置得足够好了,当我访问流(192.168.2.108:8000/instantfm)时,我确实听到了声音,但播放速度非常慢。有人能告诉我我做错了什么吗?我对 Linux 相当熟悉,但对 Linux 音频不太熟悉。
使用 arecord 我能够从设备中捕获以下内容
sudo arecord -q -d 60 -c 2 -D hw:1,0 -r 96000 -f s16_LE radio.wav
如果我将 [input]sampleRate 设置为 48000 以上,则运行 darkice 时我会得到以下信息:
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]
joey@q6600:/var/log$
我的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
[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
# this section describes the audio input that will be streamed
[input]
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
[icecast2-0]
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
操作系统:Ubuntu 12.04.3 LTS icecast 版本:2.3.2 darkice 版本:1.0
提前致谢。
按照以下说明安装并运行 liquidsoap 后,其播放速度仍然很慢。
液体肥皂的产出量:
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 [email protected]...
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
由于 Darkice 不喜欢 USB 设备产生的 96khz 采样率,
你可以尝试洗手液,另一个流媒体软件:
sudo aptitude 安装 liquidsoap
sudo aptitude 安装 liquidsoap-plugin-alsa
然后启动 Liquidsoap,并在以下命令中替换服务器 IP 和密码:
liquidsoap 'output.icecast(%vorbis,host = "q6600.home.lan", port = 8000,password="your_password",mount = "liq.ogg", mksafe(input.alsa(device="hw:1,0")))'
它将产生一个流
http://q6600.home.lan:8000/liq.ogg
Liquidsoap网站 http://savonet.sourceforge.net/