Discussion:
[Icecast] relay icecast to shoutcast
Iain D Mott
2005-06-03 02:37:54 UTC
Permalink
Hello List

Having great trouble relaying an icecast2 mp3 stream to a shoutcast server.
My client program successfully streams to icecast which is listening on
port 7000. I can listen to this stream with mozilla and xmms with no
problems. I can also stream my client directly to the shoutcast server but
it makes the client unstable (which is why i'm attempting a relay).

The shoutcast server is set up to relay with the relay host as:
beijing.zhongshuo.org and port: 7000. The mountpoint my client sets is
“radio”.

I'll paste below my icecast.xml page. I've tried various port permutations
and aliasing but I can't get anything to work. (xmms reports a “402
Service Unavailable”)

Hope someone can help.

Cheers, iain

the file:

<icecast>
<limits>
<clients>100</clients>
<sources>2</sources>
<threadpool>5</threadpool>
<queue-size>102400</queue-size>
<client-timeout>30</client-timeout>
<header-timeout>15</header-timeout>
<source-timeout>10</source-timeout>
<!-- If enabled, this will provide a burst of data when a client
first connects, thereby significantly reducing the startup
time for listeners that do substantial buffering. However,
it also significantly increases latency between the source
client and listening client. For low-latency setups, you
might want to disable this. -->
<burst-on-connect>1</burst-on-connect>
<!-- same as burst-on-connect, but this allows for being more
specific on how much to burst. Most people won't need to
change from the default 64k. Applies to all mountpoints -->
<burst-size>65535</burst-size>
</limits>

<authentication>
<!-- Sources log in with username 'source' -->
<source-password>mypassword</source-password>
<!-- Relays log in username 'relay' -->
<relay-password>mypassword</relay-password>

<!-- Admin logs in with the username given below -->
<admin-user>admin</admin-user>
<admin-password>mypassword</admin-password>
</authentication>

<!-- Uncomment this if you want directory listings -->

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


<!-- This is the hostname other people will use to connect to your
server.
It affects mainly the urls generated by Icecast for playlists and yp
listings. -->
<!--<hostname>localhost</hostname> -->
<hostname>beijing.zhongshuo.org</hostname>

<!-- You can use these two if you only want a single listener -->
<!--<port>8000</port> -->
<!--<bind-address>127.0.0.1</bind-address>-->

<!-- You may have multiple <listener> elements -->
<listen-socket>
<port>7000</port>
<!-- <bind-address>127.0.0.1</bind-address> -->
</listen-socket>

<!--
<listen-socket>
<port>7001</port>
<bind-address>127.0.0.1</bind-address>
</listen-socket>
-->

<!--<master-server>127.0.0.1</master-server>-->
<!--<master-server-port>8001</master-server-port>-->
<!--<master-update-interval>120</master-update-interval>-->
<!--<master-password>hackme</master-password>-->

<!--
<relay>

<server>localhost</server>
<port>7000</port>
<mount>/</mount>
<local-mount>/radio</local-mount>

<relay-shoutcast-metadata>1</relay-shoutcast-metadata>

</relay>
-->
<!-- Only define a <mount> section if you want to use advanced options,
like alternative usernames or passwords
<mount>
<mount-name>/example-complex.ogg</mount-name>

<username>othersource</username>
<password>hackmemore</password>

<max-listeners>1</max-listeners>
<dump-file>/tmp/dump-example1.ogg</dump-file>
<burst-size>65536</burst-size>
<fallback-mount>/example2.ogg</fallback-mount>
<authentication type="htpasswd">
<option name="filename" value="myauth"/>
<option name="allow_duplicate_users" value="0"/>
</authentication>
</mount>
-->

<fileserve>1</fileserve>

<paths>
<!-- basedir is only used if chroot is enabled -->
<basedir>/home/icecast</basedir>

<!-- Note that if <chroot> is turned on below, these paths must both
be relative to the new root, not the original root -->
<logdir>/log</logdir>
<webroot>/web</webroot>
<adminroot>/admin</adminroot>
<!-- <pidfile>/usr/share/icecast/icecast.pid</pidfile> -->

<!-- Aliases: treat requests for 'source' path as being for 'dest'
path
May be made specific to a port or bound address using the "port"
and "bind-address" attributes.
-->

<alias source="/" dest="/radio"/>

<!-- Aliases: can also be used for simple redirections as well,
this example will redirect all requests for
http://server:port/ to
the status page
-->
<!-- <alias source="/" dest="/status.xsl"/> -->
</paths>

<logging>
<accesslog>access.log</accesslog>
<errorlog>error.log</errorlog>
<loglevel>4</loglevel> <!-- 4 Debug, 3 Info, 2 Warn, 1 Error -->
</logging>

<security>
<chroot>1</chroot>

<changeowner>
<user>icecast</user>
<group>icecast</group>
</changeowner>

</security>
</icecast>
Iain D Mott
2005-06-03 03:37:43 UTC
Permalink
thanks - unfortunately the client software (Pd with "shoutcast~") won't
let me set "/" as a mountpoint (or "" for that matter). i've tried
aliasing with <alias source="/" dest="/radio"/> and <alias source="/radio"
dest="/"/> but no joy.

iain

PS. typo in my last email - xmms error is: "401" and not 402
you simply need to set the mount point to /
Geoff Shang
2005-06-04 01:43:19 UTC
Permalink
Post by Iain D Mott
thanks - unfortunately the client software (Pd with "shoutcast~") won't
let me set "/" as a mountpoint (or "" for that matter). i've tried
aliasing with <alias source="/" dest="/radio"/> and <alias source="/radio"
dest="/"/> but no joy.
The correct syntax is:

<alias source="/" dest="/radio"/>

Note that I think in the supplied config file, "/" is aliased to one of the
stats pages, so you'd need to delete/comment out this definition.

What happens when you try to connect to "/" manually?

Geoff.
Iain Mott
2005-06-04 23:10:50 UTC
Permalink
thanks geoff - Yes, I had disabled the <alias source="/"
dest="/status.xsl"/> in the config.

To answer your question: If the mountpoint is set to "radio.mp3" and the
host tag is set for a local broadcast. ie.:
<hostname>localhost</hostname> (for testing purposes), this is what
happens when I enter "http://localhost:7000/" into a browser: The audio
is streamed to disk under what looks like a random filename (eg
wjgol87m).

If the mountpoint is set to "radio", an error page is loaded into the
browser: "The source you requested could not be found."

In this state, entering http://localhost:7000/radio.m3u lets me listen
to the audio in xmms. But i notice the mountpoint must be named
radio.mp3 for "*.pls" file to be used.

cheers, iain
Post by Geoff Shang
Note that I think in the supplied config file, "/" is aliased to one of the
stats pages, so you'd need to delete/comment out this definition.
What happens when you try to connect to "/" manually?
Geoff Shang
2005-06-04 23:49:57 UTC
Permalink
Post by Iain Mott
To answer your question: If the mountpoint is set to "radio.mp3" and the
<hostname>localhost</hostname> (for testing purposes), this is what
happens when I enter "http://localhost:7000/" into a browser: The audio
is streamed to disk under what looks like a random filename (eg
wjgol87m).
You shouldn't enter a stream URL into your browser, because this is the
kind of thing that will happen.

The way this works is that your browser downloads a file or page, then
passes it off to the appropriate application if it can't deal with it
itself. Since a stream never ends, it will never finish downloading, and
even if it did eventually, you want to listen to it as it comes in, not
afterwoods. So that's why you use a playlist file like an .M3U or .PLS
file. This file gets downloaded and passed to your player, which opens it
and sees where the stream is. And the player then opens the stream and
plays it.
Post by Iain Mott
If the mountpoint is set to "radio", an error page is loaded into the
browser: "The source you requested could not be found."
This means that there's no stream on that mount point. If this is where
you actually want it, you'll need to check your configurations to find out
why it's not working.
Post by Iain Mott
In this state, entering http://localhost:7000/radio.m3u lets me listen
to the audio in xmms. But i notice the mountpoint must be named
radio.mp3 for "*.pls" file to be used.
It shouldn't need to be.

Anyway, all this is a bit academic. You want Shoutcast to be able to relay
your stream. Simply aliasing "/" to whatever your active mount point is
should do the trick.

Geoff.
Iain Mott
2005-06-05 01:09:50 UTC
Permalink
figured it out! I have a dynamically allocated IP address - and i was
entering a dynamic DNS name in the shoutcast server config expecting it
to be resolved. It wasn't. I entered the IP address just then and it
relays perfectly! Will follow up with the shoutcast service support to
see why my dynamic name isn't being resolved (perhaps it can't be with
shoutcast?).

re. 44.1 and stereo/mono: As well as doing streaming, my system will be
providing local playback at full bandwidth (ie. it's going to be play
44.1 material for listeners at an actual installation). My software can
support downsampling, enabling support for a number of sampling rates -
but it's a nasty sounding algorithm so i'll leave it at 44.1. The
shoutcast service (audiorealm.com) is fixed in stereo unfortunately.

Thanks for your help.

iain
Hi,
Works fine for me, both using /radio and just /
So to get the shoutcast server to relay it, just set it to relay
http://beijing.zhongshuo.org:7000 and that should work fine.
BTW: There's no way you're going to get 44.1kHz stereo sound out of a
32kbps MP3 stream. So unless you're using MP3Pro or something, you may as
well drop the sample rate and since it's being roled off anyway, you might
get better quality for your buck.
Geoff.
Robert Muchnick
2005-06-05 01:22:47 UTC
Permalink
Post by Iain Mott
figured it out! I have a dynamically allocated IP address - and i was
entering a dynamic DNS name in the shoutcast server config expecting it
to be resolved. It wasn't. I entered the IP address just then and it
relays perfectly! Will follow up with the shoutcast service support to
see why my dynamic name isn't being resolved (perhaps it can't be with
shoutcast?).
DNS means "Domain Name Service". In order to serve ANYTHING on the
Internet, you have to have a reliable -- i.e., STATIC -- IP address,
mapped forward and reverse, name to IP address and vice versa.

What you are describing for your connection is DHCP -- where you are the
client of your upstream -- and you cannot serve anything for more than the
time of your current connection, meaning your "service", whatever it is,
is at best transient.

Robert Muchnick
Xenterra.net
720-276-7917
Iain Mott
2005-06-05 01:33:29 UTC
Permalink
that's seems a shame. I'm aware of what dns is - and I was prepared for
periodic drops in transmission. My dynamic dns name is updated (when
necessary) every 10 minutes. For a variety of reasons i'm reluctant to
use a static ip for this project - but if it can't be done....
Post by Robert Muchnick
Post by Iain Mott
figured it out! I have a dynamically allocated IP address - and i was
entering a dynamic DNS name in the shoutcast server config expecting it
to be resolved. It wasn't. I entered the IP address just then and it
relays perfectly! Will follow up with the shoutcast service support to
see why my dynamic name isn't being resolved (perhaps it can't be with
shoutcast?).
DNS means "Domain Name Service". In order to serve ANYTHING on the
Internet, you have to have a reliable -- i.e., STATIC -- IP address,
mapped forward and reverse, name to IP address and vice versa.
What you are describing for your connection is DHCP -- where you are the
client of your upstream -- and you cannot serve anything for more than the
time of your current connection, meaning your "service", whatever it is,
is at best transient.
Robert Muchnick
Xenterra.net
720-276-7917
_______________________________________________
Icecast mailing list
http://lists.xiph.org/mailman/listinfo/icecast
Geoff Shang
2005-06-05 11:01:12 UTC
Permalink
Hi,

The problem you're going to have here is that it takes time for DNS changes
to propagate through the Internet, so it may take some time for the DNS
server nearest the shoutcast server to find out what your new address is
when it changes.

Geoff.
--
Geoff Shang <***@hitsandpieces.net>
Phone: +61-418-96-5590
MSN: ***@acbradio.org

Make sure your E-mail can be read by everyone!
http://www.betips.net/etc/evilmail.html

Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html
Iain Mott
2005-06-05 21:09:40 UTC
Permalink
yes - and in the end there was no problem entering a dynamic dns name as
a relay host. must have had some garbage text entered in that field -
clearing it and re-entering fixed the problem.
best, iain
Post by Geoff Shang
Hi,
The problem you're going to have here is that it takes time for DNS changes
to propagate through the Internet, so it may take some time for the DNS
server nearest the shoutcast server to find out what your new address is
when it changes.
Geoff.
Loading...