Skip to Content
It is currently July 16th, 2019, 11:24 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: March 8th, 2018, 8:00 am 
Offline
cat's pajamas

Joined: January 18th, 2005, 7:03 pm
Posts: 280
Location: UK.
Because of the way I'm running the queue, I have to have AutoRecovery turned off. Fine. No problems.
However, because Windows wants to reboot at strange times for various reasons like updates... I want SAM to start up when the system restarts. Which it does - BUT... the encoders don't start of course because I have to click the Play |> button on the top left to kick it into gear.
So, I need to check if the encoders are running - and start them if they aren't. But I only want to start them at system start. NOT when the decks are empty. I can do that. I want to be able to start the encoders. As in Autorecovery mode.

Can't find a way to do this yet. Which means I get an awful long dead air period sometimesAny ideas anyone?
thanks

_________________
Robert Chalmers
Quantum Radio
robert@quantum-radio.net
Wasting away in Margaritaville... Image
Image
Streaming via SAM since 1986
@ShanghaiTimes


Top
 Profile  
Reply with quote  
PostPosted: March 8th, 2018, 2:48 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7860
Location: Aachen (Germany)
quantumradio wrote:
However, because Windows wants to reboot at strange times for various reasons like updates...

If your Windows reboots at strange times, I'd rather look into a solution for that rather than just handling that within SAM.
People always blame updates for unexpected reboots, but updates on windows only happen once a month always on the same day (second tuesday of each month is patch tuesday)

That aside:
PAL doesn't have any way to know how long SAM has been running.
My suggestion would be to create a windows event that runs on startup and then has a delay of 5 minutes or so to wait for all stuff being started. (see: Windows Event Scheduler)
In that event use the powershell to send a web request to SAM's request/event port 1221 and trigger an Event in SAM (see: PowerShell Cmdlet Invoke-WebRequest)
In SAM create an autorun PAL script that waits for an Event to happen and will then start your encoders. (see: PAL Reference PAL.WaitForEvent and Encoders.StartAll)

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: March 9th, 2018, 8:20 am 
Offline
cat's pajamas

Joined: January 18th, 2005, 7:03 pm
Posts: 280
Location: UK.
Thanks. Can't find this anywhere...
(see: PAL Reference

A good idea actually. Fiddling with it now. I did have the reference once - can't locate it again...

_________________
Robert Chalmers
Quantum Radio
robert@quantum-radio.net
Wasting away in Margaritaville... Image
Image
Streaming via SAM since 1986
@ShanghaiTimes


Top
 Profile  
Reply with quote  
PostPosted: March 9th, 2018, 9:09 am 
Offline
cat's pajamas

Joined: January 18th, 2005, 7:03 pm
Posts: 280
Location: UK.
Ok, nearly got it.



Code:
PAL.Loop := True;

//Wait for event to be triggered at: http://192.168.0.11:1221/event/start
PAL.WaitForEvent('Start');


If (Encoders[0].Status='Error')
     Then
          Begin;
        Encoders.StartAll;
        end
       


event response.

Code:
<PALEvent>
<application>
<apptype>SAM Broadcaster PRO</apptype>
<version>2017.11</version>
</application>
<status>
<code>200</code>
<message>OK</message>
<event_name>start</event_name>
<event_count>1</event_count>
</status>
</PALEvent>

_________________
Robert Chalmers
Quantum Radio
robert@quantum-radio.net
Wasting away in Margaritaville... Image
Image
Streaming via SAM since 1986
@ShanghaiTimes


Top
 Profile  
Reply with quote  
PostPosted: March 9th, 2018, 12:31 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7860
Location: Aachen (Germany)
quantumradio wrote:
A good idea actually. Fiddling with it now. I did have the reference once - can't locate it again...

I guess you found it in the meantime, but just for reference (Sorry, could not resist): Help-> PAL Scripting Reference

Nearly? What's the problem then?
The event response is code 200 - OK, so it should've triggered the start event.
Not sure if events are case sensitive, so you might want to try naming the event start in all-lowercase in your PAL script.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: March 11th, 2018, 6:23 am 
Offline
cat's pajamas

Joined: January 18th, 2005, 7:03 pm
Posts: 280
Location: UK.
Mastacheata wrote:
quantumradio wrote:
A good idea actually. Fiddling with it now. I did have the reference once - can't locate it again...

I guess you found it in the meantime, but just for reference (Sorry, could not resist): Help-> PAL Scripting Reference

Nearly? What's the problem then?
The event response is code 200 - OK, so it should've triggered the start event.
Not sure if events are case sensitive, so you might want to try naming the event start in all-lowercase in your PAL script.


That's ok. I'm not familiar with Windows anymore. I am totally unfamiliar with the Event Manager. I haven't managed to work out how I get it to trigger an event that calls that web link to the SAM instance.

It's all probably to naught anyway, because even when the computer starts up, and SAM restarts, it then STOPS dead in its track, waiting for me to log in to probably SAM Cloud. Which I am not a subscriber to anymore. Just a member of SpacialNet.
I have to hit Cancel to abort the login attempt, and it then happily starts SAM Broadcaster and proceeds as normal.

Thanks for the help though. You did get me going in the right direction.

uh oh. I just realized. The encoders start automatically - but the Streams don't. I need ther streams to start along with the encoders. hmmm

_________________
Robert Chalmers
Quantum Radio
robert@quantum-radio.net
Wasting away in Margaritaville... Image
Image
Streaming via SAM since 1986
@ShanghaiTimes


Top
 Profile  
Reply with quote  
PostPosted: March 11th, 2018, 10:10 am 
Offline
SVS Member
SVS Member

Joined: October 15th, 2003, 11:59 pm
Posts: 4728
Location: Los Angeles - A Little West Of Nashville
quantumradio wrote:
The encoders start automatically - but the Streams don't. I need ther streams to start along with the encoders. hmmm
The encoders can be made to start automatically (in the encoder set-up) by checking the box that says "Auto start encoder after xx seconds". The music can start by having BOTH the Auto DJ and the Auto Recovery clicked ON.

_________________
- DJ Dee
- Spacial Volunteer Support (SVS)
- Custom PAL services: www.palscripts.com
- http://www.AlternativeHD.com
- http://www.lahotcountry.com


Top
 Profile  
Reply with quote  
PostPosted: March 12th, 2018, 3:48 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7860
Location: Aachen (Germany)
quantumradio wrote:
It's all probably to naught anyway, because even when the computer starts up, and SAM restarts, it then STOPS dead in its track, waiting for me to log in to probably SAM Cloud. Which I am not a subscriber to anymore. Just a member of SpacialNet.
I have to hit Cancel to abort the login attempt, and it then happily starts SAM Broadcaster and proceeds as normal.

That sounds like a bug to me. Please report that to the official Spacial helpdesk.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: March 12th, 2018, 6:26 am 
Offline
cat's pajamas

Joined: January 18th, 2005, 7:03 pm
Posts: 280
Location: UK.
I've been away from this for too long I guess, I can load the queue, start the encoders - just can't seem to tell it to start playing...

Trying to discover how to start the show, as though pressing the start button, just below the File option.
Any ideas anyone?
Thanks

Image

_________________
Robert Chalmers
Quantum Radio
robert@quantum-radio.net
Wasting away in Margaritaville... Image
Image
Streaming via SAM since 1986
@ShanghaiTimes


Top
 Profile  
Reply with quote  
PostPosted: March 12th, 2018, 10:39 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7860
Location: Aachen (Germany)
SAM has no option to start things only on launch.
The Auto-Recovery option in the AutoDJ/Queue/Manual Dropdown button can take care of that, but it will also kick in at all other situations where the players are idle.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: March 12th, 2018, 10:48 am 
Offline
cat's pajamas

Joined: January 18th, 2005, 7:03 pm
Posts: 280
Location: UK.
Mastacheata wrote:
SAM has no option to start things only on launch.
The Auto-Recovery option in the AutoDJ/Queue/Manual Dropdown button can take care of that, but it will also kick in at all other situations where the players are idle.



ah, ok. I see. Thanks. Now to find the help desk again and see if I can find a way to turn off that trying to login to the cloud thing at startup.

Thanks again for your help

_________________
Robert Chalmers
Quantum Radio
robert@quantum-radio.net
Wasting away in Margaritaville... Image
Image
Streaming via SAM since 1986
@ShanghaiTimes


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group