Jørgen Elgaard Larsen
2004-Aug-06 14:23 UTC
[icecast] Server drops client - problem with IceS?
Hi there, I just joined the list and have a question on one of the earlier posts: On Oct 28 2003, Ricardo wrote that his server diconnected his clients. I have the exact same problem - and a bit of testing/analysis. <p>I am running an Icecast server and IceS on the same linux box. IceS is encoding a live stream from my sound card. After a while of listening (approx 2 mins) from another box, the server disconnects the client. The log says: DBUG format/format_generic_write_buf_to_client Client had recoverable error -1 DBUG format/format_generic_write_buf_to_client Client had recoverable error -1 [repeats some 50 to 250 times, once or twice a second] DBUG source/source_main Client has fallen too far behind, removing DBUG source/source_main Client removed <p>I read Karl's earlier explanaion on that:> this indicates that the amount of data due to go to that client has > grown too large. There are several possibilities for this, one is > stalls on the network, maybe TCP flow control kicking in or an actual > outage/misconfiguration. Another is buggy clientThat was my initial thoughts, too. There is, however, a couple of twists on that in my case: 1) When I use the same client to listen to an Ogg file served directly by the Icecast server (using "fileserve"), there is no such problem. This should more or less exclude network issues. 2) The problem is experienced using another client on another OS (Winamp 5 on Windows 98 instead of ogg123 og Linux). This does not entirely exclude the client, but close. 3) Changing bitrate of the stream does not seem to change very much regarding (the client may hold on a few seconds more on a ridiculous low bitrate). 4) It seems that the problem lies in that the client plays the stream too slow compared to the recording. Sample rate is the same all the way through, but maybe it goes wrong somewhere? I notice, that ogg123's input and output buffers are at 100% most of the time - the input buffer gradually crawls from 10 to 100%. When it reaches 100%, the log errors begin on the server. If I playback at approx. 9% higher speed, it works fine, e.g. ogg123 -x 100 -y 92 http://my.server:8765/mystream.ogg - except for the resulting small clicks in the audio, of course :-) By doing this, ogg123's input buffer stays at about 10%. 5) When I change IceS to take input from a playlist instead of from the sound card, the problem goes away and ogg123's buffers drops to 25/75% 6) I just recorded a WAV file on the server using arecord and then encoded it using oggenc. When played as a file (using "fileserve"), it works fine. Played as playlist through IceC, it also works fine, with ogg123 buffers at 25/75% My conclusion is that the problem probably lies with IceS - presumably in either reading from the (alsa) sound driver or in the Ogg encoding of the PCM input. Somewhere on the way it must be messing up the sample rate, I guess. <p>Any thoughts on that? <p><p>----------------- Details about my setup: Server: Pentium II, 800MHz running Debian GNU/Linux (woody). No X. Kernel 2.4.18 (custom build) Icecast 2.0.0 downloaded a couple of days ago IceS 2.0-Beta4 - both build from tarballs. Recording from a Soundblaster 128 PCI using ALSA drivers. The server runs at loads about 0.4 when running both icecast and iceS Client1: Pentium IV laptop Red Hat Linux 9, kernel 2.4.20 (Red Hat version) onboard i810 sound card, OSS driver ogg123 from vorbis-tools 1.0 - installed via RPM's a couple of days ago Client2: Same laptop, running Win98SE Winamp 5, downloaded today Network: 100Mbit LAN ------------------- Hope you have some ideas on this. <p><p>Sincerely, Jørgen Elgaard Larsen IT Manager University Radio of Copenhagen Denmark --- >8 ---- List archives: http://www.xiph.org/archives/ icecast project homepage: http://www.icecast.org/ To unsubscribe from this list, send a message to 'icecast-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
On Fri, 30 Jan 2004, Jørgen Elgaard Larsen wrote:> in either reading from the (alsa) sound driver or in the Ogg encoding of > the PCM input. Somewhere on the way it must be messing up the sample > rate, I guess.Does your playback match the sound that you are encoding? Perhaps share your config file so we can help troubleshoot this. Geoff. <p>--- >8 ---- List archives: http://www.xiph.org/archives/ icecast project homepage: http://www.icecast.org/ To unsubscribe from this list, send a message to 'icecast-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Jørgen Elgaard Larsen
2004-Aug-06 14:23 UTC
[icecast] Server drops client - problem with IceS?
Geoff Shang wrote:> Does your playback match the sound that you are encoding? Perhaps share > your config file so we can help troubleshoot this.I would think so, but I might have missed something. <p>Here is my IceS2-config - with this one, the problem manifests after 2 minutes of playing, and the client is disconnected after 3 minutes. I have tried tweaking bitrate, quality, samplerates etc. While it does have _some_ effect on how long the client stays connected, it is not much. <p><?xml version="1.0"?> <ices> <background>1</background> <!-- run in background? --> <logpath>/var/log/icecast</logpath> <!-- where logs, etc go. --> <logfile>ices.log</logfile> <loglevel>4</loglevel> <!-- 1=error,2=warn,3=info,4=debug --> <consolelog>0</consolelog> <!-- set this to 1 to log to console of file above --> <pidfile>/var/run/ices.pid</pidfile> <stream> <!-- metadata used for stream listing (not currently used) --> <metadata> <name>Test of Icecast</name> <genre>Test</genre> <description>Testing 1,2,3</description> </metadata> <input> <module>alsa</module> <param name="rate">44100</param> <param name="channels">2</param> <!-- number of channels --> <param name="device">hw:0,0</param> <!-- audio device --> <param name="metadata">1</param> <param name="metadatafilename">/etc/icecast/meta</param> </input> <instance> <hostname>localhost</hostname> <port>9090</port> <password>xxxx</password> <mount>/test4.ogg</mount> <reconnectdelay>1</reconnectdelay> <reconnectattempts>50</reconnectattempts> <maxqueuelength>180</maxqueuelength> <encode> <managed>0</managed> <nominal-bitrate>128000</nominal-bitrate> <!-- bps. e.g. 64000 for 64 kbps --> <!-- bps. e.g. 32000 optimal for lesser cards --> <samplerate>44100</samplerate> <!-- 220500 optimal for older cards --> <channels>2</channels> <quality>3</quality> </encode> </instance> </stream> </ices> <p>Sincerely, <p>Jørgen Elgaard Larsen IT Manager University Radio of Copenhagen Denmark --- >8 ---- List archives: http://www.xiph.org/archives/ icecast project homepage: http://www.icecast.org/ To unsubscribe from this list, send a message to 'icecast-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.