This is an old revision of the document!
Audio streming
Základní motivace tohoto projektu je realizace audio streamu ze stage do studia na jednom milém malém festivalu (Letní zvěř 2016). Nicméně tyto principy lze použít kdykoli na cokoli…
TODO…
Setup
Tohle se týká konkrétně Letné zvěře a musí se to doplnit. TODO
- Stage:
- audio výstup z mixu, line-out
- PC bazmek s line-in vstupem (digitalizace, streaming)
- WiFi client
- Studio:
- WiFi AP
- PC bazmek s line-out výstupem (příjem streamu)
- mix
- …co dál? TODO…
WiFi
Nejjednodušší setup je klient - AP, ale aktuálně použijeme setup původně určený pro UfoBufo2016, což je na třech TP-Link TL-WDR4300 a OpenWRT postavené WDS. Milé je, že LAN porty jsou probridgeované s WLAN, tak stačí APčka zapnout a připojit na každé straně jedno PC (Stage a studio). Detailně popíšu jindy… TODO
Stage
Na stage bude PC s Line-in vstupem z mixu. Budeme zde típat input source a posílat do ices, který to bude enkodovat a stremovat na druhou stranu do studia.
Studio
Ve studiu bude také PC, kde poběží Icecast…
yum install pulseaudio-utils icecast
nano /etc/icecast.xml
<icecast>
<limits>
<clients>100</clients>
<sources>2</sources>
<threadpool>5</threadpool>
<queue-size>524288</queue-size>
<client-timeout>30</client-timeout>
<header-timeout>15</header-timeout>
<source-timeout>10</source-timeout>
<!-- If enabled, this will provide a burst of data when a client
first connects, thereby significantly reducing the startup
time for listeners that do substantial buffering. However,
it also significantly increases latency between the source
client and listening client. For low-latency setups, you
might want to disable this. -->
<burst-on-connect>0</burst-on-connect>
<burst-size>65535</burst-size>
</limits>
<authentication>
<source-password>heslo</source-password>
<relay-password>heslo</relay-password>
<admin-user>admin</admin-user>
<admin-password>heslo</admin-password>
</authentication>
<hostname>localhost</hostname>
<listen-socket>
<port>8000</port>
<!-- <shoutcast-mount>/stream</shoutcast-mount> -->
</listen-socket>
<fileserve>1</fileserve>
<paths>
<!-- basedir is only used if chroot is enabled -->
<basedir>/usr/share/icecast</basedir>
<!-- Note that if <chroot> is turned on below, these paths must both
be relative to the new root, not the original root -->
<logdir>/var/log/icecast</logdir>
<webroot>/usr/share/icecast/web</webroot>
<adminroot>/usr/share/icecast/admin</adminroot>
<pidfile>/var/run/icecast/icecast.pid</pidfile>
<alias source="/" dest="/status.xsl"/>
</paths>
<logging>
<accesslog>access.log</accesslog>
<errorlog>error.log</errorlog>
<!-- <playlistlog>playlist.log</playlistlog> -->
<loglevel>3</loglevel> <!-- 4 Debug, 3 Info, 2 Warn, 1 Error -->
<logsize>10000</logsize> <!-- Max size of a logfile -->
<!-- If logarchive is enabled (1), then when logsize is reached
the logfile will be moved to [error|access|playlist].log.DATESTAMP,
otherwise it will be moved to [error|access|playlist].log.old.
Default is non-archive mode (i.e. overwrite)
-->
<!-- <logarchive>1</logarchive> -->
</logging>
<security>
<chroot>0</chroot>
<changeowner>
<user>icecast</user>
<group>icecast</group>
</changeowner>
</security>
</icecast>
systemctl start icecast
a bacha na firewall…
Stream je pak dostupný na lokální adrese a portu 8000 např. přes browser.
Poznámky
Tohle je jen dočasný bordel z předchozího pokusu. Protřídit TODO…
instalace na labkovy centos6
yum install pulseaudio-utils icecast yum localinstall ftp://ftp.pbone.net/mirror/li.nux.ro/download/nux/dextop/el6/i386/ices-2.0.1-10.el6.nux.i686.rpm
/etc/ices.conf
<input>
<module>stdinpcm</module>
<param name="rate">44100</param>
<param name="channels">2</param>
<param name="metadata">1</param>
<param name="metadatafilename">/home/ices/metadata</param>
</input>
<instance>
<hostname>stream.slu.cz</hostname>
<port>8000</port>
<password>********</password>
<mount>/dron.ogg</mount>
<reconnectdelay>2</reconnectdelay>
<reconnectattempts>5</reconnectattempts>
<maxqueuelength>80</maxqueuelength>
<encode>
<nominal-bitrate>64000</nominal-bitrate> <!-- bps. e.g. 64000 for 64 kbps -->
<samplerate>44100</samplerate>
<channels>2</channels>
</encode>
</instance>
spustit paman, Devices, najit odpovidajici sink, dat Properties, a zkopirovat si radek Monitor Source.
pak tento source preposleme do ices (a ten to enkodne a posle do icecastu)
parec -d alsa_output.pci-0000_00_1b.0.analog-stereo.monitor --raw | ices /etc/ices.conf
yum install pulseaudio-utils paman ices icecast
seznam sinku
LANG=C pactl list | grep -A2 'Source #' | grep 'Name: ' | cut -d " " -f2
alsa_output.pci-0000_00_1b.0.analog-stereo.monitor alsa_input.pci-0000_00_1b.0.analog-stereo
parec -d alsa_input.pci-0000_00_1b.0.analog-stereo --raw | ices /etc/ices.conf