I am trying to use Liquidsoap to capture the output from FIrefox and send
it out to an Icecast server.
As a breadboard setup, I thought I would try to simply grab it and then
output it to a local device.
It is mostly working. After lots of reading up on ALSA and devices.
I have a loopback device defined as the default ALSA device. So Firefox
happily outputs stuff to that device.
I have connected the other end of the loopback to Liquidsoap. That works,
though it took me a while to figure out how to specify the device name
correctly.
I have also connected the output of Liquidsoap to a real card on my
system. Again, after figuring out how to name the device.
The whole thing mostly works. I can play a Youtube video in Firefox and
hear it on the speakers.
The problem is that I get underruns after a short while (seconds).
Here is my Liquidsoap code:
#!/usr/bin/liquidsoap
#
# Here is the 'theory'
# Firefox -> hw:Loopback,0,0 (aka 'default')
# hw:Loopback,1,0 -> Liquidsoap input.alsa(device="hw:Loopback,1,0")
# Liquidsoap output.alsa(device="hw:Device,0,0")
#
set("log.file.path","./RemoteDJ.log")
# Print log messages to the console,
set("log.stdout", true)
mic_in=input.alsa(id='browserIn',bufferize=false,
device="plughw:Loopback,1,0")
radio=fallback(track_sensitive=false,
[ mic_in])
output.alsa(id='localAudio', device="plughw:Device", radio)
And here is the log file:
2015/02/19 18:25:23 >>> LOG START
2015/02/19 18:25:23 [protocols.external:3] Found "/usr/bin/wget".
2015/02/19 18:25:23 [main:3] Liquidsoap 1.1.1
2015/02/19 18:25:23 [main:3] Using: graphics=[distributed with Ocaml]
pcre=7.0.2 dtools=0.3.1 duppy=0.5.1 duppy.syntax=0.5.1 cry=0.2.2 mm=0.2.1
xmlplaylist=0.1.3 lastfm=0.3.0 ogg=0.4.5 vorbis=0.6.1 opus=0.1.0
speex=0.2.0 mad=0.4.4 flac=0.1.1 flac.ogg=0.1.1 dynlink=[distributed with
Ocaml] lame=0.3.2 shine=0.1.1 gstreamer=0.2.0 frei0r=0.1.0 voaacenc=0.1.0
theora=0.3.0 schroedinger=0.1.0 gavl=0.1.5 bjack=0.1.4 alsa=0.2.1 ao=0.2.0
samplerate=0.1.2 taglib=0.3.1 magic=0.7.3 camomile=0.8.4 inotify=1.0
faad=0.3.2 soundtouch=0.1.7 portaudio=0.2.0 pulseaudio=0.1.2 ladspa=0.1.4
dssi=0.1.1 sdl=0.9.1 camlimages=4.0.0 lo=0.1.0 yojson=1.1.7 gd=1.0a5
2015/02/19 18:25:23 [dynamic.loader:3] Could not find dynamic module for
fdkaac encoder.
2015/02/19 18:25:23 [dynamic.loader:3] Could not find dynamic module for
aacplus encoder.
2015/02/19 18:25:23 [dynamic.loader:2] Loaded plugin file
/usr/lib/liquidsoap/1.1.1/plugins/pulseaudio.cmxs.
2015/02/19 18:25:23 [dynamic.loader:2] Loaded plugin file
/usr/lib/liquidsoap/1.1.1/plugins/ogg.cmxs.
2015/02/19 18:25:23 [dynamic.loader:2] Loaded plugin file
/usr/lib/liquidsoap/1.1.1/plugins/bjack.cmxs.
2015/02/19 18:25:23 [dynamic.loader:2] Loaded plugin file
/usr/lib/liquidsoap/1.1.1/plugins/alsa.cmxs.
2015/02/19 18:25:23 [dynamic.loader:2] Loaded plugin file
/usr/lib/liquidsoap/1.1.1/plugins/voaacenc.cmxs.
2015/02/19 18:25:23 [dynamic.loader:2] Loaded plugin file
/usr/lib/liquidsoap/1.1.1/plugins/flac_ogg.cmxs.
2015/02/19 18:25:23 [dynamic.loader:2] Loaded plugin file
/usr/lib/liquidsoap/1.1.1/plugins/vorbis.cmxs.
2015/02/19 18:25:23 [dynamic.loader:2] Loaded plugin file
/usr/lib/liquidsoap/1.1.1/plugins/flac.cmxs.
2015/02/19 18:25:23 [dynamic.loader:2] Loaded plugin file
/usr/lib/liquidsoap/1.1.1/plugins/lame.cmxs.
2015/02/19 18:25:23 [dynamic.loader:2] Loaded plugin file
/usr/lib/liquidsoap/1.1.1/plugins/faad.cmxs.
2015/02/19 18:25:23 [dynamic.loader:2] Loaded plugin file
/usr/lib/liquidsoap/1.1.1/plugins/cry.cmxs.
2015/02/19 18:25:23 [dynamic.loader:2] Loaded plugin file
/usr/lib/liquidsoap/1.1.1/plugins/mad.cmxs.
2015/02/19 18:25:23 [dynamic.loader:2] Loaded plugin file
/usr/lib/liquidsoap/1.1.1/plugins/taglib.cmxs.
2015/02/19 18:25:23 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz
master.
2015/02/19 18:25:23 [frame:3] Frame size must be a multiple of 1764 ticks =
1764 audio samples = 1 video samples.
2015/02/19 18:25:23 [frame:3] Targetting 'frame.duration': 0.04s = 1764
audio samples = 1764 ticks.
2015/02/19 18:25:23 [frame:3] Frames last 0.04s = 1764 audio samples = 1
video samples = 1764 ticks.
2015/02/19 18:25:23 [threads:3] Created thread "generic queue #1".
2015/02/19 18:25:23 [threads:3] Created thread "generic queue #2".
2015/02/19 18:25:23 [browserIn:3] Using ALSA 1.0.27.2.
2015/02/19 18:25:23 [browserIn:3] Samplefreq=44100Hz, Bufsize=1764B,
Frame=4B, Periods=98
2015/02/19 18:25:23 [threads:3] Created thread "localAudio" (1 total).
2015/02/19 18:25:23 [threads:3] Created thread "wallclock_alsa" (2 total).
2015/02/19 18:25:23 [clock.wallclock_alsa:3] Streaming loop starts,
synchronized by active sources.
2015/02/19 18:25:23 [fallback_4924:3] Switch to browserIn.
2015/02/19 18:25:23 [localAudio:3] Using ALSA 1.0.27.2.
2015/02/19 18:25:23 [localAudio:3] Samplefreq=44100Hz, Bufsize=262144B,
Frame=4B, Periods=5826
2015/02/19 18:25:28 [localAudio:2] Underrun!
2015/02/19 18:25:28 [localAudio:2] Trying to recover..
2015/02/19 18:25:34 [localAudio:2] Underrun!
2015/02/19 18:25:34 [localAudio:2] Trying to recover..
2015/02/19 18:25:37 [main:3] Shutdown started!
2015/02/19 18:25:37 [main:3] Waiting for threads to terminate...
2015/02/19 18:25:37 [threads:3] Thread "localAudio" terminated (1
remaining).
2015/02/19 18:25:37 [clock.wallclock_alsa:3] Streaming loop stopped.
2015/02/19 18:25:37 [threads:3] Thread "wallclock_alsa" terminated (0
remaining).
2015/02/19 18:25:37 [main:3] Cleaning downloaded files...
2015/02/19 18:25:37 [main:3] Freeing memory...
2015/02/19 18:25:37 >>> LOG END
(I hit Control-C to kill it after a few Underruns)
Any suggestions on what I need to do?
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users