clarification on mount backups

Steamcast is a stand alone server that combines the features of SHOUTcast and Icecast2 and more to make one mega awesome server.
Post Reply
Lane
Posts: 154
Joined: Mon May 09, 2005 4:16 pm

clarification on mount backups

Post by Lane »

I'm getting back to doing some mount backups in my configs (something I once had working fine btw). I'd appreciate some feedback on whether or not I misunderstand how this works, or if maybe steamcast isn't playing nice with me.

Brief description. I want to have a mount use a relay as a backup. If I'm logged in to cast, this is what is sent out on mount 'main'. If I disconnect, I want the backup mount, which is a relay, to go out on mount main. Here is a config snippet.

; this is on port 8000
; source
SourceMount=/main
SourceUser=main
SourcePass=mainpass
SourceUserMax=5
SourceBackup=/backuprelay
SourceIsSC=Yes
SourceIsDefault=Yes
SourceBuffUtil=10

; source
SourceMount=/backuprelay
SourceUser=backuprelay
SourcePass=backuprelaypass
SourceUserMax=2
SourceRelay=localhost:8200/somemount
SourceIsSC=Yes
SourceIsDefault=No
SourceBuffUtil=10

Basically, if I try and view http://theserver.com:8000/main, I see nothing if I'm not casting to it. Should I not see/receive the backup stream? (which is confirmed to be running)

If you could explain how I might be wrong about my understanding here, I'd appreciate it. Or if I do understand it right, confirm that too. I may set up a test area you can have access to (um, maybe the one I set up is still there actually!)

Thanks,
Lane
Last edited by Lane on Fri Feb 09, 2007 3:29 pm, edited 1 time in total.
User avatar
Jay
Will work for food (Administrator)
Posts: 3020
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Post by Jay »

The only streams which will not how in the public index are authentication required streams. So unless you have it set to only be auth then you should see it, check your log to see if steamcast is able to connect to the source.
- Jay
Lane
Posts: 154
Joined: Mon May 09, 2005 4:16 pm

Post by Lane »

here a snip of the log. this repeats every 10 seconds.

<02/09/2007@20:07:46> [src] Attempting a connection with relay: localhost:8200/dj [1801]
<02/09/2007@20:07:46> [src] Connection successful to localhost:8200/dj
<02/09/2007@20:07:46> [src] Relay Thread #1: host returned error (ICY 401 No Source)
<02/09/2007@20:07:46> [src] Relay Thread #1 lost connection, reconnecting in 10 secs....
<02/09/2007@20:07:51> [dest] <127.0.0.1> [401] (No Source) "Request: GET /studio" {UA: Steamcast D.N.M.S./0.9.75 beta (Linux)(Shoutcast compatible)}

that source is running. I can view it's status page, and see the active mount.
User avatar
Jay
Will work for food (Administrator)
Posts: 3020
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Post by Jay »

ok are you sure that it is available from localhost:8200/dj?

an ICY 401 No Source means that the master server has complained that the mount requested has no source feed.

Check the master server's log to see if it is actually connecting and what it is requesting.
- Jay
Lane
Posts: 154
Joined: Mon May 09, 2005 4:16 pm

Post by Lane »

well, I'm kinda stumped. everything is I believe it should be. I did do this stuff successfully with a previous version (.73 perhaps?) but I had some other issues that prevented me using it.

If you still have the login for that account on my server, you can login to the shell yourself and run this. (it's not running atm). If you don't have the password, I'll reset it and send it to you if you like. this is a test I set up which is very simple. mount, and backup mount which is a relay. when I run it, I can see and listen to the backup mount, but not the primary mount, which is also set for default.


Here is a session from the log:

<02/13/2007@17:42:48> [serv] Configuration loaded from ./steamcast.conf
<02/13/2007@17:42:48> [serv] Mime types file loaded
<02/13/2007@17:42:48> [serv] WARNING: steamcast.vip could not be loaded, no vips will be loaded
<02/13/2007@17:42:48> [serv] WARNING: steamcast.ban could not be loaded, no bans will be loaded
<02/13/2007@17:42:48> [serv] Listening to ANY:8800 for incoming client connections...
<02/13/2007@17:42:48> [serv] Starting Thread pool of 5 threads...
<02/13/2007@17:42:48> [serv] Listening to ANY:8801 for incoming source connections...
<02/13/2007@17:42:48> [serv] Listening to 8800 for incoming stat connections...
<02/13/2007@17:42:48> [src] Relay thread created #1
<02/13/2007@17:42:48> [src] Attempting a connection with relay: 89.248.167.7:8080 [1]
<02/13/2007@17:42:48> [serv] PID: 30164
<02/13/2007@17:42:48> [src] Name:Radio Free Colorado - Classic + Modern Rock Mix, 60's to today. Best Hi-Fi Sound on the Net!; Genre:Classic Rock 60s 70s 80s
<02/13/2007@17:42:48> [src] Public:1; Bitrate:128; URL:http://www.radiofreecolorado.net
<02/13/2007@17:42:48> [src] Content-Type: audio/mpeg
<02/13/2007@17:43:14> [dest] <x.x.x.x> [200] (OK) "Request: GET /" {UA: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.0.7) Gecko/20060911 Camino/1.0.3}
<02/13/2007@17:43:37> [dest] <x.x.x.x> [401] (No Source) "Request: GET /live.mp3" {UA: iTunes/7.0.2 (Macintosh; N; PPC)}
<02/13/2007@18:04:34> [serv] SIGINT recieved; shutting down!
<02/13/2007@18:04:34> [serv] closing
<02/13/2007@18:04:34> [src] Relay Channel #1 has no listeners, sleeping...
<02/13/2007@18:04:34> [serv] Client Thread Shutting Down
<02/13/2007@18:04:34> [serv] Source Thread Shutting Down
<02/13/2007@18:04:34> [serv] Recieved Stat Packet
<02/13/2007@18:04:44> [serv] Server Shutdown complete.
<02/13/2007@18:04:44> [src] Relay Thread Ended for Source #1


conf file:

; Server Configuration
; ====================
PortBase=8800
; MaxUser=20
; MaxBandwidth=0
; IPMaxUser=0
LogFile=steamcast.log
MimeFile=mime.types
BanFile=steamcast.ban
VipFile=steamcast.vip
ScreenLog=Yes
RealtimeLog=Yes
YPLog=Yes
PidFile=steamcast.pid
NameLookups=No
ShowLastSongs=20
ClientTimeout=30

; User Configuration
; ==================
AdminUser=admin
AdminPass=hackme

; Source Configuration
SourceMount=/live.mp3
SourceUser=xxxx
SourcePass=xxxxxx
SourceUserMax=5
; SourceRelay=audio.str3am.com:4080
; SourceDisconnectWait=10
; SourceDirectory=./content
; SourceGateway=/intro.%s
SourceBackup=/live_back.mp3
; SourceAvgBitrateLimit=128
SourceIsSC=Yes
; SourceNameFormat=%s powered by Steamcast
SourceIsDefault=Yes
; SourceIP=123.45.67.89
; SourceAuth=No
; SourceAuthMax=0
; SourceListenerTimer=0
SourcePublic=Never
; SourcePublicRelays=Yes
; SourceRawKey=rawdata
; SourceBuffUtil=100


; backup mount
SourceMount=/live_back.mp3
SourceUser=xxxx2
SourcePass=xxxxxx2
SourceUserMax=5
SourceRelay=89.248.167.7:8080
; SourceRelay=audio.str3am.com:4080
; SourceDirectory=./content
; SourceGateway=/intro.%s
; SourceBackup=/live_back
; SourceAvgBitrateLimit=128
SourceIsSC=Yes
; SourceNameFormat=%s powered by Steamcast
SourceIsDefault=No
; SourceAuth=No
; SourceListenerTimer=0
SourcePublic=Never
; SourcePublicRelays=Yes
; SourceRawKey=rawdata
; SourceBuffUtil=100



; Directory Configuration
; =======================
Directory=http://www.steamcast.com/sbin/yp.php
Directory=http://dir.xiph.org/cgi-bin/yp-cgi
User avatar
Jay
Will work for food (Administrator)
Posts: 3020
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Post by Jay »

Please note that a backup mount only works when a listener is connected to the mount when it goes down, it will never substitute a live or relay mount. The behavior is similar to the behavior of the backupfile in shoutcast.
- Jay
Lane
Posts: 154
Joined: Mon May 09, 2005 4:16 pm

Post by Lane »

ok, I'll do some extra testing. thanks for clarifying that it doesn't supply a backup mount until a listener is connected. and more to the point, a listener can't connect until a direct source is feeding the mount. I would personally find the behaviour to be more useful if it did present the backup mount when a request was made to a mount that did not yet have a source feed.

What I'm ultimately looking for is the ability to connect and disconnect at my leisure, while supplying a backup source if I'm not there. I'd like the bookmark in people's listening clients to be the main default mount, and that's what I want to supply on a web page. I think I can work with what you have though, and achieve something close to that. I'll test that next. Thanks for the feedback.
User avatar
Jay
Will work for food (Administrator)
Posts: 3020
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Post by Jay »

yes, and I considered this while designing the system but it conflicts with YP design.
- Jay
Lane
Posts: 154
Joined: Mon May 09, 2005 4:16 pm

Post by Lane »

Would it be easy (and might you consider) having it work that way with YP disabled? You'd have at least the one fan over here! :)
Lane
Posts: 154
Joined: Mon May 09, 2005 4:16 pm

Post by Lane »

a little follow up. I can make it work the way I want by making use of a relay into it. sort of like this

on port 8000
mount (a relay to 8100)

on port 8100
main mount is for me
back mount is a relay of another source.

I need to initially connect on 8100 main mount, then the relay on 8000 picks it up and holds it. I can come and go.

One thing I notice, and I'm curious if it's by design or not. The Name doesn't change when it puts the relay through. The name I sent when I connected to the main mount on 8100 passes through on relay 8000. When I disconnect from the main mount, and the relay switches in, the Name doesn't change to whatever the name is on the relay. In all cases, the SourceNameFormat contains a %s, sometimes with extra data to brand that mount. (I'm wondering if the Name is only sent during an initial connect?)

I can always run some external script to update the meta I guess. Overall, this is workable for me. Your work is much appreciated Jay!
User avatar
Jay
Will work for food (Administrator)
Posts: 3020
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Post by Jay »

yea that will certainly do what you want. The name can't change because the icy protocol doesn't allow you to adjust the name of a stream midstream. Meta data would be the only adjustable variable.
- Jay
Post Reply