Project



Name: Radio
People: collective
Description: weekly radio show (and sometimes more)

Radio

Every Thursday night, LAG broadcasts the "leftover" show from LAG.

  1. Radio
  2. Using the stationary radio setup (antani.lag) in the lag
    1. Starting the Radio Stream
      1. 0. Turn on antani (the big computer on the table)
      2. 1. Start Ardour
      3. 2. Start liquidsoap
      4. 3. Start OBS
      5. 4. Make the required connections in ardour:
      6. 5. Start the OBS Stream (Audio+Video)
      7. 6. Run scripts to announce on irc twitter etc.
      8. 7. Check if everything is working fine
      9. 8. Stop the Stream and publish the recordings
    2. Resolving issues
      1. crackling / dropouts / xruns
      2. crashes
      3. software build from source
      4. initscripts
      5. shoutstuff
      6. Jack
  3. Using your own streaming setup
    1. Broadcasting on the main leftover stream (this is what shows up on the https://leftover.puscii.nl website and intergalactic)
      1. audio
        1. generic settings, should work on any icecast2 source client
        2. When you use mixxx:
        3. When you use darkice:
        4. When you use darksnow:
        5. When you use virtualdj:
        6. When you use liquidsoap:
        7. from an android phone (so you can talk from location over a audio stream)
      2. video
    2. Sending a stream to the studio (so someone that is making a broadcast on the main stream can mix in your contribution)
      1. video:
      2. audio:
  4. Playing other streams on the main stream using antani
      1. Video
      2. Audio
  5. Using the portable radio setup
    1. how to connect the portable radio setup
  6. how to maintain and extend the radio setup (servers, etc.)
    1. getting set up to change stuff
    2. automation and server
  7. Frequently asked Questions
    1. liquidsoap
  8. icecast_flac(live, mount="pap-b", host="dock.lag", port=8051, password="hackme")
      1. http://dock.lag:8051 -or- http://hlsorigin.laglab.org:8051
      2. notlive.ogg
    1. nginx-rtmp
    2. logging in
    3. server
  9. todo

Put yourself on the (https://lists.puscii.nl/wws/info/pap)[mailinglist]

Using the stationary radio setup (antani.lag) in the lag

Starting the Radio Stream

Streaming is done from the antani.lag machine.

Those instructions are for when you are using antani.lag (for using another machine go to Streaming for different machines)

0. Turn on antani (the big computer on the table)

log in as user with the password "user"

1. Start Ardour

Wait untill the ardour welcome screen (the one where you choose name and template) appears, choose the right template and make sure the name is good.

If the ardour new session thing does not appear, join the #lag channel on irc, and read the "resolving issues" section of this page.

  • create a new session (with name and date in the name, do NOT use spaces, and put the name and the date in the format "2019-02-28-name-with-dashes" also use a descriptive name like "leftover-from-lag-with-guitar-from-quebec" ).
  • go to "Mixer" mode (top-right corner button).
  • create a new stereo track:

  • make sure sound is coming in by looking at the input track's vu-meter.
  • go to "Editor" mode (top-right corner button).
  • arm the track for recording (red round button on track).
  • click the red button and click play, to start recording.
  • you should see a waveform appearing on the track, and cursor moving:

2. Start liquidsoap

Impoortant: Always start the audio stream, also when you do video too.

To start the audio-only stream on antani type: systemctl --user start liquidsoap Then connect the master output of ardour to the liquidsoap input

In order to check the status of liquidsoap run (as user 'user') systemctl --user status liquidsoap.service

Important, do not forget this:

To start the stream on antani type: systemctl --user start liquidsoap in a terminal as the user user

Then go to ardour, and connect the master channel to liquidsoap.

Then, on another computer (or you phone) go to: http://deathstar.puscii.nl:8000/leftover.opus , and verify that you indeed hear what you are broadcasting.

3. Start OBS

_IMPORTANT: before you start OBS first start the audio stream, see previous section

^^^^^^^^^^^^^^^^ READ THAT FFS. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Wait untill obs starts by itself, if it doesn't probably something is wrong, in that read "resolving issues".

Double-click the "Lineup" source, to set today's lineup info:

Edit the text:

If you want to create new scenes to set different background pictures, add video sources, etc., this may be the right time.

Don't change existing scenes, just duplicate them and name them appropriately.

if you change obs setup, don't forget to commit and push:

cd .config/obs git commit -a -m 'whatyouchanged' git push write master:[computername]

Then, on your laptop (or on git.puscii.nl) you can merge that branch into master.

4. Make the required connections in ardour:

  • open the routing grid of the master track by pushing the button at the bottom right, and configure it as shown:

5. Start the OBS Stream (Audio+Video)

  • Go back to the OBS window.
  • Make sure you see a signal coming in in the "obs-input" vu-meter in the Audio Mixer panel at the bottom.
  • Start the stream and the recording, by pushing the "Start Streaming" and "Start Recording" buttons at the bottom right.
  • Don't forget to have fun with scenes! And not change existing ones but duplicate them instead, and name them approprietely.

Now, go to a browser on another computer and verify: https://leftover.puscii.nl is playing the video stream https://intergactic.fm/leftover is playing the video stream

6. Run scripts to announce on irc twitter etc.

This is now working automagically (shoutloop, sopel_leftover etc. systemd user units), if not, read "resolving issues".

7. Check if everything is working fine

TODO: write how to check

8. Stop the Stream and publish the recordings

  • In OBS, press "Stop Streaming" and "Stop Recording".
  • In Ardour, press stop, save session and quit.
  • On the top right corner, click on the "ON AIR" button to stop the audio-only stream.
  • If the streaming computer is not needed anymore it can be shut down using the main menu.

TODO: write how to publish recording

Resolving issues

If something does not work, join the #lag irc channel, and explain what does not work, quite likely there is someone there that might know what's up.

crackling / dropouts / xruns

  • check if rt kernel is booted
  • check if owncloud, and other software you need is not running

crashes

  • check in dmesg and journalctl for the cause
  • save those logs somewhere
  • fix the bugs (or report it on upstream bugtracker)

software build from source

in /usr/local/src is a bunch of stuff that is build from source

initscripts

All things are running as systemd userservices (thats the new fancy way of running all the desktop environment stuff)

Here is some docs about that: https://wiki.archlinux.org/index.php/Systemd/User

Basically there is some unit files in /home/user/.config/systemd/user that are the same as normal systemd unit files, but they only apply to that useraccount.

There is a target called xsession.target , that is supposed to get started when you log in on an X screen (in .Xsession).

All those userunits log to journald, you have to be root to look at it (FIXME: give user access to journal)

Look at the logs: su - journalctl

To stop obs (or anything else):

systemctl --user stop obs systemctl --user stop ardour

To see all userservices:

systemctl --user status

shoutstuff

https://ikiwiki.laglab.org/Radio/

Jack

Jack starts automatically as a user systemd service, no manual steps are necessary.

qjackctl can still be used as shown below, it will simply connect to the already running jack.

qjackctl

In case of trouble, the user systemd unit called jackd.service takes care of starting Jack after the user logs in. Its status can be checked with systemctl --user status jackd.service

Using your own streaming setup

Broadcasting on the main leftover stream (this is what shows up on the https://leftover.puscii.nl website and intergalactic)

There is 2 streams, and audio stream and a video stream (yes it could be nice if they would be 1, but that is not currently the case)

You always enable the audio stream, cause otherwise a lot of people cannot listen.

To stream the audio you use the icecast protocol (you can use, darkice, darksnow, liquidsoap, mixxx, etc.)

As the format you have to use ogg vorbis (mp3 is broken, if you have software that cannot do ogg, complain on irc)

audio

If you only sending audio, login to dock.lag and start the audio -> video script:

IMPORTANT: to login to dock.lag, you will need to get your ssh key there, read the getting set up to change stuff section

ssh dock.lag screen -dr audiovideo cd ~/sources/streaming-docker/streaming-media-stuff/leftover root@dock:~/sources/streaming-docker/streaming-media-stuff/leftover# ./audio_to_video.sh

Then go to the website and verify that indeed the relay is working.

To stop: ssh dock.lag screen -dr audiovideo press ctrl-C

verify that indeed it is stopped

generic settings, should work on any icecast2 source client

encoder = ogg vorbis (Do NOT use mp3, it doesn't work) mountpoint = "pap-b" host = "hlsorigin.laglab.org" port = 8051 password = "hackme"

When you use mixxx:

FIXME: write this section

and the seetings are...

When you use darkice:

FIXME: write this section

When you use darksnow:

FIXME: write this section

When you use virtualdj:

format: ogg (icecast) bitrate: 256 Broadcast to a radio server: server: hlsorigin.laglab.org/pap-c port: 8051 Name: source Password: hackme Genre: whatever you want

When you use liquidsoap:

stream = mksafe(noise()); name = "pap-c" vorbis_encoding = %vorbis.abr(bitrate=256, channels=2) external_server = output.icecast(host="hlsorigin.laglab.org", port=8051, password="hackme") external_server(vorbis_encoding, stream, mount="#{name}")

from an android phone (so you can talk from location over a audio stream)

Install https://coolmic.net/

Configure this as the server settings: encoder = ogg vorbis (Do NOT use mp3, it doesn't work) mountpoint = "pap-a" host = "hlsorigin.laglab.org" port = 8051 password = "hackme"

Now if you press the big button in the app, you will override the existing stream and you can talk.

video

If you want to also make a video stream, the one that is broadcasted on the website and IFM, use the following settings (if you do make sure you first started the audio):

The settings given here are specifically for OBS, but it is just rtmp so it should also work with other software (ffmpeg, gstreamer, some android app's)

IMPORTANT: first get the audio stream working, before you start on the video stream

FIXME: this is currently disabled in the production setup to prevent all unauthorized recordings, complain on irc when you want to do this , bug report here: https://git.puscii.nl/sms/streaming-docker/-/issues/19

server: rtmp://hlsorigin.laglab.org/stream/ streamkey: leftover video output resolution: 1280x720 video bitrate: 700Kbps audio bitrate: 160Kbps

Sending a stream to the studio (so someone that is making a broadcast on the main stream can mix in your contribution)

You would use this to send your feed to some people that are in lag, so they can include it in a broadcast they are doing, to do your own broadcast, read the previous section.

if you are in lag, and want you video stream to be included in the 'main' stream, look at playing other streams below

video:

server: rtmp://hlsorigin.laglab.org/streaminput/ streamkey: a_name_you_choose video output resolution: 1280x720 video bitrate: 700Kbps audio bitrate: 160Kbps

audio:

See other section about audio above ^

Playing other streams on the main stream using antani

Video

If you want to play a video stream in OBS, use a "media source", deselect "local file" and "Restart playback when source becomes active"
in the input field put rtmp://dock.lag/streaminput/"chosen_name"

Audio

Open the stream in mocp (or vlc), connect mocp(or vlc) to a free channel in ardour

Using the portable radio setup

The portable radio setup is a dell laptop, together with a m-audio firewire audiocard a mirophone and a bunch of other stuff (FIXME: take some photo's so someone can find this stuff).

Before taking it somewhere, make sure it is connected in the lag a few days before (turned on, ethernet connected, and hexchat online), then mention that on irc, so the config can be updated to what currently works, cause everything changes all the time.

The software on the laptop is the same as on antani, so for using the software read the antani manual.

how to connect the portable radio setup

You will need:

A laptop with Ardour and the radio configuration

A sound card

A mixer (for connecting the microphone)

A microphone

A long ethernet cable

Speakers

Headphones

Cables:

1 USB cable for the sound card

2 Master out Tulip cables (from Mixer to Sound card)

1 Power plug for Mixer

1 cable to connect Microphone to Mixer

1 cable to connect laptop to mixer (sound in-CUE CD1)

Instructions:

Turn on the Laptop

Connect the computer to the internet via cable

Connect the sound card to the Laptop via USB cable

Connect mixer to sound card via the two tulip cables (master OUTR)

Connect your own laptop (or phone, tablet, or any other device from where the music comes) to the Mixer via cable (sound in-CUE CD1)

Connect MIC to Mixer

Connect the Speakers

how to maintain and extend the radio setup (servers, etc.)

getting set up to change stuff

Make sure you have an account on https://git.puscii.nl

Read https://docs.gitlab.com/ee/gitlab-basics/

Add your ssh key to that account https://docs.gitlab.com/ee/gitlab-basics/create-your-ssh-keys.html

Ask some lag people to give you access to stuff.

create a folder called radio on your computer, and clone the repo's:

IMPORTANT: do not try to edit / upload files via the webinterface, it will trow an error and delete your changes

mkdir radio cd radio git clone git@185.52.224.4:sms/streaming-media-stuff.git git clone git@185.52.224.4:lag/wiki.git git clone git@185.52.224.4:lag/docs.git git clone git@185.52.224.4:lag/lagpass.git git clone git@185.52.224.4:sms/streaming-docker.git git clone git@185.52.224.4:admradio/pap-website-jekyll.git

automation and server

 svg graph of leftover

edit this (you have to clone the ikiwiki repo: git clone git@185.52.224.4:lag/wiki.git): leftover.dot

user@stdio:~/.config/obs-studio/basic/profiles/leftover$ there is a service.json thats where you change server settings before changing: systemctl --user stop obs after changing: systemctl --user start obs

root@stdio:~# journalctl gives you logs

user@stdio:$ systemctl --user status [servicename] gives you status of service

Frequently asked Questions

liquidsoap

There is a liquidsoap running on antani, what it does it, it reads audio from jack, encodes it, and sends it off to the liquidsoap running on dock.lag.

Here is the .liq file:

cat papillon-ls1ls2-low.liq set("frame.audio.samplerate",48000) set("server.telnet.port", 2023) set("server.telnet", true) set("frame.duration",0.16)

set("log.file.path","/dev/null") set("log.stdout",true)

live = mksafe(input.jack(id="liquidsoap-ls1ls2-low", buffer_size=8, clock_safe=false))

%include "pap-streams.liq"

icecast_flac(live, mount="pap-b", host="dock.lag", port=8051, password="hackme")

icecast_ogg(live, mount="pap-b", host="dock.lag", port=8051, password="hackme")

The main liquidsoap is on dock.lag, read below.

http://dock.lag:8051 -or- http://hlsorigin.laglab.org:8051

This is the 'main' Liquidsoap that can be used to forward to http://deathstar.puscii.nl:8000/

It is built using this dockerfile

It 'currently' tries to play from a number of archive directories (that can be filled with files) and has several live inputs pap(a-e).

The 'current' configuration can be found here

notlive.ogg

There is a robotic text that is generated by a script espeak-msg.sh . You can find it here

It plays when there are no streams or content active as a last fallback.

You can change the text, and it will espeak it into a file.

nginx-rtmp

We use nginx-rtmp to transcode, record, restream, and create hls packets for the website.

It is 'currently' based on the upstream docker-nginx-rtmp project

The 'current' configuration can de found here

logging in

  • router303 - aka 'lagrouter', runs openwrt 'docs'
  • dom0 - xen hypervisor, runs VMs 'docs' (via router303)
  • dock.lag - vm on dom0, runs liquidsoap and nginx-rtmp containers. see streaming-docker

server

Q: the server is not turned on, because people don't know the password or smth A: in lag docs its explained how to turn it on

"lag docs" are here

todo

  • document the new streaming server
  • expose liquidsoap port
  • actually make cache work