Icecast Streaming Media Server Forum Index Icecast Streaming Media Server
Icecast is a Xiph Foundation Project
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

simple fallback issue thats not so simple...

 
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server
View previous topic :: View next topic  
Author Message
DJ-Zath



Joined: 11 Feb 2009
Posts: 155
Location: Western Illinois - USA

PostPosted: Sat Apr 27, 2013 3:54 am    Post subject: simple fallback issue thats not so simple... Reply with quote

hi Karl and everyone else

I have tried searching for this, but I couldn't find somethig that explained it right...

plain and simple, what I need to do is fall back to a SECOND mount when the first one is out..

BUT

the second mount is NOT in succession to the first one.. it MUST be "OR switched" at the final mount in the chain..

example:

mount 1 (DJ input) -> mount 2 (binding relay) -> mount 3 (main out)
mount 4 (external backup relay) -> mount 3

'OR switch' mount 2, to fall back to mount 4 ...

this way, I can keep the external relay OUT of the studio input thus preventing it from interfering with the auto switchover systems

can this be done?
_________________
-DjZ-
Smile Smile
Back to top
View user's profile Send private message Visit poster's website
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Sat Apr 27, 2013 11:20 am    Post subject: Reply with quote

I'm not entirely sure on the description here, is mount 3 supposed to be an on-demand relay?, what will listeners actually request. may be be mean that mount 3 is what listeners request which will be a relay of either mount 1 or mount 4. At the moment I think you either want main to fallback to DJ and in turn falls back to mount 4 (on-demand) or you want main to be a relay (keeping listeners there) and that relays mount 4 which is overridden by the DJ

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
DJ-Zath



Joined: 11 Feb 2009
Posts: 155
Location: Western Illinois - USA

PostPosted: Sat Apr 27, 2013 5:02 pm    Post subject: Reply with quote

hi Karl and thanks for the reply!

sorry for any confusion, I'll try to re-explain it:

first, I'll explain the mounts and their reason:

mount 4 = external relay mount, feeds music from 'mainesmixx.com'

mount 1 = remote DJ input mount

mount 2 = 'bind relay' mount, this ones needed to "bind" the mounts so that they don't 'hop around' and prevents the studio output from feeding itself (very bad condition!)

mount 3 = main output mount (studio input mount)

Now, in the 'conventional' way, one would do it as:

mount 4 -> mount 1 -> mount 2 -> mount 3 -> listeners

the problem here, however, is that "mount 4" is feeding mount 1, which shows up as an "input stream" on the studio console- although the switching system was written to handle the new input, Icecast itself treats this as another "DJ input" and I had a bad thing occur when a DJ was signing out; instead of the automatic switchover happening smoothly, the EXT RELAY started feeding music onto the DJ channel while the local playout went into "auto mode".. the result was multiple programs being mixed onto the studio console and me rushing the input faders down! (this now is another issue, as if another DJ logs in, they would be MUTED as the input faders are down!)

so, the solution is to have mount 4 "double fallback" at the main output mount.. this way it won't show up as a program source on the DJ input channels on the console.. yet be able to feed program when the studio and DJ mounts are both offline...

to do this, I need to "fall back to a fall back" in logical terms:

output B (mount 4) IF output A (mount 2) is not available AND output A (mount 2) IF output S (studio input) is not available

B > A > S = Out

I hope this explains it better! Smile

-DjZ-
_________________
-DjZ-
Smile Smile
Back to top
View user's profile Send private message Visit poster's website
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Sun Apr 28, 2013 12:36 am    Post subject: Reply with quote

based on your description (and I'm assuming a number of things so correct it if need be).

/mount4 as a relay from external
/mount1 as a point for DJs, fallback to /mount4
/mount2 as a local relay of /mount4 (can be on-demand). This bounces between mount4 and mount1, no fallback here.

/mount3 fallback to /mount2

you could of course use a local relay for handle the switches over mount2 and mount3 while keeping listeners in one place (think YP).


karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
DJ-Zath



Joined: 11 Feb 2009
Posts: 155
Location: Western Illinois - USA

PostPosted: Sun Apr 28, 2013 8:29 pm    Post subject: Reply with quote

hi Karl!

you're close.. but I don't think you're quite understanding mount 2's purpose..

mount 4 and mount 2 are "relay" mounts ( <relay></relay> )
mount 1 is a shoutcast mount, mount 3 is an icecast mount ( <mount></mount> )

mount 2 simply "binds" everything to localhost; this seems nessesary as, without it, what happens is the console input can end up listening to the output mount.. this, of course causes an immediate feedback loop at the console. VERY BAD! I never understood this issue, and all versions- even the KH branch- has this bug.. it happens under a specific chain of events; where the DJ logs in, then out, or if the server is started/restarted with a DJ on then the studio logs in and boom.. there it is, the console is listening to ITSELF on OUTPUT mount!

mount 2 was added as a "bind" or "isolator" mount to seperate mount 3 from the other mounts... nothing listens to mount 2.. except mount 3 and that, "relays" mount 1.. this process isolates the mounts and prevents the bug, though I think it a slight whaste of resources, and complexity.. it IS nessesary for all of this to work properly.

mount 4 brings in an external feed.. you know how this mount works.

now the issue/reason re-explained Smile

whatever mount 1 receives, the console is listening to.. if mount 1 falls-back to mount 4, then mount 4 shows up on the "DJ input" faders; this is a bad idea since I can not MUTE mount 4 separately from the DJs.. so, if the audio system kicks in and plays LOCAL programming, and the DJ logs out.. OOPS! now the DJ input is playing the RELAY alongside with the local playout! the result is a mixed program mess! the immediate fix is to MANUALLY "pull down" the faders for the DJ input.. but this defeats the point of an "automatic switchover" system; and, then the engineer has to also mind the faders when a DJ logs back in since now, they are MUTED..

so, the solution is that the "relay" has to come into the chain AFTER the console.. that means AFTER mount 1... since mount 2 is a <relay> mount, a fallback to mount 4 directive can't work there... so now comes mount 3- the main output mount.. but this mount allready "falls back" to mount 2 when the studio input feed is unavailable..

I realize, now, that, that's where you might be getting confused.. the FALLBACK is to mount 2 from mount 3, this occurs IF the studio is NOT online to manage the incoming feed- its meant as an "emergency reroute for input DJs to air" this way, if the studio loses net (being Comcast Business Net, it always does) while a DJ is on-air, they are immediately pushed to the output mount (pushed to air) instead of the missing studio section cutting the whole thing off!

get it? its ingenious!

many stations have TRIED this, and FAILED because they run into the problem where the input will end up listening to itself on the output.. but inserting a "relay to localhost" SOLVES this problem.. and everything works perfectly- like clockwork!

but, now, I need mount 3 to have TWO successive fall-backs:

example:
<fallback-mount-1>/mount 2</fallback-mount-1>
<fallback-mount-2>/mount 4</fallback-mount-2>

So, this way, if theres no studio feed AND theres no input DJ feed, then it can push the external program (an affiliate radio station) to air without said relay showing up on the DJ input faders..

Code:


 DJ --> {mount 1} -->{mount 2 (local relay)} --> {mount 3} --> Listeners
              \--> Studio Console - input / output >--^
           MainesMixx.com --------> mount 4 (relay) >---^



or, better:

Code:


<icecast>

<hostname>warp-radio.com</hostname>

<listen-socket>
        <port>8000</port>
        <bind-address>76.73.7.18</bind-address>
        <shoutcast-mount>/input</shoutcast-mount>
</listen-socket>

<listen-socket>
        <port>8000</port>
        <bind-address>127.0.0.1</bind-address>
</listen-socket>

<limits>
        <clients>750</clients>
        <sources>5</sources>
        <threadpool>5</threadpool>
        <queue-size>512000</queue-size>
        <client-timeout>2</client-timeout>
        <header-timeout>3</header-timeout>
        <source-timeout>5</source-timeout>
        <burst-on-connect>1</burst-on-connect>
        <burst-size>136000</burst-size>
</limits>

<authentication>
        <admin-user>OMITTED</admin-user>
        <admin-password>OMITTED</admin-password>
</authentication>

### these are ADDED for Karl to follow along (not in the original) ###




### MOUNT 1 ###

<mount>
        <mount-name>/input</mount-name>
        <password>OMITTED</password>

### (if doing it the "conventional" way, this next line would be inserted) ###

<!--
        <fallback-mount>/maines</fallback-mount>
        <fallback-override>1</fallback-override>
-->
        <genre>Mixed Techno Rock Comedy</genre>
        <allow-ip>PRIVATE</allow-ip>
        <no-yp>1</no-yp>
        <public>0</public>
        <hidden>1</hidden>
</mount>




### MOUNT 3 ###

<mount>
        <mount-name>/warp-128.mp3</mount-name>
        <password>OMITTED</password>
        <burst-size>272000</burst-size>
        <fallback-mount>/relay</fallback-mount>

### (this is the ideal place to put this, if this mode even existed) ###

<!--
        <fallback-mount-2>/maines</fallback-mount-2>
-->
        <fallback-override>1</fallback-override>
        <fallback-when-full>0</fallback-when-full>
        <public>1</public>
        <stream-name>WARP Radio Network - 128k MP3 Broadband Feed</stream-name>
        <stream-description>"Where The Masses Get WARP'ed!"</stream-description>
        <stream-url>http://www.warp-radio.com</stream-url>
        <genre>Mixed Techno Rock Comedy</genre>
        <intro>intro-128.mp3</intro>
        <bitrate>128</bitrate>
        <type>audio/mpeg</type>
        <subtype>mp3</subtype>
        <mp3-metadata-interval>32768</mp3-metadata-interval>
        <hidden>0</hidden>
</mount>




### MOUNT 5 #### (this one wasn't discussed)

<mount>
        <mount-name>/warp-24.mp3</mount-name>
        <password>OMITTED</password>
        <burst-size>64000</burst-size>
        <public>1</public>
        <stream-name>WARP Radio Network - 24k MP3 Modem Feed</stream-name>
        <stream-description>"Where The Masses Get WARP'ed!"</stream-description>
        <stream-url>http://www.warp-radio.com</stream-url>
        <genre>Mixed Techno Rock Comedy</genre>
        <intro>intro-24.mp3</intro>
        <bitrate>24</bitrate>
        <type>audio/mpeg</type>
        <subtype>mp3</subtype>
        <mp3-metadata-interval>8192</mp3-metadata-interval>
        <hidden>0</hidden>
</mount>




### MOUNT 4 ####

<relay>
        <server>MAINESMIX (private feed URL)</server>
        <port>PRIVATE</port>
        <mount>PRIVATE</mount>
        <local-mount>/maines</local-mount>
        <on-demand>0</on-demand>
        <relay-shoutcast-metadata>1</relay-shoutcast-metadata>
        <allow-ip>127.0.0.1</allow-ip>
        <no-yp>1</no-yp>
        <hidden>1</hidden>
        <public>0</public>
</relay>




### MOUNT 2 ###

<relay>
        <server>127.0.0.1</server>
        <port>8000</port>
        <mount>/input</mount>
        <local-mount>/relay</local-mount>
        <on-demand>0</on-demand>
        <relay-shoutcast-metadata>1</relay-shoutcast-metadata>
        <allow-ip>127.0.0.1</allow-ip>
        <no-yp>1</no-yp>
        <hidden>1</hidden>
        <public>0</public>
</relay>

<directory>
        <yp-url-timeout>10</yp-url-timeout>
        <yp-url>http://dir.xiph.org/cgi-bin/yp-cgi</yp-url>
</directory>

<directory>
        <yp-url-timeout>10</yp-url-timeout>
        <yp-url>http://www.steamcast.com/sbin/yp.php</yp-url>
</directory>

<paths>
        <basedir>icecast</basedir>
        <logdir>icecast</logdir>
        <webroot>icecast/web</webroot>
        <adminroot>icecast</adminroot>
        <pidfile>icecast.pid</pidfile>

        <alias source="/maines" dest="/warp-128.mp3" />
        <alias source="/relay" dest="/warp-128.mp3" />
        <alias source="/" dest="/warp-128.mp3" />
        <alias source="" dest="/warp-128.mp3" />
</paths>

<logging>
        <accesslog>../../../dev/null</accesslog>
        <errorlog>../../../dev/null</errorlog>
        <playlistlog>../../../dev/null</playlistlog>
        <loglevel>0</loglevel>
        <logarchive>0</logarchive>
</logging>

<security>
        <chroot>1</chroot>
        <changeowner>
                <user>OMITTED</user>
        </changeowner>
</security>

<fileserve>1</fileserve>

</icecast>



I hope this helps explain it all.. I just revealed a TRADE SECRET here heheh

-DjZ-
Smile Smile
_________________
-DjZ-
Smile Smile
Back to top
View user's profile Send private message Visit poster's website
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Mon Apr 29, 2013 1:40 am    Post subject: Reply with quote

The relay would normally look like a listener, so the fact that it follows through fallbacks is not surprising but there has been cases were ideally it would be nice to prevent that in such cases. The hack I use for slave relays does try to identify itself as a special case by using the /admin/streams?mount=/mountpoint style of request but I believe that still follows across moves to other mounts. I suppose a header could be optional for such cases.

Could you have the relay switch between the different mounts instead of trying to use this via fallback? eg

Code:

<relay>
   <local-mount>/mount3</local-mount>
   <server>127.0.0.1</server>
   <port>...</port>   
   <retry-delay>30</retry-delay>
   <master>
       <mount>/studio</mount>
   </master>
   <master>
       <mount>/input</mount>
   </master>
   <master>
       <server>x.x.x.x</server>
       <port>....</port>
       <mount>/maines</mount>
   </master>
</relay>


The above implies an order for checking, and you would need to kick off a killsource of the relay when studio connects so that the list is re-evaluated again, not sure if /input would need to trigger a killsource. Currently there is no tie-in between mounts for this except for the on-connect trigger, and no control on flagging the entries. Only when all have failed does a fallback get considered.

karl
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
subRebel style by ktauber