| View previous topic :: View next topic |
| Author |
Message |
Fjellslange
Joined: 31 Dec 2008 Posts: 7
|
Posted: Wed Dec 31, 2008 3:34 am Post subject: Is this possible? |
|
|
Greetings. I'm using icecast2 2.3.2-2 and Darkice 0.19-1 on Debian for a local streaming setup. I want the stream to never time out. Currently when silence (which can last over 30 minutes) is broadcast I have to disconnect and reconnect to the stream before hearing anything again. I tried setting
| Code: |
| <source-timeout>0</source-timeout> |
but Darkice complains about about a buffer overflow then.
Any ideas? |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Wed Dec 31, 2008 3:53 am Post subject: |
|
|
I suppose we could have a special case for 0, but just specify some huge number instead
karl. |
|
| Back to top |
|
 |
Fjellslange
Joined: 31 Dec 2008 Posts: 7
|
Posted: Wed Dec 31, 2008 5:39 am Post subject: |
|
|
| Thanks for the quick reply. When I do that the stream never prebuffers unless something is already playing. Once I start playing a track (with MPD) a little data is sent and played, then quits. The stream stops shortly thereafter. So I have to have something playing before I connect.... This happens with Audacious and mplayer, so the player doesn't seem to be at fault. |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Wed Dec 31, 2008 3:44 pm Post subject: |
|
|
If the stream stops then there has to be a reason, either icecast drops it or the source client does, check the error log. Note that the source timeout will be unaffected with silence as that means audio is still being streamed.
karl. |
|
| Back to top |
|
 |
Fjellslange
Joined: 31 Dec 2008 Posts: 7
|
Posted: Thu Jan 01, 2009 4:30 am Post subject: |
|
|
This seems to be the relevant portion of the log file:
| Code: |
[2008-12-31 20:16:38] DBUG stats/modify_node_event update node total_bytes_read (5411)
[2008-12-31 20:16:38] DBUG stats/modify_node_event update node total_bytes_sent (10272)
[2008-12-31 20:16:40] DBUG client/client_send_bytes Client connection died
[2008-12-31 20:16:40] DBUG source/source_main Client removed
[2008-12-31 20:16:40] INFO source/source_main listener count on /test.ogg now 1
[2008-12-31 20:16:41] DBUG stats/modify_node_event update node clients (2)
[2008-12-31 20:16:41] DBUG stats/modify_node_event update node listeners (1)
[2008-12-31 20:16:41] DBUG stats/modify_node_event update node listeners (1)
[2008-12-31 20:16:43] DBUG stats/modify_node_event update node total_bytes_read (5948)
[2008-12-31 20:16:43] DBUG stats/modify_node_event update node total_bytes_sent (11097)
[2008-12-31 20:16:48] DBUG stats/modify_node_event update node total_bytes_read (6485)
[2008-12-31 20:16:48] DBUG stats/modify_node_event update node total_bytes_sent (11847)
[2008-12-31 20:16:53] DBUG stats/modify_node_event update node total_bytes_read (7022)
[2008-12-31 20:16:53] DBUG stats/modify_node_event update node total_bytes_sent (12672)
[2008-12-31 20:16:58] DBUG stats/modify_node_event update node total_bytes_read (7559)
[2008-12-31 20:16:58] DBUG stats/modify_node_event update node total_bytes_sent (13497)
[2008-12-31 20:17:03] DBUG stats/modify_node_event update node total_bytes_read (8096)
[2008-12-31 20:17:03] DBUG stats/modify_node_event update node total_bytes_sent (14247)
[2008-12-31 20:17:08] DBUG stats/modify_node_event update node total_bytes_read (8633)
[2008-12-31 20:17:08] DBUG stats/modify_node_event update node total_bytes_sent (15072)
[2008-12-31 20:17:13] DBUG stats/modify_node_event update node total_bytes_read (364641)
[2008-12-31 20:17:13] DBUG stats/modify_node_event update node total_bytes_sent (336422)
[2008-12-31 20:17:13] DBUG slave/_slave_thread checking master stream list
[2008-12-31 20:17:18] DBUG stats/modify_node_event update node total_bytes_read (820651)
[2008-12-31 20:17:18] DBUG stats/modify_node_event update node total_bytes_sent (336422)
[2008-12-31 20:17:18] INFO source/send_to_listener Client 19 (192.168.21.77) has fallen too far behind, removing
[2008-12-31 20:17:18] DBUG source/source_main Client removed
[2008-12-31 20:17:18] INFO source/source_main listener count on /test.ogg now 0
[2008-12-31 20:17:18] DBUG stats/modify_node_event update node slow_listeners (1)
[2008-12-31 20:17:18] DBUG stats/modify_node_event update node clients (1)
[2008-12-31 20:17:18] DBUG stats/modify_node_event update node listeners (0)
[2008-12-31 20:17:18] DBUG stats/modify_node_event update node listeners (0) |
So the client has died, but I have no idea why. That's with Audacious. If I use mplayer the behavior is identical but the log file doesn't say the client has died, just that it's fallen behind. I have plenty of bandwidth for this too. How would I further debug? |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Thu Jan 01, 2009 12:36 pm Post subject: |
|
|
These messages do not indicate the stream is dying. They indicate that the player or the connection to the player is not sufficient, ie the the data rate of icecast to player is lesser than source client to icecast.and the buffer in icecast is now at the trigger point at which the listener is dropped.
without checking the stream myself it's hard to say, the figures reported look odd but it does depend on what you are really doing.
karl. |
|
| Back to top |
|
 |
Fjellslange
Joined: 31 Dec 2008 Posts: 7
|
Posted: Thu Jan 01, 2009 6:51 pm Post subject: |
|
|
That's the puzzling thing; typical transfer rate is about 1/3rd of my available bandwidth and the problem only happens if there is not music playing (in other words silence). As soon as there is silence the network activity goes very low; is that normal? Or should it stream at a standard rate the whole time, silence or not? That's what used to happen until I used alsamixer to choose my capture source. When resuming from silence a little data is sent, then a blip of nothing, then more data and then nothing. The player doesn't start playing and times out after that.
icecast.xml:
| Code: |
<icecast>
<limits>
<clients>3</clients>
<sources>2</sources>
<threadpool>5</threadpool>
<queue-size>524288</queue-size>
<client-timeout>30</client-timeout>
<header-timeout>15</header-timeout>
<source-timeout>10</source-timeout>
<burst-on-connect>0</burst-on-connect>
<burst-size>65535</burst-size>
</limits>
<authentication>
<!-- Sources log in with username 'source' -->
<source-password>pass</source-password>
<!-- Relays log in username 'relay' -->
<relay-password>pass</relay-password>
<!-- Admin logs in with the username given below -->
<admin-user>admin</admin-user>
<admin-password>password</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>192.168.21.2</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>8000</port>
<!-- <bind-address>127.0.0.1</bind-address> -->
</listen-socket>
<!--
<listen-socket>
<port>8001</port>
</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>-->
<!-- setting this makes all relays on-demand unless overridden, this is
useful for master relays which do not have <relay> definitions here.
The default is 0 -->
<!--<relays-on-demand>1</relays-on-demand>-->
<!--
<relay>
<server>127.0.0.1</server>
<port>8001</port>
<mount>/example.ogg</mount>
<local-mount>/different.ogg</local-mount>
<on-demand>0</on-demand>
<relay-shoutcast-metadata>0</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>
<fallback-override>1</fallback-override>
<fallback-when-full>1</fallback-when-full>
<intro>/example_intro.ogg</intro>
<hidden>1</hidden>
<no-yp>1</no-yp>
<authentication type="htpasswd">
<option name="filename" value="myauth"/>
<option name="allow_duplicate_users" value="0"/>
</authentication>
<on-connect>/home/icecast/bin/stream-start</on-connect>
<on-disconnect>/home/icecast/bin/stream-stop</on-disconnect>
</mount>
-->
<mount>
<mount-name>/test.ogg</mount-name>
</mount>
<fileserve>1</fileserve>
<!-- set the mountpoint for a shoutcast source to use, the default if not
specified is /stream but you can change it here if an alternative is
wanted or an extension is required
<shoutcast-mount>/live.nsv</shoutcast-mount>
-->
<paths>
<!-- basedir is only used if chroot is enabled -->
<basedir>/usr/share/icecast2</basedir>
<!-- Note that if <chroot> is turned on below, these paths must both
be relative to the new root, not the original root -->
<logdir>/var/log/icecast2</logdir>
<webroot>/usr/share/icecast2/web</webroot>
<adminroot>/usr/share/icecast2/admin</adminroot>
<!-- <pidfile>/usr/share/icecast2/icecast.pid</pidfile> -->
<!--
<alias source="/foo" dest="/bar"/>
-->
<alias source="/" dest="/status.xsl"/>
</paths>
<logging>
<accesslog>access.log</accesslog>
<errorlog>error.log</errorlog>
<playlistlog>playlist.log</playlistlog>
<loglevel>4</loglevel> <!-- 4 Debug, 3 Info, 2 Warn, 1 Error -->
<logsize>10000</logsize> <!-- Max size of a logfile -->
<!-- <logarchive>1</logarchive> -->
</logging>
<security>
<chroot>0</chroot>
<!--
<changeowner>
<user>nobody</user>
<group>nogroup</group>
</changeowner>
-->
</security>
</icecast> |
darkice.cfg:
| Code: |
[general]
duration = 0 # duration of encoding, in seconds. 0 means forever
bufferSecs = 10 # size of internal slip buffer, in seconds
# this section describes the audio input that will be streamed
[input]
device = hw:0,0 #ALSA device
#device = /dev/dsp # OSS DSP soundcard device for the audio
sampleRate = 48000 # sample rate
bitsPerSample = 16 # bits per sample. try 16
channel = 2 # channels. 1 = mono, 2 = stereo
bitrateMode = vbr # abr, vbr or cbr
format = vorbis # format of the stream: ogg vorbis
quality = 1.0 #only used for vbr and cbr
bitrate = 448 # bitrate for local streaming
#bitrate = 192 # bitrate for remote streaming
server = localhost # host name of the server
port = 8000 # port of the IceCast2 server, usually 8000
password = pass # source password to the IceCast2 server
mountPoint = test.ogg # mount point of this stream on the IceCast2 server
name = whatever
# name of the stream
description = please work # description of the stream
url = http:// # URL related to the stream
genre = Metal # genre of the stream
public = no # advertise this stream? |
Please be so kind as to point out anything stupid I'm doing in the listings above. Suppose a reinstall of icecast2 is worth a shot too. |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Thu Jan 01, 2009 8:15 pm Post subject: |
|
|
make sure the bitrate of 448 is not confusing things, I'd use ogg123 to check the ogg data stream to make sure it's what you expected.
karl. |
|
| Back to top |
|
 |
Fjellslange
Joined: 31 Dec 2008 Posts: 7
|
Posted: Fri Jan 02, 2009 9:36 am Post subject: |
|
|
Noticed that right after posting. Didn't solve anything and it turns out it's valid to have both a quality and bitrate when using CBR or VBR with Vorbis. Also downgraded Icecast to the stable version, but that didn't help either.
So on to a fun night of troubleshooting... tried streaming through VLC - that solves the problem of getting sound after resuming but starting is still a problem. Tried with gstreamer and it's the same issue.
| Code: |
[u@ark]-(~)$ gst-launch-0.10 -t playbin uri=http://manger:8000/test.ogg
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
FOUND TAG : found by element "source".
organization:
genre: Metal
location:
FOUND TAG : found by element "vorbisdec1".
encoder: Xiph.Org libVorbis I 20070622
encoder version: 0
audio codec: Vorbis
nominal bitrate: 448000
bitrate: 448000
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstAudioSinkClock
Got EOS from element "playbin0".
Execution ended after 17493191137 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
FREEING pipeline ...
|
So there is a bug in libneon which Audacious uses (and I guess mplayer too?), but none of the four players start the stream correctly unless it's already in progress..... hmmmmmm.
Does EOS mean End Of Stream? ogg123 fails to start (and resume); flashes something about EOS but it disappears too fast for me to copy. The only other info is this at the beginning of playing:
| Code: |
| --- Hole in the stream; probably harmless |
Player summary:
Audacious (libneon bug): doesn't start or resume correctly
mplayer: doesn't start or resume correctly
ogg134: doesn't start or resume correctly
VLC: doesn't start correctly, no problems resuming
gstreamer: doesn't start correctly, no problems resuming |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Fri Jan 02, 2009 11:51 am Post subject: |
|
|
If you skip over things and don't state your goals then you'll lose people.
According to what you have posted, 448kbps is what you wanted not quality 1.0 (which is around 80kbps for those settings)?
EOS is valid, you should receive them at the end of a chain. A typical example is just before a new track or when metadata updates occur.
karl. |
|
| Back to top |
|
 |
Fjellslange
Joined: 31 Dec 2008 Posts: 7
|
Posted: Fri Jan 02, 2009 12:24 pm Post subject: |
|
|
Sorry if I'm unclear. Got a nasty case of gunk in the head so just ask if there's info you need or something I'm neglecting.
Goal is to play the stream without having to restart it (due to being dropped if there's not active noise being broadcast, apparently). Currently if I start the stream before any music is playing it drops and some players drop if there is too much silence between songs. Not sure what's going on since it was working a month ago  |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Fri Jan 02, 2009 12:55 pm Post subject: |
|
|
according to the log you posted, the stream doesn't drop, but there are 2 listeners that disconnect. The first because they disconnected, the second because they had lagged so far behind that icecast had to drop them.
What I'm wondering is that if you are dropping from an average of around 448kbps to just above 0 with silence then maybe you are confusing some players because a prebuffer full of silence will take some time to playback. Maybe you need a minimum bitrate for those cases.
Ask yourself, what is your target bitrate/quality setting, I've asked this a couple of times now.
karl. |
|
| Back to top |
|
 |
Fjellslange
Joined: 31 Dec 2008 Posts: 7
|
Posted: Sat Jan 03, 2009 10:09 am Post subject: |
|
|
I see what you're getting at now must be cuz a few pints of gunk have drained out of my nose. I tried lowering the bitrate (commenting out quality) and that seems to solve the problem. Seems a bit of a waste though; all that unused bandwidth sitting there, so how would I set a minimum bitrate? |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Sat Jan 03, 2009 4:13 pm Post subject: |
|
|
I cannot comment on the usage of bandwidth, most people are more concerned about paying for the bandwidth for the number of listeners they want.
Whether you want to specify bitrate or quality is up to you, it's just both that does not make sense. As for the minimum bitrate setting, you'll have to consult the source client documentation.
karl. |
|
| Back to top |
|
 |
|