Radio Calafou: Difference between revisions

From Wiki-Fou
No edit summary
 
(25 intermediate revisions by 3 users not shown)
Line 1: Line 1:
= Radio Calafou ? =
= Radio Calafou ? =
A FM and stream radio based in Calafou that broadcast very locally on 108 Mhz and on http://radio.calafou:8000/airtime_128.m3u
A FM and stream radio based in Calafou that broadcast very locally on 107 Mhz and on http://essun.calafou.org:8000/radiocalafou.ogg (you can't listen to it from outside calafou, local network)
[[File:Radiocalafou anarchaserver.redim.jpg|center]]
[[File:Radiocalafou anarchaserver.redim.jpg|center]]


= Global set-up =
= Global set-up =
[[File:radiocalaflowschema.png]]
[[File:radiocalaflowschema.png]]
The PiBox read the stream that comes from Airtime and play it to the transmitter<br />
The PiBox read the stream that comes from Libretime and play it to the transmitter<br />
* To Airtime : http://radio.calafou user : calafou pwd : calafou
* To Libretime : http://radio.calafou.org user : calafou pwd : calafou o (admin / admin)
* To Icecast : http://radio.calafou:8000 user : source pwd : hackme
* To Icecast : http://radio.calafou.org:8000 user : source pwd : hackme
* To the PiBox : http://172.31.23.158 user : pibox pwd : pnodeaccesspass - ssh pi@172.31.23.158 pwd : pipinode
* To the PiBox : http://172.31.17.98 user : pibox pwd : pnodeaccesspass - ssh pi@h172.31.17.98 pwd : raspberry
* To listen audio stream : http://radio.calafou.org:8000/radiocalafou.ogg


[[File:IMG_2919.redim.JPG|center]]
[[File:IMG_2919.redim.JPG|center]]
= What can we do with it ? =
= What can we do with it ? =
== Airtime ==
== Libretime ==
'''https://libretime.org/guides'''
Threw Media Builder
Threw Media Builder
* Possible to add any type of audio file, the library already include all the files that are stored in ftp://omnius.calafou/MEDIATECA/0_audio/music/ and create a playlist
* Possible to add any type of audio file, the library already include all the files that are stored in ftp://omnius.calafou/MEDIATECA/0_audio/music/ and create a playlist
Line 32: Line 35:


= How To use Radio Calafou =
= How To use Radio Calafou =
== Airtime : add content ==
* '''Manual LibreTime''' https://ikerlandajuela.github.io/radiolibre/man/libretime/
The main documentation is here : http://sourcefabric.booktype.pro/airtime-25-for-broadcasters/what-is-airtime/
* Docs en ingles https://libretime.org/docs/scheduling-shows
[[File:Airtime_nowplaying.png|1280px|center]]


== Airtime : add a media ==
[[File:LibretimeRadioCalafou.png|1280px]]
Note : the audio folder of MEDIATECA has been added as a [http://sourcefabric.booktype.pro/airtime-25-for-broadcasters/media-folders/ watched folder], so you can find all the audio files of the MEDIATECA in Airtime library
* http://sourcefabric.booktype.pro/airtime-25-for-broadcasters/add-media/
[[File:Screenshot383-Add_media.png|center]]


== Airtime : To create a smart block, a playlist or a webstream, you have to open the Media Builder ==
In the "Library"menu
[[File:Screenshot500-Open_media_builder_240.png|center]]


== Airtime : create a smart block ==
=== SmartPhone journalism ===
A smart block is an intelligent playlist built with criteria
It is possible to use Airtime with a smartphone, see http://sourcefabric.booktype.pro/airtime-25-for-broadcasters/smartphone-journalism/
* http://sourcefabric.booktype.pro/airtime-25-for-broadcasters/library/
'''
For the moment the calendar has been filled with different smart blocks repeated, it is possible to remove a smart block in the Calendar menu :'''
Clic on the block in the calendar you want to remove and in the sub menu > delete > delete this instance
 
[[File:Capture du 2016-08-28 16-40-17.png|center]]
 
== Airtime : create a playlist ==
* http://sourcefabric.booktype.pro/airtime-25-for-broadcasters/library/
 
== Airtime : create a webstream ==
* http://sourcefabric.booktype.pro/airtime-25-for-broadcasters/library/
 
== Airtime : add a show to the calendar with a smart block, a playlist or a webstream as content ==
* http://sourcefabric.booktype.pro/airtime-25-for-broadcasters/calendar/


=== SmartPhone journalism ===
== SmartPhone streaming applications ==
It is possible to use Airtime with a smartphone, see http://sourcefabric.booktype.pro/airtime-25-for-broadcasters/smartphone-journalism/  
* Broadcast Myself https://play.google.com/store/apps/details?id=sa.broadcastmyselfpro is an android app to stream live. No more availabe as a free version ::: '''download the free version here''' [https://wiki.calafou.org/images/7/74/BroadcastMySelf_v0.9.12_apkpure.zip BroadcastMySelf_v0.9.12_apkpure.zip]
* Xiph list several  apps pour Android et iOS (dont BroadcastMySelf) https://icecast.org/apps/
* NovaStream https://novastreamapps.blogspot.com/ Android
* Coolmic https://coolmic.net/ Android avaialble on F-Droid
* Backpackstudio https://backpackstudioapp.com/ iOS
* iziCast https://danielnoethen.de/iziCast/ iOS
* Giss_Vorbis http://giss.tv/wiki/index.php/Android_Ogg_Streamer_:_Giss_Vorbis


=== Taking the control live with a smartphone ===
=== Taking the control live with a smartphone ===
As mentionned, it is possible to take the control of the radio with a specific mountpoint (the master source mountpoint), it is also possible with an (android) smartphone with the application "Broadcast Myself" that allow one to stream the mic of the smartphone or files
As mentionned, it is possible to take the control of the radio with a specific mountpoint (the master source mountpoint), it is also possible with an (android) smartphone with the application "Broadcast Myself" (see before) that allow one to stream the mic of the smartphone or files
 
This software can be downloaded here without a google account : https://apkpure.com/broadcastmyself/sa.broadcastmyself


The settings > Output settings :
The settings > Output settings :
* Hostname : radio.calafou
* Hostname : radio.calafou.org
* Port : 8003
* Port : 8001
* Path : /dictat.ogg
* Path : /master
* Username : mistress
* Username : master
* Password : mistress
* Password : master
* MP3 Encoder Bitrate (as you wish) : 96 Kbit/s
* MP3 Encoder Bitrate (as you wish) : 96 Kbit/s


[[File:screen-0=x355.jpg|center]]
[[File:screen-0=x355.jpg|center]]
=== Re-stream the output of airtime on another server ===
In theory, you can set up several output to an icecast server with Airtime Settings, in practive, it doesn't alway work, so you can also do :
avconv -i http://radio.calafou:8000/airtime_128.ogg -f ogg -|oggfwd -p -d "Hack The Earth" -g "Ecochonies" -u "https://calafoorg/ca/content/hack-earth-2017" labomedia.org 8000 ****** /hacktheearth.ogg


= Hardware installation =
= Hardware installation =
Line 88: Line 77:


= Software installation =
= Software installation =
== AirTime ==
== Icecast2 with ssl support ==
Airtime is a simple, open source platform that lets you broadcast streaming radio on the web. https://www.sourcefabric.org/en/airtime/
test if your version of icecast has ssl support
  ldd /usr/bin/icecast2 | grep ssl
si
  libssl.so.3 => /lib/x86_64-linux-gnu/libssl.so.3 (0x00007f10a2cc9000)
so ok
 
Install last version of icecast from Xiph repo
  nano /etc/apt/sources.list.d/icecast.list
add
  deb http://download.opensuse.org/repositories/multimedia:/xiph/Debian_12/ ./
get the key
  wget -qO - https://build.opensuse.org/projects/multimedia:xiph/signing_keys/download?kind=gpg | sudo apt-key add -
  apt update
  sudo apt-get install -t Debian_12 icecast2
Add a script to create a bundle certificate while certbot renew it
  nano /etc/letsencrypt/renewal/calafou.org-0002.conf
add
  post_hook = cat /etc/letsencrypt/live/calafou.org-0002/fullchain.pem /etc/letsencrypt/live/calafou.org-0002/privkey.pem > /etc/icecast2/bundle.pem && systemctl restart icecast2
 
'''And don't forget to change to put ENABLE=true''' :
  nano /etc/default/icecast2
  # Edit /etc/icecast2/icecast.xml and change at least the passwords.
  # Change this to true when done to enable the init.d script
  ENABLE=true
 
see https://tech-docs.thisispurefm.com/docs/tech-team/transmission/installing-icecast.html
 
== Liquidsoap ==
=== Install liquidsoap via opam ===
  opam update
  opam upgrade
  eval $(opam env)
  opam info liquidsoap
 
  sudo apt-get install libpcre3=2:8.39-15
  sudo apt-get install libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev libcurl4-gnutls-dev libogg-dev libopus-dev libpcre3-dev libswresample-dev libswscale-dev
 
  opam install ffmpeg taglib mad lame vorbis opus cry samplerate liquidsoap
 
See https://opam.ocaml.org/doc/Install.html and https://www.liquidsoap.info/doc-2.4.2/build.html


It is installed on omnius : http://radio.calafou
=== Script to stream a random audio file from Mediateca ===
  #!/usr/bin/liquidsoap
 
  mount      = "mediateca.mp3"
  genre      = "random"
  description = "toda la musica de la mediateca en random."
  name        = "Mediateca Random"
  #protocol    = "http"
  port        = 8000
  password    = "*****"
  host        = "localhost"
  url        = "https://radio.calafou.org/"
  #encoding    = "UTF-8"
 
  dir = "/mnt/3t/ftp/MEDIATECA/musica/"
 
  set("log.file.path", "/home/b01/liquidsoap-daemon/scripts/randommediateca.log")
 
  dir = nrj(playlist(mode='randomize',reload=10,reload_mode="rounds",dir))
 
  # A function applied to each metadata chunk
  def append_title(m) =
  title = m["title"]
  album = m["album"]
  date  = m["date"]
  [("title","#{title} : #{album} (#{date})")]
  end
  dir = map_metadata(append_title, dir)
  radio = mksafe(dir)
  #radio = crossfade(radio)
 
  # Output the full stream in MP3
  output.icecast(%mp3(bitrate=256),
  host=host,
  port=port,
  password=password,
  mount=mount,
  radio,
  url=url,
  name=name,
  description=description,
  genre=genre)


To install it, install dependencies :
=== Daemonize the script ===
sudo apt-get install postgresql-9.4 python-virtualenv apache2 coreutils curl ecasound flac gzip libapache2-mod-php5 libcamomile-ocaml-data liquidsoap locales lsof monit mp3gain multitail patch php5-cli php5-curl php5-gd php5-json php5-pgsql php5-fpm php-apc php-pear pwgen python rabbitmq-server silan sudo sysv-rc tar unzip vorbisgain vorbis-tools zendframework icecast2
  git clone https://github.com/savonet/liquidsoap-daemon
Put the script in a scripts folder
  cd liquidsoap-daemon/
  ./daemonize-liquidsoap.sh ~/liquidsoap-daemon/scripts/randomplaylistmediateca.liq
 
== Libretime via Docker==
* Install using docker https://libretime.org/docs/admin-manual/install/install-using-docker/
* Config reverse proxy https://libretime.org/docs/admin-manual/install/reverse-proxy/
* Config Libretime https://libretime.org/docs/admin-manual/configuration/
* Config the docker
  nano docker-compose.yml


/!\ for debian jessie, you must install postgresql-9.4 and not postgresql without -9.4 else the calendar does'nt show up /!\


Clone the repository and launch the installer :
git clone https://github.com/sourcefabric/Airtime
cd Airtime
sudo ./install
Follow the configuration process, at the end, you'll see the IP adress of the pibox on wich you can connect with a browser to finish the configuration threw the proposed interface
* Réf : http://sourcefabric.booktype.pro/airtime-25-for-broadcasters/manual-installation/


== PiBox ==
== PiBox ==
See documentation here : http://p-node.org/doc/index.php/V-2
See documentation here : http://p-node.org/doc/index.php/V-2
* To the PiBox : http://172.31.17.214/ user : pibox pwd : pnodeaccesspass


For the moment (see troubleshouting), 2 script are launched by /etc/rc.local :
For the moment (see troubleshouting), 2 script are launched by /etc/rc.local :
Line 127: Line 200:


= Troubleshouting =
= Troubleshouting =
== Airtime ==
== Libretime ==
=== The main stream doesn't output sound ===
=== Libretime doesn't seems to play sound, show the media builder or eat new sounds ===
It happens sometimes, to repair it, you can send a master source with a streaming software and then disconnect it, the sound reappear ! ...
* To send a master source, the parameters are here : http://p-node.org/doc/index.php/V-2
** Master username : mistress
** Master password : mistress
** Port : 8003
** Mountpoint : dictat.ogg
** Master Source Connection URL : http://radio.calafou:8003/dictat.ogg
=== Airtime doesn't seems to play sound, show the media builder or eat new sounds ===
The 3 magic command to restart everything (you have to be logged in omnius :
The 3 magic command to restart everything (you have to be logged in omnius :
  sudo service airtime-media-monitor restart
  sudo service airtime-media-monitor restart
Line 145: Line 210:
also, see the logs in /var/log/airtime/
also, see the logs in /var/log/airtime/


=== Airtime doesn't take into account the modifications made in System > Streams ===
=== Libretime doesn't take into account the modifications made in System > Streams ===
Relaunching liquidsoap seems necessary :  
Relaunching liquidsoap seems necessary :  
  sudo service airtime-liquidsoap stop
  sudo service airtime-liquidsoap stop
  sudo service airtime-liquidsoap start
  sudo service airtime-liquidsoap start
=== Test a stream configuration ===
liquidsoap 'output.icecast(%vorbis, host = "radio.calafou", port = 8000, user = "source" password = "hackme", mount = "liq.ogg", sine())'


=== Airtime doesn't alway wait for the end of the track ===
=== Airtime doesn't alway wait for the end of the track ===
Don't know why ...
Don't know why ...


== PiBox ==
=== The master mount point 8001 can't be reached when Libretime is inside a LXC container ===
For the moment (28.08.2016), this interface of pibox is not used because the python script often switch to a fall back mode, so scripts with a player for Airtime stream and Omnius sonification are launched instead by rc.local
add these iptables rules (the container ip is 192.168.122.11):
iptables -I FORWARD -p tcp -d 192.168.122.11 --dport 8001 -j ACCEPT
iptables -A INPUT -p tcp --dport 8001 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp --dport 8001 -j DNAT --to-destination 192.168.122.11:8001
 


== Antenna ==
== Antenna ==
Line 169: Line 241:
* http://www.radiobronka.info/
* http://www.radiobronka.info/
* http://www.radiolinea4.net/
* http://www.radiolinea4.net/
* http://www.radiopica.net/
* http://radiopica.cat/
* http://www.radiorsk.info/
* http://www.radiorsk.info/

Latest revision as of 23:32, 3 February 2026

Radio Calafou ?

A FM and stream radio based in Calafou that broadcast very locally on 107 Mhz and on http://essun.calafou.org:8000/radiocalafou.ogg (you can't listen to it from outside calafou, local network)

Global set-up

The PiBox read the stream that comes from Libretime and play it to the transmitter

What can we do with it ?

Libretime

https://libretime.org/guides Threw Media Builder

  • Possible to add any type of audio file, the library already include all the files that are stored in ftp://omnius.calafou/MEDIATECA/0_audio/music/ and create a playlist
  • Possible to create a smart playlist that randomly include files from the library in function of criterias (genre, album name, langage, BPM, last played, year, ...)
  • Possible to create a webstream program from any type of stream (.mp3, .ogg, .opus, ...)

Threw Calendar

  • Possible to create a show that can be repeated in different manner and can be filled with playlist, smart playlist or webstream
  • Possible to set up a live show where someone can broadcast from her home sending a stream to a specific mountpoint

Threw Master Source

  • Possible to take the control of the direct broadcast with a specific mountpoint

Icecast

PiBox

  • Possible to play sounds located in the Pi, to play a stream, to play the live input of the sound card
  • Possible to listen to a sonification on the output of the integrated soundcard
  • Possible to shout in the radio threw a microphone plugged into the input of the external soundcar

How To use Radio Calafou


SmartPhone journalism

It is possible to use Airtime with a smartphone, see http://sourcefabric.booktype.pro/airtime-25-for-broadcasters/smartphone-journalism/

SmartPhone streaming applications

Taking the control live with a smartphone

As mentionned, it is possible to take the control of the radio with a specific mountpoint (the master source mountpoint), it is also possible with an (android) smartphone with the application "Broadcast Myself" (see before) that allow one to stream the mic of the smartphone or files

The settings > Output settings :

  • Hostname : radio.calafou.org
  • Port : 8001
  • Path : /master
  • Username : master
  • Password : master
  • MP3 Encoder Bitrate (as you wish) : 96 Kbit/s

Re-stream the output of airtime on another server

In theory, you can set up several output to an icecast server with Airtime Settings, in practive, it doesn't alway work, so you can also do :

avconv -i http://radio.calafou:8000/airtime_128.ogg -f ogg -|oggfwd -p -d "Hack The Earth" -g "Ecochonies" -u "https://calafoorg/ca/content/hack-earth-2017" labomedia.org 8000 ****** /hacktheearth.ogg

Hardware installation

  • Omnius server is in the hacklab
  • Pibox and the transmiter is in anarchaserver
  • The antenna is on the roof of anarchaserver

Software installation

Icecast2 with ssl support

test if your version of icecast has ssl support

 ldd /usr/bin/icecast2 | grep ssl

si

 libssl.so.3 => /lib/x86_64-linux-gnu/libssl.so.3 (0x00007f10a2cc9000)

so ok

Install last version of icecast from Xiph repo

 nano /etc/apt/sources.list.d/icecast.list

add

 deb http://download.opensuse.org/repositories/multimedia:/xiph/Debian_12/ ./

get the key

 wget -qO - https://build.opensuse.org/projects/multimedia:xiph/signing_keys/download?kind=gpg | sudo apt-key add -
 apt update
 sudo apt-get install -t Debian_12 icecast2

Add a script to create a bundle certificate while certbot renew it

 nano /etc/letsencrypt/renewal/calafou.org-0002.conf

add

 post_hook = cat /etc/letsencrypt/live/calafou.org-0002/fullchain.pem /etc/letsencrypt/live/calafou.org-0002/privkey.pem > /etc/icecast2/bundle.pem && systemctl restart icecast2

And don't forget to change to put ENABLE=true :

 nano /etc/default/icecast2
 # Edit /etc/icecast2/icecast.xml and change at least the passwords.
 # Change this to true when done to enable the init.d script
 ENABLE=true

see https://tech-docs.thisispurefm.com/docs/tech-team/transmission/installing-icecast.html

Liquidsoap

Install liquidsoap via opam

 opam update
 opam upgrade
 eval $(opam env)
 opam info liquidsoap
 sudo apt-get install libpcre3=2:8.39-15
 sudo apt-get install libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev libcurl4-gnutls-dev libogg-dev libopus-dev libpcre3-dev libswresample-dev libswscale-dev
 opam install ffmpeg taglib mad lame vorbis opus cry samplerate liquidsoap

See https://opam.ocaml.org/doc/Install.html and https://www.liquidsoap.info/doc-2.4.2/build.html

Script to stream a random audio file from Mediateca

 #!/usr/bin/liquidsoap
 
 mount       = "mediateca.mp3"
 genre       = "random"
 description = "toda la musica de la mediateca en random."
 name        = "Mediateca Random"
 #protocol    = "http"
 port        = 8000
 password    = "*****"
 host        = "localhost"
 url         = "https://radio.calafou.org/"
 #encoding    = "UTF-8"
 
 dir = "/mnt/3t/ftp/MEDIATECA/musica/"
 
 set("log.file.path", "/home/b01/liquidsoap-daemon/scripts/randommediateca.log")
 
 dir = nrj(playlist(mode='randomize',reload=10,reload_mode="rounds",dir))
 
 # A function applied to each metadata chunk
 def append_title(m) =
 title = m["title"]
 album = m["album"]
 date  = m["date"] 
 [("title","#{title} : #{album} (#{date})")]
 end
 dir = map_metadata(append_title, dir)
 radio = mksafe(dir)
 #radio = crossfade(radio)
 
 # Output the full stream in MP3
 output.icecast(%mp3(bitrate=256), 
 host=host,
 port=port,
 password=password,
 mount=mount,
 radio,
 url=url,
 name=name,
 description=description,
 genre=genre)

Daemonize the script

 git clone https://github.com/savonet/liquidsoap-daemon

Put the script in a scripts folder

 cd liquidsoap-daemon/
 ./daemonize-liquidsoap.sh ~/liquidsoap-daemon/scripts/randomplaylistmediateca.liq

Libretime via Docker

 nano docker-compose.yml


PiBox

See documentation here : http://p-node.org/doc/index.php/V-2

For the moment (see troubleshouting), 2 script are launched by /etc/rc.local :

/home/pi/omnioussonification.sh 2> /home/pi/streamlog.txt >/dev/null &
/home/pi/airtimeplayer.sh 2> /home/pi/streamlog.txt >/dev/null &

omnioussonification.sh :

#!/bin/bash
while true;do
 AUDIODEV=hw:0,0 play -t ogg http://radio.calafou:8000/omniussonification.ogg
 sleep 3
done

airtimeplayer.sh

#!/bin/bash
while true;do
 AUDIODEV=hw:1,0 play -t ogg http://radio.calafou:8000/airtime_128.ogg
 sleep 3
done

Troubleshouting

Libretime

Libretime doesn't seems to play sound, show the media builder or eat new sounds

The 3 magic command to restart everything (you have to be logged in omnius :

sudo service airtime-media-monitor restart
sudo service airtime-liquidsoap stop
sudo service airtime-liquidsoap start
/!\ it appears that 'restart' doesn't work, liquidsoap doesn't take the modifications made in System > Streams
sudo service airtime-playout restart

also, see the logs in /var/log/airtime/

Libretime doesn't take into account the modifications made in System > Streams

Relaunching liquidsoap seems necessary :

sudo service airtime-liquidsoap stop
sudo service airtime-liquidsoap start

Test a stream configuration

liquidsoap 'output.icecast(%vorbis, host = "radio.calafou", port = 8000, user = "source" password = "hackme", mount = "liq.ogg", sine())'

Airtime doesn't alway wait for the end of the track

Don't know why ...

The master mount point 8001 can't be reached when Libretime is inside a LXC container

add these iptables rules (the container ip is 192.168.122.11):

iptables -I FORWARD -p tcp -d 192.168.122.11 --dport 8001 -j ACCEPT
iptables -A INPUT -p tcp --dport 8001 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp --dport 8001 -j DNAT --to-destination 192.168.122.11:8001


Antenna

The tube on which I was planning to fix the antenna is about to fall !

So I used instead a solid metal piece fixed to the wall, but the antenna is only fixed in one point with plastic bracelets (colson) and 2 wires fixed to 2 solid metal points

I'm not sure it is really good on a long time perspective ...

Audio sources - web radios