| View previous topic :: View next topic |
| Author |
Message |
Anonymous Guest
|
Posted: Thu Sep 14, 2006 7:59 pm Post subject: Buffer Underrun - HELP! |
|
|
Hi,
I have set up Icecast on a Windows 2003 Server. In the config file, I only modified my ports and IP address, the rest remains defaulted.
My encoder source is OGG Vorbis (located on the same machine as the server), sending an AAC+ 32kpbs stream.
I connect to the stream from separate machines (some on the LAN, some in a different city), and the stream successfully buffers, and the music begins. I played on a Mac player, as well as on a Windows Winamp.
The Problem:
On both LAN and WAN, Mac and PC, the music plays for approx 90 to 140 minutes successfully. After that time, instead of seeing the station name, I start to see "[Buffer: 0%]" repetitatively for a second each time, but the music continues to play. After 1/2 hour, the music starts to skip...and then the music stops.
Any suggestions? I turned off the client-timeout, I want to stream indefinitly to my clients. Why does the buffer slowly run out?
Thank you in advance,
BC |
|
| Back to top |
|
 |
Anonymous Guest
|
Posted: Mon Sep 25, 2006 7:32 am Post subject: |
|
|
I'm still stuck on this problem.
All clients connecting to the Icecast server eventually buffer out and the music stops playing...
ANY suggestions will be good at this point.
Thanks,
alljack6298 |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Mon Sep 25, 2006 12:41 pm Post subject: |
|
|
The only tunable setting that may help is the queue-size, some still run with 100k so you may want to increase that to 300k-500k
Check the icecast log files for why some of these listeners stopped, did icecast drop them because they were too far behind in the queue. If the source client had any issues then that would affect all listeners at once.
karl. |
|
| Back to top |
|
 |
dash123
Joined: 20 Jul 2010 Posts: 13
|
Posted: Thu Feb 16, 2012 9:59 am Post subject: |
|
|
I have same problems. Is there some new solution?
Log:
[2012-02-15 16:49:44] DBUG stats/modify_node_event update node total_bytes_sent (120334725)
[2012-02-15 16:49:44] DBUG stats/modify_node_event update node total_bytes_read (673806370)
[2012-02-15 16:49:44] DBUG stats/modify_node_event update node total_bytes_sent (97172748)
[2012-02-15 16:49:46] DBUG auth/add_listener_to_source max on /radio2 is 3000 (cur 1)
[2012-02-15 16:49:46] DBUG auth/add_listener_to_source Added client to /radio2
[2012-02-15 16:49:46] DBUG auth/add_authenticated_listener client authenticated, passed to source
[2012-02-15 16:49:46] DBUG source/source_main Client added
[2012-02-15 16:49:46] INFO source/source_main listener count on /radio2 now 2
[2012-02-15 16:49:46] DBUG stats/modify_node_event update node clients (4)
[2012-02-15 16:49:46] DBUG stats/modify_node_event update node connections (1582)
[2012-02-15 16:49:46] DBUG stats/modify_node_event update node client_connections (1572)
[2012-02-15 16:49:46] DBUG stats/modify_node_event update node listeners (2)
[2012-02-15 16:49:46] DBUG format/format_check_http_buffer processing pending client headers
[2012-02-15 16:49:46] DBUG client/client_send_bytes Client connection died
[2012-02-15 16:49:46] DBUG source/source_main Client removed
[2012-02-15 16:49:46] INFO source/source_main listener count on /radio2 now 1
[2012-02-15 16:49:46] DBUG stats/modify_node_event update node listeners (2)
[2012-02-15 16:49:46] DBUG stats/modify_node_event update node listener_connections (134)
[2012-02-15 16:49:46] DBUG stats/modify_node_event update node clients (3)
[2012-02-15 16:49:46] DBUG stats/modify_node_event update node listeners (1)
[2012-02-15 16:49:46] DBUG stats/modify_node_event update node listeners (1)
[2012-02-15 16:49:49] DBUG stats/modify_node_event update node total_bytes_read (1400197026)
[2012-02-15 16:49:49] DBUG stats/modify_node_event update node total_bytes_sent (120597892)
[2012-02-15 16:49:49] DBUG stats/modify_node_event update node total_bytes_read (673844525)
Log from mplayer:
$ mplayer http://192.168.0.101:8000/radio2
MPlayer SVN-r33094-4.4.5 (C) 2000-2011 MPlayer Team
Playing http://192.168.0.101:8000/radio2.
Resolving 192.168.0.101 for AF_INET6...
Couldn't resolve name for AF_INET6: 192.168.0.101
Connecting to server 192.168.0.101[192.168.0.101]: 8000...
Name : Test
Genre : Test
Website: http://www.radio
Public : no
Cache size set to 320 KBytes
Cache fill: 0.00% (0 bytes)
libavformat file format detected.
[ogg @ 0x2b1b050] Estimating duration from bitrate, this may be inaccurate
[lavf] stream 0: audio (vorbis), -aid 0
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 44100 Hz, 2 ch, s16le, 131.1 kbit/9.29% (ratio: 16384->176400)
Selected audio codec: [ffvorbis] afm: ffmpeg (FFmpeg Vorbis)
==========================================================================
AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
Video: no video
Position: 0 %
A:86935.5 (24:08:55.5) of 0.0 (unknown) 0.0% 3%
Cache not filling, consider increasing -cache and/or -cache-min!
Cache not filling, consider increasing -cache and/or -cache-min!
Cache not filling, consider increasing -cache and/or -cache-min!
A:86937.7 (24:08:57.6) of 0.0 (unknown) 4.1% 9%
Cache not filling, consider increasing -cache and/or -cache-min!
A:86939.5 (24:08:59.5) of 0.0 (unknown) 4.8% 8%
Cache not filling, consider increasing -cache and/or -cache-min!
A:86941.7 (24:09:01.7) of 0.0 (unknown) 5.9% 7%
Cache not filling, consider increasing -cache and/or -cache-min!
Cache not filling, consider increasing -cache and/or -cache-min!
A:86943.7 (24:09:03.7) of 0.0 (unknown) 6.9% 6%
Cache not filling, consider increasing -cache and/or -cache-min!
Cache not filling, consider increasing -cache and/or -cache-min!
Cache not filling, consider increasing -cache and/or -cache-min!
A:86944.8 (24:09:04. of 0.0 (unknown) 8.6% 4%
I tried to re-encode to different bitrate and it works, but stream is slower than original
Also i tried Ices and Darkice, both same results
Thanks. |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Thu Feb 16, 2012 1:39 pm Post subject: |
|
|
A lot of information missing really to make an assessment. Assuming the fact that it's over a LAN where bandwidth is available and CPU is not max'd out then I could check the actual data rate of the stream to see if it's as expected whether it is 128kb/s or not. A simple test for that would be curl eg
curl -o file.ogg http://....../mount.ogg
look at the current rate to see if it matches the the rate of what you expect, if not then check the stats for the bytes read against the duration.
karl. |
|
| Back to top |
|
 |
dash123
Joined: 20 Jul 2010 Posts: 13
|
Posted: Thu Feb 16, 2012 9:49 pm Post subject: |
|
|
Bandwidth is available and CPU is not not max'd out. I tried separate (meaning without snd-aloop module) Ices (Darice) and Icecast (recording from sound card) and it worked. So i am assuming problem can be only in kernel module snd-aloop which i am using to copy virtual sound card output to input.
I am using model that i play sound to standard output which point to hw:Loopback,0,0. And this sound is copied to input hw:Loopback,1,0. And from this input i am recording from ices/darkice.
Bitrate is as expected i think (64 kbit):
$ curl -o file.ogg http://192.168.0.101:8000/radio
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 140k 0 140k 0 0 13011 0 --:--:-- 0:00:11 --:--:-- 7605
100 160k 0 160k 0 0 12537 0 --:--:-- 0:00:13 --:--:-- 8446
100 168k 0 168k 0 0 11999 0 --:--:-- 0:00:14 --:--:-- 7969
100 176k 0 176k 0 0 11723 0 --:--:-- 0:00:15 --:--:-- 8381
100 184k 0 184k 0 0 11516 0 --:--:-- 0:00:16 --:--:-- 8392
100 192k 0 192k 0 0 11333 0 --:--:-- 0:00:17 --:--:-- 7724
100 200k 0 200k 0 0 11170 0 --:--:-- 0:00:18 --:--:-- 7795
100 219k 0 219k 0 0 10622 0 --:--:-- 0:00:21 --:--:-- 7562
100 274k 0 274k 0 0 9936 0 --:--:-- 0:00:28 --:--:-- 7820
I am using this .asoundrc file (and capturing from cloop at 44100):
pcm.amix {
type dmix
ipc_key 219345
slave {
pcm "hw:Loopback,0,0"
}
}
pcm.aduplex {
type asym
playback.pcm "amix"
capture.pcm "cloop"
}
pcm.cloop {
type dsnoop
ipc_key 219348
slave {
pcm "hw:Loopback,1,0"
}
}
pcm.!default {
type plug
slave.pcm "aduplex"
}
What do you think? Thanks a lot for answers! |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Thu Feb 16, 2012 10:17 pm Post subject: |
|
|
The amount seems ok there. Even the overall amount sent vs duration seems ok. The only other issue that springs to mind is a mismatch of samplerates but I cannot verify that.
karl. |
|
| Back to top |
|
 |
dash123
Joined: 20 Jul 2010 Posts: 13
|
Posted: Fri Feb 17, 2012 8:09 am Post subject: |
|
|
I found this document http://people.redhat.com/~jkysela/RHEL5/loop/BACKGROUND
There is written something about "time shift" using snd-aloop. I am assuming this is problem. What do you think?
For now i am searching for new solutions. How to play to "capture virtual device". I have no sound card, so snd-aloop was perfect solution for me. And dummy sound card not working as excepted. There is no Mix option in alsamixer, so i cannot redirect playback to capture.
Bitrate is correctly setup.
...
<input>
<module>alsa</module>
<param name="rate">44100</param>
<param name="channels">2</param>
<param name="device">cloop</param>
</input>
...
<encode>
<quality>0</quality>
<samplerate>44100</samplerate>
<channels>2</channels>
</encode>
...
Thanks. |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Fri Feb 17, 2012 2:35 pm Post subject: |
|
|
It is not something I've looked at. If the rate of the samples coming from device is less than the expected 44100 then the playback will be slowly starved so you may need to adjust the timing of the device.
karl. |
|
| Back to top |
|
 |
dash123
Joined: 20 Jul 2010 Posts: 13
|
Posted: Mon Feb 20, 2012 10:14 am Post subject: |
|
|
Thanks a lot Karl. I got it working. I think problem was in high I/O. I am coding my project on QEMU/KVM virtual machine and there is also located Icecast server. I noticed when i am not working at all, buffer is emptying slower. So i check I/O and it was quite high. Working on host computer was affecting virtual machine. CPU was not max'd out in host and virtual machine, but I/O was. I moved virtual machine to server and buffer was smiling at me
Btw how can i adjust the timing of the device? Is there some option for it in .asoundrc file? |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Wed Feb 22, 2012 1:35 pm Post subject: |
|
|
Any application can try to set the timing through the api you just have to be aware of what the hardware can actually do. The virtual machine concept is prime example of that, ie is it really going to be good enough for real time use.
karl. |
|
| Back to top |
|
 |
|