Howto: Install Airtime on a Raspberry Pi 3!
  • Why? Because you can!

    The open source version of Airtime is not much different from the Pro version except that it has a key feature that the Pro version doesn’t: the ability to be able to record and replay a show.

    We needed this feature but unfortunately because the Airtime open source project has gone a bit stale it means that setting up and maintaining Airtime on a server is a bit of a pain, and it requires old versions of Debian or Ubuntu so you can’t use your server for much else. 

    Fortunately it is possible to get it working on a Pi 3 without too much difficulty which means that you can have your own Airtime instance running on a $40 box.   It runs really well (and is completely silent) - CPU usage hardly ever goes much above 30%.

    Here’s my install notes. Hopefully it is useful for someone!


    1. Download Raspberian Jessie Lite 


    2. Unzip and copy to SD card

    Notes on using DD here:
    https://www.raspberrypi.org/documentation/installation/installing-images/linux.md

    E.g. in my case
    umount /dev/mmcblk0p2
    sudo dd bs=4M if=2016-05-27-raspbian-jessie-lite.img of=/dev/mmcblk0
    sync


    3. Expand the partition

    Boot the Pi and login (pi / raspberry)
    Run
    sudo raspi-config


    4. Set up the RTC clock

    If you have one. It might be a good idea for a radio station to have good time, but if you are networked it may not matter too much.

    This is for the common DS3231 RTC module
    Run: sudo raspi-config
    Go to advanced settings
    Find and enable I2C
    Follow all but the first instruction here (the blacklist entry isn’t an issue anymore). The relevant steps have been copied and pasted below https://nicegear.co.nz/blog/using-an-i2c-real-time-clock-rtc-with-a-raspberry-pi/

    # Load the module now
    sudo modprobe i2c-bcm2708

    # Notify Linux of the Dallas RTC device
    echo ds1307 0x68 | sudo tee /sys/class/i2c-adapter/i2c-1/new_device

    # Test whether Linux can see our RTC module.
    sudo hwclock


    That's it! You can also add the i2c initialisation command to rc.local which means it will be run at every boot up;

    # Add the RTC device on boot
    sudo sed -i 's#^exit 0$#echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device#' /etc/rc.local
    echo exit 0 | sudo tee -a /etc/rc.local


    This doesn't cover automatically setting the clock on boot and but you can do so by adding another line (above exit 0) to rc.local with;
    hwclock -s


    5. Install Airtime

    The “easy” installer appears to only work on x86 chipsets, and the 2.5.2 installer is completely broken. So we installed using the 2.5.1 source...

    Update your system first:
    sudo apt-get update
    sudo apt-get upgrade

    (might be wise to reboot at this point to load kernel updates, etc)

    Download and extract the source:
    wget https://github.com/sourcefabric/Airtime/archive/airtime-2.5.1-ga.tar.gz
    tar -xvzf airtime-2.5.1-ga.tar.gz -C ~/


    We'll run the install script but first we need to make some edits:

    In ~/airtime-airtime-2.5.1-ga/install_full/ubuntu/airtime-full-install
    Comment out the lines at about line 49:
    #if [ "$returncode" != "0" ]; then
    # echo "deb http://apt.sourcefabric.org/ $codename main" >> /etc/apt/sources.list
    #fi



    Change line 72 from
    if [ "$dist" = "Debian" ]; then
    to
    if [ "$dist" = "Raspbian" ]; then

    Change line 136 from
    if [ "$dist" = "Ubuntu" -a "$code" = "saucy" ]; then
    to
    if [ "$dist" = "Raspbian" ]; then

    Then run
    sudo ~/airtime-airtime-2.5.1-ga/install_full/debian/airtime-full-install

    Follow the prompts for icecast, etc. If all is good you should now have a running version of Airtime and be able to browse to the Pi's address and log in with admin (password admin)


    6. Change the recording source

    By default airtime uses ecasound to record from the default soundcard. This means that we can’t record streams from other sources. A simple fix is to edit
    /usr/lib/airtime/pypo/bin/recorder.py (around line 91) with :

    # command = "ecasound -f:%s,%s,%s -i alsa -o %s,%s000 -t:%s" % \
    # (ss, c, sr, filepath, br, length)
    command = "/usr/bin/sox -t ogg http://localhost:8000/airtime.ogg -C6 %s trim 0 %s" % \
    (filepath, length)


    You will need to recompile the python script:
    cd /usr/lib/airtime/pypo/bin/
    sudo rm recorder.pyc
    sudo python
    import recorder.py

    Ctrl-d to quit (there may be some messages about missing files. Ignore)

    Reboot and then install sox

    sudo apt-get install sox
    sudo apt-get install libsox-fmt-all


    So now if you set a show to record from line in it will actually record anything that is coming in on the master source. If you do want to record from a sound card as well you can set up something like this:

    /etc/init/icecastsource.conf:
    description "Pipe soundcard input to icecast"

    start on runlevel [2345]
    stop on runlevel [!2345]

    respawn

    exec /usr/bin/sox -q -r 44100 -t alsa plughw:0,0 -t ogg -C6 - | /usr/bin/oggfwd -p -n "Studio" localhost 8000 hackme /master
    post-stop exec sleep 10


    (you will need to install oggfwd sudo apt-get install oggfwd)


    7. Apply some updates

    If you come across any bugs or issues you may want to check on code updates since 2.5.1. We had an issue when setting shows up to rebroadcast that was fixed downstream
    Replaced
    /usr/share/airtime/application/forms/AddShowWhen.php
    With the version from Git
    https://github.com/sourcefabric/airtime/blob/2cdad4932afd095322fe72fd7ac340495452782c/airtime_mvc/application/forms/AddShowWhen.php
    Post edited by D'man Ddan at 2016-08-28 03:33:14
  • 46 Comments sorted by
  • Charles sorry you are having problems still.  Attached is a copy of my edited install script - it is possible I missed something out in the description above.  You may need to start again with a fresh install and then copy this file over 

    ~/airtime-airtime-2.5.1-ga/install_full/ubuntu/airtime-f
    ull-install

    (my install is very definitely running on raspberian jessie, and using jessie sources ;-)

    If you still have problems I'll look at creating a disk image - although that may take me a while...






  • Yo! You should team up with Robbt to make a 3.0/SaaS-branch install script for the Pi3 and vanilla Wheezy boxen
  • Could it works with Raspi 2?
    Thanks !
  • Could load an install script I suppose.  I was wondering about putting up a disk image somewhere....

    The Raspi 2 might be a little under powered. It should install though.  Give it a try!
  • When I do the install in step #5, I'm told it can;t find the armhf package. How to fix this?

    Chuck
  • To help anyone who might be able to solve this, here's what I am getting:

    W: GPG error: http://apt.sourcefabric.org jessie InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0888FE5B174C1854
    W: Failed to fetch http://apt.sourcefabric.org/dists/jessie/main/binary-armhf/Packages  404  Not Found [IP: 144.76.185.238 80]

    E: Some index files failed to download. They have been ignored, or old ones used instead.



    Chuck
  • It looks like you've added the sourcefabric apt repository accidentally to your sources.

    Did you edit  ~/airtime-airtime-2.5.1-ga/install_full/ubuntu/airtime-full-install
    and comment out these lines at about line 49?:
    #if [ "$returncode" != "0" ]; then
    # echo "deb http://apt.sourcefabric.org/ $codename main" >> /etc/apt/sources.list
    #fi

    If not you will need to remove the sourcefabric entries from /etc/apt/sources.list, comment out the lines in the install script and try again 
  • Dan - 
    You mostly solved it. Reason: when I edited sudo ~/airtime-airtime-2.5.1-ga/install_full/debian/airtime-full-install , the changes were rejected without botification. When I realized that, I used nano instead and made the changes.

    But after many minutes of installation I still get the following error:

    Building dependency tree...
    Reading state information...
    E: Unable to locate package sourcefabric-keyring
    pi@raspberrypi:~ $ Reading state information...
    -bash: Reading: command not found
    pi@raspberrypi:~ $ E: Unable to locate package sourcefabric-keyring
    -bash: E:: command not found
    pi@raspberrypi:~ $ Reading state information...
    -bash: Reading: command not found
    pi@raspberrypi:~ $ E: Unable to locate package sourcefabric-keyring
    -bash: E:: command not found
    pi@raspberrypi:~ $ Reading state information...
    -bash: Reading: command not found
    pi@raspberrypi:~ $ E: Unable to locate package sourcefabric-keyring
    -bash: E:: command not found
    pi@raspberrypi:~ $ pi@raspberrypi:~ $ Reading state information...
    -bash: pi@raspberrypi:~: command not found
    pi@raspberrypi:~ $ -bash: Reading: command not found
    -bash: -bash:: command not found
    pi@raspberrypi:~ $ pi@raspberrypi:~ $ E: Unable to locate package sourcefabric-keyring
    -bash: pi@raspberrypi:~: command not found
    pi@raspberrypi:~ $ -bash: E:: command not found
    -bash: -bash:: command not found
    pi@raspberrypi:~ $ pi@raspberrypi:~ $ Reading state information...
    -bash: pi@raspberrypi:~: command not found
    pi@raspberrypi:~ $ -bash: Reading: command not found
    -bash: -bash:: command not found
    pi@raspberrypi:~ $ pi@raspberrypi:~ $ E: Unable to locate package sourcefabric-keyring
    -bash: pi@raspberrypi:~: command not found
    pi@raspberrypi:~ $ -bash: E:: command not found
    -bash: -bash:: command not found

    Chuck


  • FWIW: 

    An apt-get install sourcefabric-keyring also results in "Unable to locate package sourcefabric-keyring".

    Chuck
  • How'd I miss this!

    Airtime is NOT compatible with Jessie so the OP starts with the wrong distro altogether :-B

    Gotta go with Wheezy at best.

    Sorry y'all...
  • Roger - 

    So what all needs to change?

    Chuck
  • This might be the latest Wheezy Raspbian out there but honestly the 2.5.x code is so old and unsupported -- what's the point?  :(
  • 2.5.x is not supported? Surely 2.5.2 is supported.

    And if 2.5.1 is the only choice, I'll take it,

    So what has to be done to correct the keyring problem?

    And is there interest in making 2.5.2 run on the Pi 3? I would hope so!


    Chuck
  • Post edited by Roger Wilco at 2016-09-11 21:17:20
  • Great, but that post is entirely philosophical. There's no conclusion. There's no mention of support for the Pi.

    Again, can anyone tell me how to solve the keyring problem?

    Chuck
  • Maybe a distro that works? Although none are truly supported right now. Insisting to the contrary is going to result in you wasting days if not weeks of free time trying to jam square pegs into round holes.
  • Charles I still think your problem is that you have the sourcefabric repo in /etc/sources.list - (it would have been added when you tried to run the unmodified script).  Try editing that file - removing any lines with sourcefabric in them then doing a
    sudo apt-get update
      
    Roger I don't think it is a waste of time - it took a little bit fiddling but it was fun to tinker and now it is working sweetly we can forget about it and concentrate on making good radio.  It doesn't matter that it is old and unsupported - it works.    It is running on Jessie (see below).

    If there us enough interest I'll look loading up a disk image. 

    AIRTIME_SERVER_RESPONDING      = OK
    KERNEL_VERSION                 = 4.4.13-v7+
    MACHINE_ARCHITECTURE           = armv7l
    TOTAL_MEMORY_MBYTES            = 947748
    TOTAL_SWAP_MBYTES              = 102396
    AIRTIME_VERSION                = 2.5.1
    OS                             = Raspbian GNU/Linux 8.0 (jessie) armv7l
    CPU                            = ARMv7 Processor rev 4 (v7l)
    WEB_SERVER                     = Apache/2.4.10 (Raspbian)
    PLAYOUT_ENGINE_PROCESS_ID      = 528
    PLAYOUT_ENGINE_RUNNING_SECONDS = 48533
    PLAYOUT_ENGINE_MEM_PERC        = 1.8%
    PLAYOUT_ENGINE_CPU_PERC        = 0.0%
    LIQUIDSOAP_PROCESS_ID          = 1127
    LIQUIDSOAP_RUNNING_SECONDS     = 48519
    LIQUIDSOAP_MEM_PERC            = 7.7%
    LIQUIDSOAP_CPU_PERC            = 6.9%
    MEDIA_MONITOR_PROCESS_ID       = 537
    MEDIA_MONITOR_RUNNING_SECONDS  = 48533
    MEDIA_MONITOR_MEM_PERC         = 1.8%
    MEDIA_MONITOR_CPU_PERC         = 0.0%
    -- Your installation of Airtime looks OK!

  • Dan:

    After all my playing around, I had done a fresh load of Noobs. The /etc/apt/sources.list (note my path - it doesn't match yours) has only 3 lines and no mention of sourcefabric.

    I still have the same keyring error.

    Chuck

  • Wheezy is the end of the road for now.
  • Dan:

    I did notice in sources.list that the first line points to a jessie folder for non-free. Should it be wheezy?
    I assume this has nothing to do with the keyring issue.

    Chuck
  • Jessie won't work d00d :-B
  • With the lack of any specific advice, I changed the first line of sources.list to say "wheezy" instead of "jessie".

    Unfortunately, that didn't get me to the finish line. Here's what I got:

    lame is
    already the newest version.



    lame set to
    manually installed.



    Some
    packages could not be installed. This may mean that you have



    requested an
    impossible situation or if you are using the unstable



    distribution
    that some required packages have not yet been created



    or been
    moved out of Incoming.



    The
    following information may help to resolve the situation:



     



    The
    following packages have unmet dependencies:



     libmp3lame-dev : Depends: libmp3lame0 (=
    3.99.5+repack1-3+deb7u1) but 3.99.5+repack1-7+deb8u1 is to be installed



    E: Unable to
    correct problems, you have held broken packages.



    pi@raspberrypi:~
    $ lame is already the newest version.



    lame: excess
    arg the



    pi@raspberrypi:~
    $ lame set to manually installed.



    lame: excess
    arg manually



    pi@raspberrypi:~
    $ Some packages could not be installed. This may mean that you have



    -bash: Some:
    command not found



    pi@raspberrypi:~
    $ requested an impossible situation or if you are using the unstable



    -bash:
    requested: command not found



    pi@raspberrypi:~
    $ distribution that some required packages have not yet been created



    -bash:
    distribution: command not found



    pi@raspberrypi:~
    $ or been moved out of Incoming.



    -bash: or:
    command not found



    pi@raspberrypi:~
    $ The following information may help to resolve the situation:



    -bash: The:
    command not found



    pi@raspberrypi:~
    $



    pi@raspberrypi:~
    $ The following packages have unmet dependencies:



    -bash: The:
    command not found



    pi@raspberrypi:~
    $  libmp3lame-dev : Depends: libmp3lame0
    (= 3.99.5+repack1-3+deb7u1) but 3.99.5+repack1-7+deb8u1 is to be installed



    -bash:
    syntax error near unexpected token `('



    pi@raspberrypi:~
    $ E: Unable to correct problems, you have held broken packages.-bash: E::
    command not found


    So - can anyone offer specific advice to make this work?


    Chuck

  • TRASH YOUR JESSIE INSTALL AND INSTALL WHEEZY INSTEAD
    Post edited by Roger Wilco at 2016-09-12 21:32:37
  • As usual, your advice is not specific.
    As written above, I changed "sources.list" to say "wheezy" rather than "jessie".
    Are you saying I must revert to wheezy load in entirety?

    Chuck
  • GTFOH man =))

  • Post edited by Roger Wilco at 2016-09-12 22:10:54
  • Still waiting for specific advice, Roger.
    While you have (assumedly) much knowledge, you don't express it in a way that helps those who know less.

    Chuck

  • just install ubuntu mate it install the server version and trust me you can just follow the auto install. I have this for more than a year now and no problems on RPI2

    over he last 6 months I have been running on RPI 3 and its smooth

    just make sure your power supply is 2.5 -3.0 amp  and you never have an issue  

    https://ubuntu-mate.org/raspberry-pi/

    full use of the ubuntu repository +

    Post edited by Voisses Tech at 2016-09-13 13:06:24
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • Dan:

    I've reloaded an image several times. I'm using a jessie lite image (since your artucle points to it) but you and Roger keep mentioning "jessie" instead of "jessie lite". Does it matter?

    BTW, I've never been able to get the RTC to work. I enable i2c in raspi-config and do the two steps you wrote. But when I do a sudo hwclock, I get:

    pi@raspberrypi:~
    $ sudo hwclock



    hwclock:
    Cannot access the Hardware Clock via any known method.



    hwclock: Use
    the --debug option to see the details of our search for an access method.



    pi@raspberrypi:~ $

    Chuck
  • One more thing: I mentioned above that sources.list points to jessie, not wheezy. I've been changing that, but I'd love to see you say that's correct.

    Chuck
  • And another thing:

    You have us editing In ~/airtime-airtime-2.5.1-ga/install_full/ubuntu/airtime-full-install

    Yet the following line references the debian folder:

    Then run
    sudo ~/airtime-airtime-2.5.1-ga/install_full/debian/airtime-full-install 

    Until recently, I've been editing the ubuntu file but running your line above. Today I tried to edit the ubunto version and run the ubunto version. No luck. 

    Next step: edit debian and run debian?

    Chuck
  • Dan - 

    Re the RTC comment above: I took your article to mean an RTC was incorporated into the Pi 3, since there was no mention of needing external hardware.
    I see that is not the case.
    Could you add a few words for clarity? Otherwise, people will assume the mentioned HW is part of the baseline.

    Chuck
  • Summarty of issues:

    (1) the instructions above say to edit ~/airtime-airtime-2.5.1-ga/install_full/ubuntu/airtime-full-install yet later say to run sudo ~/airtime-airtime-2.5.1-ga/install_full/debian/airtime-full-install. Note the edit is in the ununtu directory and the run is in the debian folder.

    (2) Dan's instructions above say to install Jessie yet Roger's 12 Sep post says to install Wheezy.

    (3) Due to the above, it's unclear what folders sources.list should point to. Roger seems to think the distributed file is wrong.

    I'd really love to get this working.
    Is there anyone out there who has actually tried to use the instructions above, found the problems, and gotten it running?

    Chuck

  • Dearest Mister Hutton sir,

    Debian 8 as an underlying OS will not work. Changing your source calls won't help you here at all. You need to use a fresh Wheezy/7 format/reinstall. Here's your image for that --


    God speed
  • The image above won't boot on my Pi3, using the same tools I've used to write many images to SD cards. Anything else to try?
  • Roger:

    The image you pointed me to will boot on a Pi 2, but not a Pi 3. As this is a Pi 3 exercise, I can't make any progress using your link.

    Chuck


  • The Pi3 likely has a chipset or something that relies on 8, so your final answer is to either get a Pi2 or give up until a proper Jessie release happens.
  • I'm giving up, as apparently (in spite of the title of the article) it isn't possible to run Airtime on a Pi 3.

    Chuck
  • Dear D'man Ddan, Congratulations for the tutorial.
    I did the procedure and get the following log:
    Access to the web system is ok, but I can not write any program or User. Would you help me?

    21K
  • Debian 7 is the end of the road for now
  • Where i go now? 
    Install on Debian 8?
  • Thanks for the recipe!
    It definitely works, whatever Mr. Wilco's strong beliefs are...

    One additional thing I had to change to get rid of "Unable to locate package sourcefabric-keyring":
    In the install script  at ~/airtime-airtime-2.5.1-ga/install_full/ubuntu/airtime-full-install comment out line 98 like that:
    #apt-get -y --force-yes install sourcefabric-keyring


    cheers, -m

  • I can confirm I have Airtime 2.5.1 up and running on my RP2 with Jessie Lite

    Thanks everyone for their help.
  • locks up sometimes on my RP2  " source need to catchup" sometimes even give dead audio but great with mate
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • locks up sometimes on my RP2  " source need to catchup" sometimes even give dead audio but great with mate
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • Charles sorry you are having problems still.  Attached is a copy of my edited install script - it is possible I missed something out in the description above.  You may need to start again with a fresh install and then copy this file over 

    ~/airtime-airtime-2.5.1-ga/install_full/ubuntu/airtime-f
    ull-install

    (my install is very definitely running on raspberian jessie, and using jessie sources ;-)

    If you still have problems I'll look at creating a disk image - although that may take me a while...
    I can confirm I was able to install Airtime 2.5.1 on my RP3 with Jessie (not lite)

    I had to download "airtime-full-install" posted in the quoted comment and replace the one that can be found in this folder:

    ~/airtime-airtime-2.5.1-ga/install_full/ubuntu/

    Thanks!