AzuraCast / AzuraCast

A self-hosted web radio management suite, including turnkey installer tools for the full radio software stack and a modern, easy-to-use web app to manage your stations.
https://www.azuracast.com/
GNU Affero General Public License v3.0
2.96k stars 550 forks source link

Custom handling live source #1513

Closed gammaw closed 5 years ago

gammaw commented 5 years ago

If live DJ streams are enabled Azuracast adds this line to the Liquidsoap configuration:

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

The problem with it is that the live source cannot be used in the custom Liquidsoap configurations (Liquidsoap throws an error), e.g.:

radio = switch(track_sensitive=false, [({!live_enabled}, live), ({1w and 5h-6h}, playlist_custom_hits), ({true}, radio) ])

A motivation to do that is to define custom transitions (fading, jingles, etc.) before and after DJ streams.

A workaround is to use radio instead live but it has undesired side effects:

radio = switch(track_sensitive=false, [({!live_enabled}, radio), ({1w and 5h-6h}, playlist_custom_hits), ({true}, radio) ])

Do you see a quick fix for that (somehow preventing Azuracast from adding above line to the Liquidsoap configuration)? Disabling DJ streams is not an option because then DJ accounts will be missing too. I thought that Azuracast could offer an option for "advanced live source" similar to advanced playlists. What do you think?

gammaw commented 5 years ago

I found a workaround but you're not gonna like it :) And it's a workaround only for this specific use case.

Here it goes:

  1. Enable DJ streams.
  2. Find and copy the corresponding Liquidsoap configuration.
  3. Disable DJ streams.
  4. Paste from step 2 into custom Liquidsoap configuration.
  5. Use live source as needed.
  6. Implement the function dj_auth(user,password) for custom DJ user management (note: because of step 3 you don't have DJ accounts).

I tried other workaround but they didn't work. Such as:

BusterNeece commented 5 years ago

@gammaw I don't fully understand what's going wrong in your first question, because live at that point is a valid input signal that you can integrate into switches.

I get that you're trying to "schedule" times when live DJs can be connected, and this is a standing enhancement request for AzuraCast, but I'm not sure I would recommend the workaround you're using here.

gammaw commented 5 years ago

@SlvrEagle23

I don't fully understand what's going wrong in your first question, because live at that point is a valid input signal that you can integrate into switches.

Are you sure? That would be awesome. Like I said in my first post this one doesn't work in the custom configuration (Liquidsoap complains about clocks – it works without the live part though):

radio = switch(track_sensitive=false, [({!live_enabled}, live), ({1w and 5h-6h}, playlist_custom_hits), ({true}, radio) ])

I get that you're trying to "schedule" times when live DJs can be connected, and this is a standing enhancement request for AzuraCast, but I'm not sure I would recommend the workaround you're using here.

Not really. DJ are allowed at all times. What I want is two things:

  1. DJs can always dial in (this is why I have live in position 1) and
  2. I have fade in/out and jingles before and after DJ sessions (I use transitions in the switch – not visible in my example).
gammaw commented 5 years ago

One more comment: I guess it has to do with the definition and usage of Liquidsoap sources. If the radio source is on the left hand side, my assumption is that a source (like live) can only appear on the right hand side of a switch assignment once in the entire configuration. That is why I need to remove the corresponding assignment in the Azuracast-generated configuration. Does it make sense?

Btw, this is my (almost) complete switch.

radio = switch(track_sensitive=false, transitions=[ 
    transition_into_show(playlist_jingle),
    transition_into_show(playlist_jingle),
    transition_into_off(playlist_jingle_after_show) ], [ 
    #Live DJ
    ({!live_enabled}, live),
    #Shows...
    ({1w and 5h-6h}, once(playlist_myplayistname)),  
    #Backup songs in between shows
    ({true}, radio) ])

I need it because I'd like to have different jingles before and after shows. And I'd also like to have jingles and fading around DJ streams (I have custom fading functions – not depicted).

gammaw commented 5 years ago

Hmm, above workaround is not only technically ugly it is also not functionally equivalent: DJ display names (which are stored in the Azuracast database) are also not available if DJ streams are disabled. We're dependent on those names (we're reading them from the nowplaying interface) so this workaround is not an option.

@SlvrEagle23 I know it's not recommended but is it possible to edit the Liquidsoap configuration before Liquidsoap is started?

gammaw commented 5 years ago

FYI: disabling crossfading works as a quick fix (see details in this issue).

@SlvrEagle23 how do I know which release of Liquidsoap is being used by Azuracast?

Vaalyn commented 5 years ago

@gammaw You can find the current LS version for our Docker container in our Dockerfile in this line. Currently it's 1.3.7

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.