Working with the MODStream-Watcher

You have a question or need an advice about how to do something? Ask it here!
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Working with the MODStream-Watcher

Post by radio42 »

ProppFrexx ONAIR supports a special 'MODStream-Watcher' (which is a dedicated 'ModStream-Player' window) to monitor, if a given URL stream (e.g. a SHOUTcast, ICEcast or WM PublishingPoing stream is available).
If not it might wait until it becomes active (and the regular program/playlist continues like normally).
Once the watched URL becomes active and alive the ModStream-Player might mute or suspend the currently running program and play the monitored URL stream.
This until the ModStream Player is stopped.

To do the above, two control-commands are provided. A START and a STOP command.
The START command starts the ModStream-Player and thus starts monitoring the given URL stream.
The STOP commands stops the monitoring and/or playing of such stream and closes the ModStream-Player.
See below for the detailed syntax.
The START/STOP commands can be either issued manually (e.g. via user command buttons) or automatically (e.g. via appropriate Program Scheduler entries).

As explained, the MODStream-Watcher is a feature to e.g. enable automatic remote moderators or external broadcasts to tune in to a dedicated streaming server (e.g. a SHOUTcast server). Eg. a remote moderator is streaming his live show from a distant location, eg. from his remote location to a specific/dedicated moderator streaming server.
So the MODStream-Watcher allows you to check, if that specific/dedicated moderator streaming server is currently online (meaning a DJ is currently streaming his live show) - if yes, that MODStream will be played and a current program will be suspended.

Example:
You define your regular program as is within the program scheduler.
E.g. assume this by scheduling a full 24 by 7 program.
This includes those 'special' programs which are typically 'hosted' by your remote moderators/DJs.
Let's say there is one 'special' program which starts at 10am and ends at 11am - but is normally hosted 'remotely' by a DJ.
You anyhow define such a program within the scheduler (just in case the remote speaker is suddenly unavailable).
But in addition you define certain 'control-commands' to exectute when such program is starting/stopping.
With these control-commands you can actually start/stop the MODStream feature for that special program.
To do so...
Within the 'Program Editor' click on the 'Control-Commands' button...
In the following dialog specify the following:

For "Program Starting":

Code: Select all

MODSTREAM_WATCHER_START <url>|0|true|true
These are the parameters in detail:
1st: the URL address to monitor
2nd: max. playtime in seconds (when 0 it plays forever until the STOP command)
3rd: stopPlaylist, true to turn AutoPlay off
4th: startWithNextTrack, false to start immediate
5th: songTitle, optional initial song title

For "Program Stopped":

Code: Select all

MODSTREAM_WATCHER_STOP 
That's it.
Note: replace the <url> with the full streaming server Url of the remote server to listen to!
What is now happening is the following:
When the 'special' program is about to be starting the control-command "MODSTREAM_WATCHER_START <url>|0|true|true" is executed.
This command will actually start the MODStream-Player and starts listening to the given <url>.
If the <url> is live and active it will connect to it and play it (the other parameters tell the system to 'suspend' any currently running playlist if the MODStream is playing).
If the <url> is not available or live, the MODStream-Player will wait and try to (re)connect - and any regular program/playlist will continue to play.
This will happen until the "MODSTREAM_WATCHER_STOP" command is called.
As such in between a "MODSTREAM_WATCHER_START" and "MODSTREAM_WATCHER_STOP" command any remote speaker can kind of 'tune-in" at the given <url> and if, any regular program is suspend...and finally resumed when either the remote speaker disconnects or the STOP command is given.
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Working with the MODStream-Watcher

Post by radio42 »

The MODSTREAM_WATCHER_START parameters have been enhanced over time. This is then full syntax:

Code: Select all

MODSTREAM_WATCHER_START [<url>[|<length>|<stopPlaylist>|<startWithNextTrack>[|<songTitle>[|<playonce>[|<introfile>[|<outrofile>[|<url2>[|<alwaysPlayIntroOutro>]]]]]]]]]
s for the syntax:
Any values in squared brackets ([...]) are optional parameters.
The values are denoted by the less/greater signs (<value>), these needs to be completely replaced by real values (incl. the less/greater signs!).

When using the MODSTREAM_WATCHER_START command WITHOUT any parameters, the params as entered in the 'MOD Stream Watcher Editor' are used.
Else, you can specify any alternative parameters:

<url>: the main URL address to monitor
<length>: max. playtime in seconds
<stopPlaylist>: true to turn AutoPlay off, else false
<startWithNextTrack>: false to start immediate, else true
<songTitle>: optional initial song title
<playonce>: true to only play the stream once (no MODSTREAM_WATCHER_STOP needed)
<introfile>: an optional audio file to play right before the modstream plays
<outrofile>: an optional audio file to play right after the modstream played
<url2>: an optional alternative 2nd url, if the 1st is not available (both are tried)
<alwaysPlayIntroOutro>: true to also play the intro/outro after a reconnect
tom_decouttere
Posts: 19
Joined: 10 Jun 2017 07:24
Re: Working with the MODStream-Watcher

Post by tom_decouttere »

Am I missing something? It doesn't work when I follow this in v4:
scheduler>Schedulers>Program Scheduler>Continous FMK>Edit Series>Control Commands (There I see the commands as above)
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Working with the MODStream-Watcher

Post by radio42 »

What exactly are you missing? What exactly is not working for you?
Please post your exact command you are using, the exact event with which you are using it and explain what exactly is working or not working.
tom_decouttere
Posts: 19
Joined: 10 Jun 2017 07:24
Re: Working with the MODStream-Watcher

Post by tom_decouttere »

The control commands work when I do "test" so that is not the problem, they are as above.
Recurrence series is exactly 1 hour.
On Program Starting : MODSTREAM_WATCHER_START http://stream.server.be:8300|0|false|false
On Program Stopped : MODSTREAM_WATCHER_STOP
When the hours go by the watcher is running at top of the hour but then exits after the first song in the autoplaylist starts

In addition the MOD Player, if you do run it again by using "test", when the feed stream has exited (disconnect), it keeps on playing the last seconds in endless loop alternated with content of auto playlist.
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Working with the MODStream-Watcher

Post by radio42 »

Maybe the concept of the command is not fully clear.
As soon as the MODSTREAM_WATCHER_START command is executed, the MODStream Player is started. And as soon as your execute the MODSTREAM_WATCHER_STOP command it is stopped.
When you now define an hourly recurring program with the above mentioned events, think of when the events are triggered...
The 'On Program Starting' event is triggered with each new program start (effectively ahead of time according to the show in advance time) and will start the MODStream Player - BUT, the 'On Program Stopped' event will be triggered, when the previous program is finally stopped, and this happens AFTER the 'On Program Starting' event of the current program.
As such you sequence is:
- New Program Starting: MODSTREAM_WATCHER_START
- Previous Program Stopping: MODSTREAM_WATCHER_STOP
thus, the MODStream Player only plays for a short time!

In order to correct this, and in case you always want to play a URL stream each hour as part of your regular program, you might also directly schedule this from within your script.
Eg. you can use the LoadTrack script-line mode (hold the SHIFT key while clicking on the entry's '...' button in order to specify a URL entry) to specify a regular URL entry within script-line. If this script-line (URL) is not available at this time, the entry will simply be skipped.
Eg. you program's script might look like this (Loop-Line=2):
1. LoadTrack, C:\Jingle\TOTH.mp3
2. LoadTrack, http://stream.server.be:8300
3. Random, YourMediaLib


The second issue might be due to your streaming server setup.
Eg. when your source of your server is disconnected, your server might still accept new connections (from the MODStream Player) and even serves it with its last buffer, so for the MODStream Player this looks like a valid connection. However, your server then disconnects the cliet (the MODStream Player) a few seconds after. This behavior is out of scope and control of the MODStream Player but needs to be fixed on the server side: ie. your streaming server should not accept connection when there is no source connected. Please contact your streaming server provider to fix this.
tom_decouttere
Posts: 19
Joined: 10 Jun 2017 07:24
Re: Working with the MODStream-Watcher

Post by tom_decouttere »

I got this script working, but on disconnect stream it now starts playing 2 tracks simulteanously. These were not shown when I test ran the script.
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Working with the MODStream-Watcher

Post by radio42 »

Please open a new ticket for this, as it seems unrelated.
Also post the exact version you are using incl. your .pfp script file and pls describe the exact steps to reproduce and how you tested your disconnect.
tom_decouttere
Posts: 19
Joined: 10 Jun 2017 07:24
Re: Working with the MODStream-Watcher

Post by tom_decouttere »

I will open new ticket on the seperate script issue, but for the remaining on the Shoutcast buffer I may need some help from forum users.
" your streaming server should not accept connection when there is no source connected. Please contact your streaming server provider to fix this." I control the Shoutcast server and can edit the confiig, but don't know how to do this for the buffer.
tom_decouttere
Posts: 19
Joined: 10 Jun 2017 07:24
Re: Working with the MODStream-Watcher

Post by tom_decouttere »

I have now reduced the buffer size in scserv.conf on the Shoutcastserver using fixedbuffersize=500000 but it doesn't work. I really don't know how else I can fix the bad behaviour of MODSTREAM_WATCHER_STOP. The stream keeps on playing the last buffer.

Post Reply