Azuracast: Error creating a radio station after port 8500

Created on 7 Apr 2019  路  54Comments  路  Source: AzuraCast/AzuraCast

Installation method
Bare-metal - Ubuntu 16.04,

Hi, I'm running Azuracast on a dedicated server. I have currently created 50 radio stations on this server. Everything works fine and the server resources are correct, without overloads.

When I try to create one more radio station, audio is no longer broadcast if it is somewhere in the administrator, as well as in the front-end. Also the public url and Icecast admin page is returning 404.

If I add an audio to the playlist by default, the front-end is indicating that the audio is playing. But if I try to transmit from a live encoder, the encoder indicates the state "conecting ..." all the time, without being able to connect to the server.

It seems that the front-end is created but it seems that the icecast server files are not created (?). The port of this radio station is 8500-8505. I must say that when trying to create any other radio station, from port 8500, the problem is the same.

Any help, please?

error

Most helpful comment

Thanks @tonimad @SlvrEagle23 @Vaalyn 馃

All 54 comments

Hey, can you check if there are any errors in the IceCast, Liquidsoap or Application logs?

Hi @Vaalyn

Thank you for your menssage. I paste the logs here:

**** Liquidsoap Log:
2019/04/08 11:51:19 >>> LOG START
2019/04/08 11:51:19 [main:3] Liquidsoap 1.3.6
2019/04/08 11:51:19 [main:3] Using: bytes=[distributed with OCaml 4.02 or above] pcre=7.4.1 dtools=0.4.1 duppy=0.8.0 cry=0.6.0 mm=0.4.0 ogg=0.5.2 vorbis=0.7.1 opus=0.1.2 mad=0.4.5 flac=0.1.4 flac.ogg=0.1.4 dynlink=[distributed with Ocaml] lame=0.3.3 fdkaac=0.2.1 taglib=0.3.3 ssl=0.5.7 camomile=1.0.1 faad=0.4.0
2019/04/08 11:51:19 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz master.
2019/04/08 11:51:19 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples.
2019/04/08 11:51:19 [frame:3] Targetting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks.
2019/04/08 11:51:19 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks.
2019/04/08 11:51:19 [threads:3] Created thread "generic queue #1".
2019/04/08 11:51:19 [threads:3] Created thread "generic queue #2".
2019/04/08 11:51:19 [threads:3] Created thread "non-blocking queue #1".
2019/04/08 11:51:19 [threads:3] Created thread "non-blocking queue #2".
2019/04/08 11:51:19 [harbor:3] Adding mountpoint '/' on port 8505
2019/04/08 11:51:19 [playlist_default(dot)m3u:3] Loading playlist...
2019/04/08 11:51:19 [playlist_default(dot)m3u:3] No mime type specified, trying autodetection.
2019/04/08 11:51:19 [playlist_default(dot)m3u:3] Playlist treated as format application/x-mpegURL
2019/04/08 11:51:19 [playlist_default(dot)m3u:3] Successfully loaded a playlist of 0 tracks.
2019/04/08 11:51:19 [radio_demo_local_1:3] Connecting mount /radio.mp3 for [email protected]...
2019/04/08 11:51:20 [lang:3] AzuraCast Raw Response: /var/azuracast/www/resources/error.mp3
2019/04/08 11:51:20 [decoder:3] Method "MAD" accepted "/var/azuracast/www/resources/error.mp3".
2019/04/08 11:51:20 [radio_demo_local_1:3] Connection setup was successful.
2019/04/08 11:51:20 [threads:3] Created thread "wallclock_main" (1 total).
2019/04/08 11:51:20 [clock.wallclock_main:3] Streaming loop starts, synchronized with wallclock.
2019/04/08 11:51:20 [radio_demo_live_switch:3] Switch to radio_demo_playlist_fallback.
2019/04/08 11:51:20 [radio_demo_playlist_fallback:3] Switch to blank_6423.
2019/04/08 11:51:20 [radio_demo_next_song:3] Prepared "/var/azuracast/www/resources/error.mp3" (RID 1).
2019/04/08 11:51:20 [radio_demo_playlist_fallback:3] Switch to radio_demo_cue_cut with transition.
2019/04/08 11:51:20 [dummy:3] Source failed (no more tracks) stopping output...
2019/04/08 11:51:56 [lang:3] AzuraCast Raw Response: /var/azuracast/www/resources/error.mp3
2019/04/08 11:51:56 [decoder:3] Method "MAD" accepted "/var/azuracast/www/resources/error.mp3".
2019/04/08 11:52:06 [radio_demo_next_song:3] Finished with "/var/azuracast/www/resources/error.mp3".
2019/04/08 11:52:06 [radio_demo_next_song:3] Prepared "/var/azuracast/www/resources/error.mp3" (RID 2).
2019/04/08 11:52:42 [lang:3] AzuraCast Raw Response: /var/azuracast/www/resources/error.mp3
2019/04/08 11:52:42 [decoder:3] Method "MAD" accepted "/var/azuracast/www/resources/error.mp3".
2019/04/08 11:52:52 [radio_demo_next_song:3] Finished with "/var/azuracast/www/resources/error.mp3".
2019/04/08 11:52:52 [radio_demo_next_song:3] Prepared "/var/azuracast/www/resources/error.mp3" (RID 3).
2019/04/08 11:53:28 [lang:3] AzuraCast Raw Response: /var/azuracast/www/resources/error.mp3
2019/04/08 11:53:28 [decoder:3] Method "MAD" accepted "/var/azuracast/www/resources/error.mp3".
2019/04/08 11:53:38 [radio_demo_next_song:3] Finished with "/var/azuracast/www/resources/error.mp3".
2019/04/08 11:53:38 [radio_demo_next_song:3] Prepared "/var/azuracast/www/resources/error.mp3" (RID 4).
2019/04/08 11:54:15 [lang:3] AzuraCast Raw Response: /var/azuracast/www/resources/error.mp3
2019/04/08 11:54:15 [decoder:3] Method "MAD" accepted "/var/azuracast/www/resources/error.mp3".
2019/04/08 11:54:25 [radio_demo_next_song:3] Finished with "/var/azuracast/www/resources/error.mp3".
2019/04/08 11:54:25 [radio_demo_next_song:3] Prepared "/var/azuracast/www/resources/error.mp3" (RID 5).
2019/04/08 11:55:01 [lang:3] AzuraCast Raw Response: /var/azuracast/www/resources/error.mp3
2019/04/08 11:55:01 [decoder:3] Method "MAD" accepted "/var/azuracast/www/resources/error.mp3".
2019/04/08 11:55:11 [radio_demo_next_song:3] Finished with "/var/azuracast/www/resources/error.mp3".
2019/04/08 11:55:11 [radio_demo_next_song:3] Prepared "/var/azuracast/www/resources/error.mp3" (RID 6).
2019/04/08 11:55:47 [lang:3] AzuraCast Raw Response: /var/azuracast/www/resources/error.mp3
2019/04/08 11:55:47 [decoder:3] Method "MAD" accepted "/var/azuracast/www/resources/error.mp3".
**** Liquidsoap Configuration
# WARNING! This file is automatically generated by AzuraCast.
# Do not update it directly!

set("init.daemon", false)
set("init.daemon.pidfile.path","/var/azuracast/stations/radio_demo/config/liquidsoap.pid")
set("log.stdout", true)
set("log.file", false)
set("server.telnet",true)
set("server.telnet.bind_addr","127.0.0.1")
set("server.telnet.port", 8504)
set("harbor.bind_addrs",["0.0.0.0"])

set("tag.encodings",["UTF-8","ISO-8859-1"])
set("encoder.encoder.export",["artist","title","album","song"])

# AutoDJ Next Song Script
def azuracast_next_song() =
  uri = list.hd(get_process_lines("/usr/bin/php /var/azuracast/www/bin/azuracast azuracast:internal:nextsong 70"), default="")
  log("AzuraCast Raw Response: #{uri}")

  if uri == "" or string.match(pattern="Error", uri) then
    log("AzuraCast Error: Delaying subsequent requests...")
    system("sleep 2")
    request.create("")
  else
    request.create(uri)
  end
end

# Fallback Playlists
playlist_default = audio_to_stereo(playlist(reload_mode="watch",mode="randomize","/var/azuracast/stations/radio_demo/playlists/playlist_default.m3u"))

# Standard Playlists
radio = random(weights=[3], [playlist_default]);

# Assemble final playback order
dynamic = audio_to_stereo(request.dynamic(id="radio_demo_next_song", timeout=20., azuracast_next_song))
dynamic = cue_cut(id="radio_demo_cue_cut", dynamic)
radio = fallback(id="radio_demo_playlist_fallback", track_sensitive = false, [dynamic, switch([ ({ true }, radio) ]), blank(duration=2.)])

# DJ Authentication
def dj_auth(user,password) =
  log("Authenticating DJ: #{user}")
  ret = list.hd(get_process_lines("/usr/bin/php /var/azuracast/www/bin/azuracast azuracast:internal:auth 70 --dj_user="^quote(user)^" --dj_password="^quote(password)^""), default="")
  log("AzuraCast DJ Auth Response: #{ret}")
  bool_of_string(ret)
end

live_enabled = ref false

def live_connected(header) =
  log("DJ Source connected! #{header}")
  live_enabled := true
  ret = list.hd(get_process_lines("/usr/bin/php /var/azuracast/www/bin/azuracast azuracast:internal:djon 70"), default="")
  log("AzuraCast Live Connected Response: #{ret}")
end

def live_disconnected() =
  log("DJ Source disconnected!")
  live_enabled := false
  ret = list.hd(get_process_lines("/usr/bin/php /var/azuracast/www/bin/azuracast azuracast:internal:djoff 70"), default="")
  log("AzuraCast Live Disconnected Response: #{ret}")
end

# A Pre-DJ source of radio that can be broadcasted if needed
radio_without_live = radio
ignore(radio_without_live)

# Live Broadcasting
live = audio_to_stereo(input.harbor("/", id="radio_demo_input_streamer", port=8505, user="shoutcast", auth=dj_auth, icy=true, max=30., buffer=5., icy_metadata_charset="UTF-8", metadata_charset="UTF-8", on_connect=live_connected, on_disconnect=live_disconnected))
ignore(output.dummy(live, fallible=true))
live = fallback(id="radio_demo_live_fallback", track_sensitive=false, [live, blank(duration=2.)])

radio = switch(id="radio_demo_live_switch", track_sensitive=false, [({!live_enabled}, live), ({true}, radio)])

# Allow for Telnet-driven insertion of custom metadata.
radio = server.insert_metadata(id="custom_metadata", radio)

# Apply amplification metadata (if supplied)
radio = amplify(1., radio)

radio = crossfade(start_next=3.,fade_out=2.,fade_in=2.,radio)

# Send metadata changes back to AzuraCast
def metadata_updated(m) =
  if (m["song_id"] != "") then
    ret = list.hd(get_process_lines("/usr/bin/php /var/azuracast/www/bin/azuracast azuracast:internal:feedback 70 --song="^quote(m["song_id"])^" --media="^quote(m["media_id"])^" --playlist="^quote(m["playlist_id"])^""), default="")
    log("AzuraCast Feedback Response: #{ret}")
  end
end

radio = on_metadata(metadata_updated,radio)

# Local Broadcasts
output.icecast(%mp3(samplerate=44100, stereo=true, bitrate=128, id3v2=true), id="radio_demo_local_1", host = "127.0.0.1", port = 8500, password = "2mf6XGxM", mount = "/radio.mp3", name = "Radio demo", description = "ads", genre = "Radio", url = "https://myradio.com", public = false, encoding = "UTF-8", radio)

# Remote Relays
**** Icecast Error Log
[2019-04-08  11:51:19] WARN xml/parsing warning: 
[2019-04-08  11:51:19] WARN xml/parsing unknown element "stream-genre" parsing "mount" at line 29
[2019-04-08  11:51:19] WARN connection/get_ssl_certificate Invalid cert file /etc/nginx/ssl/ssl.crt (system lib)
[2019-04-08  11:51:19] WARN slave/slave_startup process has 4096 max file descriptor limit
[2019-04-08  11:51:20] WARN source/source_set_intro Cannot open intro for /radio.mp3 "/usr/local/share/icecast/web//radio.mp3": No such file or directory

I'm checking that it is impossible to create a new radio station from port 8500. Maybe a limit on some component, or nginx.

If I now delete a radio station from those currently created on the server, and create a new radio station, the new radio station works correctly. However, the problem is when I try to create a new radio station from port 8500.

In reference to this [section of the tutorial:
https://github.com/AzuraCast/AzuraCast/blob/master/SUPPORT.md#bare-metal-4
My NGINX configuration looks like this:

    # Reverse proxy all possible radio listening ports (8000, 8010...8480, 8490)
    location ~ ^/radio/(8[0-4][0-9]0)(/?)(.*)$ {
        proxy_buffering           off;
        proxy_ignore_client_abort off;
        proxy_intercept_errors    on;
        proxy_next_upstream       error timeout invalid_header;
        proxy_redirect            off;
        proxy_connect_timeout     60;
        proxy_send_timeout        21600;
        proxy_read_timeout        21600;

        proxy_set_header Host localhost:$1;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;

        proxy_pass http://127.0.0.1:$1/$3?$args;
    }

    # Reverse proxy the Liquidsoap harbor inputs to allow for streaming.
    location ~ ^/radio/(8[0-4][0-9]5)(/?)(.*)$ {
        proxy_buffering           off;
        proxy_ignore_client_abort off;
        proxy_send_timeout        21600;
        proxy_read_timeout        21600;

        proxy_pass http://127.0.0.1:$1/;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
    }

I see this:

    # Reverse proxy all possible radio listening ports (8000, 8010...8480, 8490)
    location ~ ^/radio/(8[0-4][0-9]0)(/?)(.*)$ {

... 8490??? Maybe this is the limitation?

@akexparedo That's exactly what's causing your issue in this case.

By default, we don't expect that a single AzuraCast instance will be hosting more than 50 stations, because transcoding requirements would basically cause anything but a large dedicated server to run out of resources well before that point. We also don't want to expand the proxy range to extend past port 9000, because other applications share data on those ports and that data isn't meant to be exposed out to the web like the radio stations' signals are.

In your case, you can just manually update that nginx configuration file and it will expand the port range, but I'm not sure that we would ever officially support upwards of 50 stations per installation, given the likelihood that a vast majority of users would assume this means any server will support 50+ stations and would totally trash their servers approaching that limit.

Hi @SlvrEagle23 Thanks for your reply.

And in this case, what modification should I do?

location ~ ^/radio/(8[0-9][0-9]0)(/?)(.*)$ {

The above is correct, for example, to extend the range up to 8990?

@akexparedo Yep, it's just a regular expression.

Perfect, thanks again @SlvrEagle23

I'm testing Azuracast for a small group of clients. Being a test, I'm not monetizing this. However, before considering marketing with Azuracast, I would like to know if this is possible, since Azuracast is a free code project.

Currently I'm using Centovacast. But Centovacast is a system that is too old and very weak :(
I like to make modifications and improvements, but this is not possible with the Centovacast structure.

My question is the following;

1. Is it possible to offer Azuracast to my clients?
2. If possible, I would like to contribute financially. If I do not buy Centovacast licenses, but I install Azuracast to my clients, the most just and honest thing is that I have to pay Azuracast. Is there a system that you have considered for streaming providers, interested in using Azuracast?

And one last question, about this thread: If I want to expand the range of ports from 8000 to 9500, what is the regular expression that I should define in the previous line?

location ~ ^/radio/(8[0-9][0-9]0)(/?)(.*)$ {

@akexparedo You are absolutely free to offer AzuraCast to your clients and to use it commercially. We're licensed under the very permissive Apache license which fully allows commercial use, provided you don't co-opt the branding of our project itself (i.e. you can distribute AzuraCast and say it's AzuraCast, but you can't say _you are_ AzuraCast).

We're working on a plan to work directly with resellers who offer AzuraCast so that we can direct users to their web sites from our own documentation pages, but we haven't quite completed that yet.

In the meantime, we'd greatly appreciate any support you can provide us through our project's Patreon: https://www.patreon.com/AzuraCast

@SlvrEagle23

We're working on a plan to work directly with resellers who offer AzuraCast so that we can direct users to their web sites from our own documentation pages, but we haven't quite completed that yet.
In the meantime, we'd greatly appreciate any support you can provide us through our project's Patreon: https://www.patreon.com/AzuraCast

Oh! It's great news! Please, let me know if I can help (in any way) in your idea. Even if you need servers for anything. I am willing to collaborate!

Uhm! Sorry, @SlvrEagle23 , I forgot to raise the previous question:

If I want to expand the range of ports from 8000 to 9500, what is the regular expression that I should define in the previous line?

location ~ ^/radio/(8[0-9][0-9]0)(/?)(.*)$ {

@akexparedo Probably the easiest way to do it is something like:

location ~ ^/radio/(8[0-9][0-9]0|9[0-5][0-9]0)(/?)(.*)$ {

@SlvrEagle23 Thanks! We are in contact and I continue the project!

@SlvrEagle23 I made the change but the problem persists. I have changed the ranges in the two sections:

  • Reverse proxy
  • Reverse proxy the Liquidsoap
    # Reverse proxy all possible radio listening ports (8000, 8010...8480, 8490)
    location ~ ^/radio/(8[0-9][0-9]0|9[0-5][0-9]0)(/?)(.*)$ {
        proxy_buffering           off;
        proxy_ignore_client_abort off;
        proxy_intercept_errors    on;
        proxy_next_upstream       error timeout invalid_header;
        proxy_redirect            off;
        proxy_connect_timeout     60;
        proxy_send_timeout        21600;
        proxy_read_timeout        21600;

        proxy_set_header Host localhost:$1;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;

        proxy_pass http://127.0.0.1:$1/$3?$args;
    }

    # Reverse proxy the Liquidsoap harbor inputs to allow for streaming.
    location ~ ^/radio/(8[0-9][0-9]5|9[0-5][0-9]5)(/?)(.*)$ {
        proxy_buffering           off;
        proxy_ignore_client_abort off;
        proxy_send_timeout        21600;
        proxy_read_timeout        21600;

        proxy_pass http://127.0.0.1:$1/;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
    }

Then I have restarted the server. I have created a new radio station, which has automatically assigned port 8500, but the problem continues.

Do I have to do another step?

@akexparedo Are you getting any errors in the Liquidsoap/Icecast logs? There could be something else on the server sitting on port 8500 specifically.

Liquidsoap Log:

2019/04/09 09:33:58 >>> LOG START
2019/04/09 09:33:58 [main:3] Liquidsoap 1.3.6
2019/04/09 09:33:58 [main:3] Using: bytes=[distributed with OCaml 4.02 or above] pcre=7.4.1 dtools=0.4.1 duppy=0.8.0 cry=0.6.0 mm=0.4.0 ogg=0.5.2 vorbis=0.7.1 opus=0.1.2 mad=0.4.5 flac=0.1.4 flac.ogg=0.1.4 dynlink=[distributed with Ocaml] lame=0.3.3 fdkaac=0.2.1 taglib=0.3.3 ssl=0.5.7 camomile=1.0.1 faad=0.4.0
2019/04/09 09:33:58 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz master.
2019/04/09 09:33:58 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples.
2019/04/09 09:33:58 [frame:3] Targetting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks.
2019/04/09 09:33:58 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks.
2019/04/09 09:33:58 [threads:3] Created thread "generic queue #1".
2019/04/09 09:33:58 [threads:3] Created thread "generic queue #2".
2019/04/09 09:33:58 [threads:3] Created thread "non-blocking queue #1".
2019/04/09 09:33:58 [threads:3] Created thread "non-blocking queue #2".
2019/04/09 09:33:58 [harbor:3] Adding mountpoint '/' on port 8505
2019/04/09 09:33:58 [playlist_default(dot)m3u:3] Loading playlist...
2019/04/09 09:33:58 [playlist_default(dot)m3u:3] No mime type specified, trying autodetection.
2019/04/09 09:33:58 [playlist_default(dot)m3u:3] Playlist treated as format application/x-mpegURL
2019/04/09 09:33:58 [playlist_default(dot)m3u:3] Successfully loaded a playlist of 0 tracks.
2019/04/09 09:33:58 [radiodemo_local_1:3] Connecting mount /radio.mp3 for [email protected]...
2019/04/09 09:33:58 [lang:3] AzuraCast Raw Response: /var/azuracast/www/resources/error.mp3
2019/04/09 09:33:58 [decoder:3] Method "MAD" accepted "/var/azuracast/www/resources/error.mp3".
2019/04/09 09:33:58 [radiodemo_local_1:3] Connection setup was successful.
2019/04/09 09:33:58 [threads:3] Created thread "wallclock_main" (1 total).
2019/04/09 09:33:58 [clock.wallclock_main:3] Streaming loop starts, synchronized with wallclock.
2019/04/09 09:33:58 [radiodemo_live_switch:3] Switch to radiodemo_playlist_fallback.
2019/04/09 09:33:58 [radiodemo_playlist_fallback:3] Switch to blank_6423.
2019/04/09 09:33:58 [radiodemo_next_song:3] Prepared "/var/azuracast/www/resources/error.mp3" (RID 1).
2019/04/09 09:33:58 [radiodemo_playlist_fallback:3] Switch to radiodemo_cue_cut with transition.
2019/04/09 09:33:58 [dummy:3] Source failed (no more tracks) stopping output...
2019/04/09 09:34:34 [lang:3] AzuraCast Raw Response: /var/azuracast/www/resources/error.mp3
2019/04/09 09:34:34 [decoder:3] Method "MAD" accepted "/var/azuracast/www/resources/error.mp3".
2019/04/09 09:34:44 [radiodemo_next_song:3] Finished with "/var/azuracast/www/resources/error.mp3".
2019/04/09 09:34:44 [radiodemo_next_song:3] Prepared "/var/azuracast/www/resources/error.mp3" (RID 2).
2019/04/09 09:35:20 [lang:3] AzuraCast Raw Response: /var/azuracast/www/resources/error.mp3
2019/04/09 09:35:20 [decoder:3] Method "MAD" accepted "/var/azuracast/www/resources/error.mp3".
2019/04/09 09:35:31 [radiodemo_next_song:3] Finished with "/var/azuracast/www/resources/error.mp3".
2019/04/09 09:35:31 [radiodemo_next_song:3] Prepared "/var/azuracast/www/resources/error.mp3" (RID 3).

Liquidsoap configuration:

# WARNING! This file is automatically generated by AzuraCast.
# Do not update it directly!


set("init.daemon", false)
set("init.daemon.pidfile.path","/var/azuracast/stations/radiodemo/config/liquidsoap.pid")
set("log.stdout", true)
set("log.file", false)
set("server.telnet",true)
se
```t("server.telnet.bind_addr","127.0.0.1")
set("server.telnet.port", 8504)
set("harbor.bind_addrs",["0.0.0.0"])

set("tag.encodings",["UTF-8","ISO-8859-1"])
set("encoder.encoder.export",["artist","title","album","song"])

# AutoDJ Next Song Script
def azuracast_next_song() =
  uri = list.hd(get_process_lines("/usr/bin/php /var/azuracast/www/bin/azuracast azuracast:internal:nextsong 73"), default="")
  log("AzuraCast Raw Response: #{uri}")

  if uri == "" or string.match(pattern="Error", uri) then
    log("AzuraCast Error: Delaying subsequent requests...")
    system("sleep 2")
    request.create("")
  else
    request.create(uri)
  end
end

# Fallback Playlists
playlist_default = audio_to_stereo(playlist(reload_mode="watch",mode="randomize","/var/azuracast/stations/radiodemo/playlists/playlist_default.m3u"))

# Standard Playlists
radio = random(weights=[3], [playlist_default]);

# Assemble final playback order
dynamic = audio_to_stereo(request.dynamic(id="radiodemo_next_song", timeout=20., azuracast_next_song))
dynamic = cue_cut(id="radiodemo_cue_cut", dynamic)
radio = fallback(id="radiodemo_playlist_fallback", track_sensitive = false, [dynamic, switch([ ({ true }, radio) ]), blank(duration=2.)])

# DJ Authentication
def dj_auth(user,password) =
  log("Authenticating DJ: #{user}")
  ret = list.hd(get_process_lines("/usr/bin/php /var/azuracast/www/bin/azuracast azuracast:internal:auth 73 --dj_user="^quote(user)^" --dj_password="^quote(password)^""), default="")
  log("AzuraCast DJ Auth Response: #{ret}")
  bool_of_string(ret)
end

live_enabled = ref false

def live_connected(header) =
  log("DJ Source connected! #{header}")
  live_enabled := true
  ret = list.hd(get_process_lines("/usr/bin/php /var/azuracast/www/bin/azuracast azuracast:internal:djon 73"), default="")
  log("AzuraCast Live Connected Response: #{ret}")
end

def live_disconnected() =
  log("DJ Source disconnected!")
  live_enabled := false
  ret = list.hd(get_process_lines("/usr/bin/php /var/azuracast/www/bin/azuracast azuracast:internal:djoff 73"), default="")
  log("AzuraCast Live Disconnected Response: #{ret}")
end

# A Pre-DJ source of radio that can be broadcasted if needed
radio_without_live = radio
ignore(radio_without_live)

# Live Broadcasting
live = audio_to_stereo(input.harbor("/", id="radiodemo_input_streamer", port=8505, user="shoutcast", auth=dj_auth, icy=true, max=30., buffer=5., icy_metadata_charset="UTF-8", metadata_charset="UTF-8", on_connect=live_connected, on_disconnect=live_disconnected))
ignore(output.dummy(live, fallible=true))
live = fallback(id="radiodemo_live_fallback", track_sensitive=false, [live, blank(duration=2.)])

radio = switch(id="radiodemo_live_switch", track_sensitive=false, [({!live_enabled}, live), ({true}, radio)])

# Allow for Telnet-driven insertion of custom metadata.
radio = server.insert_metadata(id="custom_metadata", radio)

# Apply amplification metadata (if supplied)
radio = amplify(1., radio)

radio = crossfade(start_next=3.,fade_out=2.,fade_in=2.,radio)

# Send metadata changes back to AzuraCast
def metadata_updated(m) =
  if (m["song_id"] != "") then
    ret = list.hd(get_process_lines("/usr/bin/php /var/azuracast/www/bin/azuracast azuracast:internal:feedback 73 --song="^quote(m["song_id"])^" --media="^quote(m["media_id"])^" --playlist="^quote(m["playlist_id"])^""), default="")
    log("AzuraCast Feedback Response: #{ret}")
  end
end

radio = on_metadata(metadata_updated,radio)

# Local Broadcasts
output.icecast(%mp3(samplerate=44100, stereo=true, bitrate=128, id3v2=true), id="radiodemo_local_1", host = "127.0.0.1", port = 8500, password = "9kJe2zHQ", mount = "/radio.mp3", name = "Radio demo", description = "Demo radio description.", genre = "Pop", url = "https://www.radiodemo.com", public = false, encoding = "UTF-8", radio)

# Remote Relays

Icecast error log:

[2019-04-09  09:33:58] WARN xml/parsing warning: 
[2019-04-09  09:33:58] WARN xml/parsing unknown element "stream-genre" parsing "mount" at line 29
[2019-04-09  09:33:58] WARN connection/get_ssl_certificate Invalid cert file /etc/nginx/ssl/ssl.crt (system lib)
[2019-04-09  09:33:58] WARN slave/slave_startup process has 4096 max file descriptor limit
[2019-04-09  09:33:59] WARN source/source_set_intro Cannot open intro for /radio.mp3 "/usr/local/share/icecast/web//radio.mp3": No such file or directory

It is very curious. I can create any radio station below port 8500. And everything works fine. But above this port, nothing works.

I've even tried to change the port of this new radio station. I have established ports 8520, 8514, 8115 .. And nothing works.

@SlvrEagle23 I must add that only Azuracast is working on this server (Bare-metal)

@akexparedo What happens if, say, you manually assign the station to port 8510 or 8520?

@SlvrEagle23 These are the steps followed:

I create a new radio station: Demo Radio

  • Azuracast assigns the following ports to this radio station:
    ---- Broadcasting port: 8500
    ---- Dj/Streaming port: 8505
    ---- Internal request processing port: 8504
  • Result: The player does not play anything. If I try to access the Icecast admin page, the result is error 404. Similarly, if I try to access the url of my local stream (error 404).
Liquidsoap Log:
2019/04/10 06:52:03 >>> LOG START
2019/04/10 06:52:03 [main:3] Liquidsoap 1.3.6
2019/04/10 06:52:03 [main:3] Using: bytes=[distributed with OCaml 4.02 or above] pcre=7.4.1 dtools=0.4.1 duppy=0.8.0 cry=0.6.0 mm=0.4.0 ogg=0.5.2 vorbis=0.7.1 opus=0.1.2 mad=0.4.5 flac=0.1.4 flac.ogg=0.1.4 dynlink=[distributed with Ocaml] lame=0.3.3 fdkaac=0.2.1 taglib=0.3.3 ssl=0.5.7 camomile=1.0.1 faad=0.4.0
2019/04/10 06:52:03 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz master.
2019/04/10 06:52:03 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples.
2019/04/10 06:52:03 [frame:3] Targetting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks.
2019/04/10 06:52:03 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks.
2019/04/10 06:52:03 [threads:3] Created thread "generic queue #1".
2019/04/10 06:52:03 [threads:3] Created thread "generic queue #2".
2019/04/10 06:52:03 [threads:3] Created thread "non-blocking queue #1".
2019/04/10 06:52:03 [threads:3] Created thread "non-blocking queue #2".
2019/04/10 06:52:03 [harbor:3] Adding mountpoint '/' on port 8505
2019/04/10 06:52:03 [playlist_default(dot)m3u:3] Loading playlist...
2019/04/10 06:52:03 [playlist_default(dot)m3u:3] No mime type specified, trying autodetection.
2019/04/10 06:52:03 [playlist_default(dot)m3u:3] Playlist treated as format application/x-mpegURL
2019/04/10 06:52:03 [playlist_default(dot)m3u:3] Successfully loaded a playlist of 0 tracks.
2019/04/10 06:52:03 [demo_local_1:3] Connecting mount /radio.mp3 for [email protected]...
2019/04/10 06:52:03 [lang:3] AzuraCast Raw Response: /var/azuracast/www/resources/error.mp3
2019/04/10 06:52:03 [decoder:3] Method "MAD" accepted "/var/azuracast/www/resources/error.mp3".
2019/04/10 06:52:03 [demo_local_1:3] Connection setup was successful.
2019/04/10 06:52:03 [threads:3] Created thread "wallclock_main" (1 total).
2019/04/10 06:52:03 [clock.wallclock_main:3] Streaming loop starts, synchronized with wallclock.
2019/04/10 06:52:03 [demo_live_switch:3] Switch to demo_playlist_fallback.
2019/04/10 06:52:03 [demo_playlist_fallback:3] Switch to blank_6423.
2019/04/10 06:52:03 [demo_next_song:3] Prepared "/var/azuracast/www/resources/error.mp3" (RID 1).
2019/04/10 06:52:03 [demo_playlist_fallback:3] Switch to demo_cue_cut with transition.
2019/04/10 06:52:03 [dummy:3] Source failed (no more tracks) stopping output...
2019/04/10 06:52:39 [lang:3] AzuraCast Raw Response: /var/azuracast/www/resources/error.mp3
2019/04/10 06:52:39 [decoder:3] Method "MAD" accepted "/var/azuracast/www/resources/error.mp3".
2019/04/10 06:52:50 [demo_next_song:3] Finished with "/var/azuracast/www/resources/error.mp3".
2019/04/10 06:52:50 [demo_next_song:3] Prepared "/var/azuracast/www/resources/error.mp3" (RID 2).
2019/04/10 06:53:26 [lang:3] AzuraCast Raw Response: /var/azuracast/www/resources/error.mp3
2019/04/10 06:53:26 [decoder:3] Method "MAD" accepted "/var/azuracast/www/resources/error.mp3".
2019/04/10 06:53:36 [demo_next_song:3] Finished with "/var/azuracast/www/resources/error.mp3".
2019/04/10 06:53:36 [demo_next_song:3] Prepared "/var/azuracast/www/resources/error.mp3" (RID 3).
2019/04/10 06:54:12 [lang:3] AzuraCast Raw Response: /var/azuracast/www/resources/error.mp3
2019/04/10 06:54:12 [decoder:3] Method "MAD" accepted "/var/azuracast/www/resources/error.mp3".
2019/04/10 06:54:22 [demo_next_song:3] Finished with "/var/azuracast/www/resources/error.mp3".
2019/04/10 06:54:22 [demo_next_song:3] Prepared "/var/azuracast/www/resources/error.mp3" (RID 4).
2019/04/10 06:54:58 [lang:3] AzuraCast Raw Response: /var/azuracast/www/resources/error.mp3
2019/04/10 06:54:58 [decoder:3] Method "MAD" accepted "/var/azuracast/www/resources/error.mp3".
2019/04/10 06:55:08 [demo_next_song:3] Finished with "/var/azuracast/www/resources/error.mp3".
2019/04/10 06:55:08 [demo_next_song:3] Prepared "/var/azuracast/www/resources/error.mp3" (RID 5).
2019/04/10 06:55:45 [lang:3] AzuraCast Raw Response: /var/azuracast/www/resources/error.mp3
2019/04/10 06:55:45 [decoder:3] Method "MAD" accepted "/var/azuracast/www/resources/error.mp3".
2019/04/10 06:55:55 [demo_next_song:3] Finished with "/var/azuracast/www/resources/error.mp3".
2019/04/10 06:55:55 [demo_next_song:3] Prepared "/var/azuracast/www/resources/error.mp3" (RID 6).
2019/04/10 06:56:31 [lang:3] AzuraCast Raw Response: /var/azuracast/www/resources/error.mp3
2019/04/10 06:56:31 [decoder:3] Method "MAD" accepted "/var/azuracast/www/resources/error.mp3".
2019/04/10 06:56:41 [demo_next_song:3] Finished with "/var/azuracast/www/resources/error.mp3".
2019/04/10 06:56:41 [demo_next_song:3] Prepared "/var/azuracast/www/resources/error.mp3" (RID 7).
2019/04/10 06:57:17 [lang:3] AzuraCast Raw Response: /var/azuracast/www/resources/error.mp3
2019/04/10 06:57:17 [decoder:3] Method "MAD" accepted "/var/azuracast/www/resources/error.mp3".
2019/04/10 06:57:27 [demo_next_song:3] Finished with "/var/azuracast/www/resources/error.mp3".
2019/04/10 06:57:27 [demo_next_song:3] Prepared "/var/azuracast/www/resources/error.mp3" (RID 8).
2019/04/10 06:58:03 [lang:3] AzuraCast Raw Response: /var/azuracast/www/resources/error.mp3
2019/04/10 06:58:03 [decoder:3] Method "MAD" accepted "/var/azuracast/www/resources/error.mp3".
2019/04/10 06:58:14 [demo_next_song:3] Finished with "/var/azuracast/www/resources/error.mp3".
2019/04/10 06:58:14 [demo_next_song:3] Prepared "/var/azuracast/www/resources/error.mp3" (RID 9).
2019/04/10 06:58:50 [lang:3] AzuraCast Raw Response: /var/azuracast/www/resources/error.mp3
2019/04/10 06:58:50 [decoder:3] Method "MAD" accepted "/var/azuracast/www/resources/error.mp3".
2019/04/10 06:59:00 [demo_next_song:3] Finished with "/var/azuracast/www/resources/error.mp3".
2019/04/10 06:59:00 [demo_next_song:3] Prepared "/var/azuracast/www/resources/error.mp3" (RID 10).
2019/04/10 06:59:36 [lang:3] AzuraCast Raw Response: /var/azuracast/www/resources/error.mp3
2019/04/10 06:59:36 [decoder:3] Method "MAD" accepted "/var/azuracast/www/resources/error.mp3".
2019/04/10 06:59:46 [demo_next_song:3] Finished with "/var/azuracast/www/resources/error.mp3".
2019/04/10 06:59:46 [demo_next_song:3] Prepared "/var/azuracast/www/resources/error.mp3" (RID 11).
2019/04/10 07:00:22 [lang:3] AzuraCast Raw Response: /var/azuracast/www/resources/error.mp3
2019/04/10 07:00:22 [decoder:3] Method "MAD" accepted "/var/azuracast/www/resources/error.mp3".
2019/04/10 07:00:32 [demo_next_song:3] Finished with "/var/azuracast/www/resources/error.mp3".
2019/04/10 07:00:32 [demo_next_song:3] Prepared "/var/azuracast/www/resources/error.mp3" (RID 12)
Icecast error log:
[2019-04-10  06:52:03] WARN xml/parsing warning: 
[2019-04-10  06:52:03] WARN xml/parsing skipping element "stream-url" parsing "mount" at line 28
[2019-04-10  06:52:03] WARN xml/parsing warning: 
[2019-04-10  06:52:03] WARN xml/parsing unknown element "stream-genre" parsing "mount" at line 29
[2019-04-10  06:52:03] WARN connection/get_ssl_certificate Invalid cert file /etc/nginx/ssl/ssl.crt (system lib)
[2019-04-10  06:52:03] WARN slave/slave_startup process has 4096 max file descriptor limit
[2019-04-10  06:52:04] WARN source/source_set_intro Cannot open intro for /radio.mp3 "/usr/local/share/icecast/web//radio.mp3": No such file or directory

Now, I manually assign the port 8510

  • Azuracast requests "Restart your station". Ok, restating the radio station.
  • Result: Again: The player does not play anything. If I try to access the Icecast admin page, the result is error 404. Similarly, if I try to access the url of my local stream (error 404).
Supervisord log:
2019-04-10 06:52:03,449 INFO spawned: 'station_74_frontend' with pid 23685
2019-04-10 06:52:03,450 INFO spawned: 'station_74_backend' with pid 23686
2019-04-10 06:52:05,410 INFO success: station_74_frontend entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-04-10 06:52:05,410 INFO success: station_74_backend entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-04-10 07:04:59,177 INFO waiting for station_74_frontend to stop
2019-04-10 07:04:59,178 INFO waiting for station_74_backend to stop
2019-04-10 07:04:59,242 INFO stopped: station_74_backend (exit status 0)
2019-04-10 07:04:59,533 INFO stopped: station_74_frontend (exit status 0)
2019-04-10 07:04:59,537 INFO spawned: 'station_74_frontend' with pid 32581
2019-04-10 07:04:59,539 INFO spawned: 'station_74_backend' with pid 32582
2019-04-10 07:05:01,403 INFO success: station_74_frontend entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-04-10 07:05:01,403 INFO success: station_74_backend entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

Now, I manually assign the port 8520

  • Azuracast requests "Restart your station". Ok, restating the radio station.
  • Again: The player does not play anything. If I try to access the Icecast admin page, the result is error 404. Similarly, if I try to access the url of my local stream (error 404).

Now, I manually assign the port 8600

  • Azuracast requests "Restart your station". Ok, restating the radio station.
  • Again: The player does not play anything. If I try to access the Icecast admin page, the result is error 404. Similarly, if I try to access the url of my local stream (error 404).
  • No change in the logs.

_Ok..._

And now I follow these steps

  • I delete any existing radio station. In this way, I am releasing some ports below the port 8500
  • Azuracast assigns the following ports to the new radio station:
    ---- Broadcasting port: 8090
    ---- Dj/Streaming port: 8095
    ---- Internal request processing port: 8094
    Result: Everything works correctly and without errors.

@akexparedo What if you try to access the local port minus the forwarding, i.e. http://your-azuracast.url:8500 directly? Does that 404 or is it only the proxy?

Hello @akexparedo @SlvrEagle23

This error is very interesting.

In my particular case, I am using Azuracast for my students. Recently I have reached this limit of 50 radio stations.

I have done the steps described in this thread, in relation to Nginx. My installation is also traditional.

I have the same problem. It's impossible to operate any radio station beyond port 8500.

@akexparedo What if you try to access the local port minus the forwarding, i.e. http://your-azuracast.url:8500 directly? Does that 404 or is it only the proxy?

Same error. The browser does not open any page. As if it did not exist. Even if I switch from Icecast to Shoutcast.

@akexparedo @tonimad I completely forgot that the bare-metal installation configures the Uncomplicated Firewall (UFW) to allow the range 8000-8500 by default.

You should be able to expand the range just by running:

ufw allow 8500-8999
ufw reload

on the server.

@SlvrEagle23 Uhm... I've this error in my console:

root@azcast ~ # ufw allow 8500-8999
ERROR: Could not find a profile matching '8500-8999'

I think the format of the ufw command is slightly incorrect. Can you try ufw allow 8500:8999?

@akexparedo What he said ^

I think the format of the ufw command is slightly incorrect. Can you try ufw allow 8500:8999?

ERROR: Must specify 'tcp' or 'udp' with multiple ports

I was of the impression that it would by default allow tcp and udp when not specifying. Try ufw allow 8500:8999/tcp

root@azcast ~ # ufw allow 8500:8999/tcp
Rule added
Rule added (v6)
root@azcast ~ # ufw reload
Firewall reloaded

I'm going to try to create a radio station ...

Nothing new. The problem persists :(
I do not understand where I am failing.

Guys, I confirm the same. This problem continues, even allowing the range of ports.

Maybe we are forgetting something (another parameter, or adjustment).

Thanks @tonimad
I do not know. I have never seen this. It is a very strange situation. The panel and the public page are created correctly from port 8500 onwards, but the rest of the services do not work (including both: shoutcast & Icecast). Something blocks the creation, or access to these services.

@akexparedo If you run netstat -tulpn | grep :8500 does it show anything listening on that port?

@SlvrEagle23

root@azcast ~ # netstat -tulpn | grep :8500
tcp 0 0 0.0.0.0:8500 0.0.0.0:* LISTEN 15206/icecast
tcp6 0 0 :::8500 :::* LISTEN 15206/icecast

@akexparedo I'm sure they'll find where the problem is.

@akexparedo What about ufw status? Curious to see what it assumes the current rules are.

@SlvrEagle23 Yes, is very curious... just look:

root@azcast ~ # ufw status
Status: active

To Action From
-- ------ ----
80/tcp ALLOW Anywhere
443/tcp ALLOW Anywhere
8000:8999/tcp ALLOW Anywhere
22/tcp LIMIT Anywhere
8500:8999/tcp ALLOW Anywhere
80/tcp (v6) ALLOW Anywhere (v6)
443/tcp (v6) ALLOW Anywhere (v6)
8000:8999/tcp (v6) ALLOW Anywhere (v6)
22/tcp (v6) LIMIT Anywhere (v6)
8500:8999/tcp (v6) ALLOW Anywhere (v6)

Doesn't look like the firewall is the problem here. The port range is open. 馃

Doesn't look like the firewall is the problem here. The port range is open. 馃

Exactly. It is very mysterious.

@akexparedo I've spun up a baremetal installation, created a new station, assigned it to port 8500, and it serves and runs just fine.

I'm wondering if this is an issue specific to your hosting infrastructure, or some sort of port rules on a hardware firewall upstream of your server.

@akexparedo I've spun up a baremetal installation, created a new station, assigned it to port 8500, and it serves and runs just fine.

I'm wondering if this is an issue specific to your hosting infrastructure, or some sort of port rules on a hardware firewall upstream of your server.

Yes. You are right. But I do not know where the problem is. It is a dedicated server with a new installation. Nothing else occupies this server.

I have done the following test:

  • I've deleted a couple of radio stations. In this way, I release some ports below 8500.
  • Then I created a new radio station assigning port 8500. And again, the problem appears.

It is very frustrating not knowing where the problem is.

@akexparedo Definitely, but this has taken up a lot of my and our team's volunteered time, and I just don't see a way for us to reliably reproduce the issue. I'm afraid that for now we just have to close the issue as "can't reproduce".

If you are able to further research the issue and figure out a solution, by all means please share it on here so we can know for future use.

@akexparedo Since I have the same problem, I'm going to ask the provider of my server, Hetzner. I will tell you the answer. Maybe this can help something.

@SlvrEagle23 @Vaalyn

I appreciate your time very much. I have made a query to know what ports are being used on my server, but this does not clarify anything. The only open ports are those used by Azuracast radio stations, and mysql. I will continue researching, within my limitations in technical knowledge. If I find a solution, I will publish it here, of course.

Again, thank you very much for your time and effort.

@tonimad Wait! Is your server located in Hetzner? All my servers are hosted at Hetzner! Maybe it is a problem of ports in this network?

Looks like you found something that your systems have in common. Your best bet would be contacting Hetzner and ask them if and why they block access to these ports.

Looks like you found something that your systems have in common. Your best bet would be contacting Hetzner and ask them if and why they block access to these ports.

Yes @Vaalyn I hope so! Thank you so much.

First of all ... @akexparedo you must not feel frustrated. Azuracast is a wonderful system, really, but every server environment is totally different. I am sure that together we will find a solution.

They do everything possible to help. Occasionally, I see how they work very hard, and they spend a lot of time in their lives.

Also, @SlvrEagle23 lives in Texas, and @Vaalyn I think he lives in Germany. The schedules are very different. Even so, you can see that they are pending all day of any question or incident.

I live in Madrid and I work as a teacher in a school; Many times I can see how they maintain a high activity here, on Github, improving the system and answering all the doubts. The effort is really titanic.

Secondly ... About Hetzner ... Wow! It is certainly coincidence! :) However, Hetzner is a great European provider. And they respond very fast. I have received a response from them, brief but concise xD

"We do not block anything by default."

At this point, I found the solution. If you access the Hetzner panel, you will find a section within the properties of your server. The section is Firewall. For some reason that I do not know, my firewall was blocking any activity in the range of ports 8500-9000. However, I must say that my server is maintained by my school, and this section is managed by some students.

Anyway, can you check this section in your Hetzner panel?

Ohh! Thank you very much @tonimad ! I understand what you say.

I have disabled the Hetzner firewall on my server. What else can I do?

Ok @akexparedo

I need to know if you have restarted your nginx after making this change:

location ~ ^/radio/(8[0-9][0-9]0)(/?)(.*)$ {

with: sudo service nginx restart

@tonimad Yes:

The changes have already been made:

/etc/nginx/sites-enabled

and

sudo service nginx restart

But the problem continues. Nothing works from port 8500.

@akexparedo

A question... Why do you make this change in "sites-enabled"???

You must have another folder: "sites-available". Please, make your changes in "00-azuracast", inside this folder.

And after:
sudo service nginx restart

@akexparedo

A question... Why do you make this change in "sites-enabled"???

You must have another folder: "sites-available". Please, make your changes in "00-azuracast", inside this folder.

And after:
sudo service nginx restart

@tonimad OMG!!!!!!! Yeeeeeessssss!!!!!! This works now !!!!!!!

I was making the changes in the other folder!
OMG!!! works!!!!!!!! 馃 馃憤 馃挴

Ohh, thankssss @tonimad thanks!!! How can I reward your help ???

@akexparedo Happy to hear this ;)

Well, I have not done anything. I only noticed that you have edited a configuration file that is not correct.

It is not necessary to reward my help. You can help in the project:

https://www.patreon.com/AzuraCast

They will thank you :)

Good luck!

Thanks @tonimad @SlvrEagle23 @Vaalyn 馃

Hello @akexparedo @SlvrEagle23 @tonimad
/etc/nginx/sites-enabled/00-azuracast is it the only file that requires changes?
I have the same issues whit Ubuntu 18.04.5 + bare metal installation.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TogarUshindi picture TogarUshindi  路  3Comments

verdantsquare picture verdantsquare  路  3Comments

hecgua picture hecgua  路  3Comments

bo2008 picture bo2008  路  3Comments

oussamatn picture oussamatn  路  3Comments