Icecast Streaming Media Server Forum Index Icecast Streaming Media Server
Icecast is a Xiph Foundation Project
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Icecast2 + Ices2 on FreeBSD: stream falls behind by sev mins

 
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server
View previous topic :: View next topic  
Author Message
lanjoe9
Guest





PostPosted: Mon Oct 10, 2005 12:58 am    Post subject: Icecast2 + Ices2 on FreeBSD: stream falls behind by sev mins Reply with quote

Hello, I'm using Icecast2 and Ices2 on FreeBSD, from ports, and I noticed when I use the Open Sound input module, the music received by the clients is several minutes behind. At times even two medium songs behind (I use xmms on the ices2 server and set the mixer to record from "vol").

I don't want that to because it loses synchronization with the metadata.

What can I do about it?

Thanks in advance Smile
Back to top
lanjoe9
Guest





PostPosted: Mon Oct 10, 2005 1:32 am    Post subject: buffering? Reply with quote

I think it may be some IceS2 internal buffering issue. I'm using XMMS on the listening client side, I've set up the receiving buffer to be only 10kB with a pre-buffering of 2.5 kB and I still get the 4+ minute delay, it also skips quite a lot. I'm only streaming from one computer to another via wi-fi, nominal bitrate is 64000, and I've noticed IceS2 is using more than 115 MB of memory!
Back to top
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Mon Oct 10, 2005 1:47 am    Post subject: Reply with quote

A consistently increasing memory usage would indicate that the timing is out somewhere, maybe a mismatch between your input samplerate vs your encode samplerate. I can only guess as we have no way of knowing what your config or error log says.

karl
Back to top
View user's profile Send private message Send e-mail Visit poster's website
lanjoe9
Guest





PostPosted: Mon Oct 10, 2005 2:33 am    Post subject: more info Reply with quote

Sorry, here it goes:
Quote:

--- IceS2 log
%cat /var/log/ices/ices.log
[2005-10-09 21:30:24] INFO ices-core/main IceS 2.0.1 started...
[2005-10-09 21:30:24] INFO input-oss/oss_open_module Opened audio device /dev/dsp at 2 channel(s), 44100 Hz
[2005-10-09 21:30:24] INFO input-oss/oss_open_module Starting metadata update thread
[2005-10-09 21:30:24] INFO signals/signal_usr1_handler Metadata update requested
[2005-10-09 21:30:24] DBUG metadata/metadata_thread_signal reading metadata from "/sea4/home/lanjoe9/sitiopersonal/sallyradio/metadata"
[2005-10-09 21:30:24] INFO metadata/metadata_thread_signal tag 1 is artist=Wind Waker
[2005-10-09 21:30:24] INFO metadata/metadata_thread_signal tag 2 is title=Dragon Roost Island / SallyRadio
[2005-10-09 21:30:24] INFO metadata/metadata_thread_signal Updating metadata
[2005-10-09 21:30:24] INFO encode/encode_initialise Encoder initialising in VBR mode: 2 channels, 44100 Hz, nominal 64000[2005-10-09 21:30:24] INFO encode/encode_initialise Encoder initialising in VBR mode: 2 channels, 44100 Hz, nominal 180000
[2005-10-09 21:30:24] INFO stream/ices_instance_stream Connected to server: 127.0.0.1:8001/anime-internet.ogg
[2005-10-09 21:30:24] DBUG encode/encode_clear Clearing encoder engine
[2005-10-09 21:30:24] INFO encode/encode_initialise Encoder initialising in VBR mode: 2 channels, 44100 Hz, nominal 64000[2005-10-09 21:30:24] INFO stream/ices_instance_stream Connected to server: 127.0.0.1:8001/anime-LAN.ogg
[2005-10-09 21:30:24] DBUG encode/encode_clear Clearing encoder engine
[2005-10-09 21:30:24] INFO encode/encode_initialise Encoder initialising in VBR mode: 2 channels, 44100 Hz, nominal 180000
[2005-10-09 21:31:36] INFO signals/signal_usr1_handler Metadata update requested
[2005-10-09 21:31:36] DBUG metadata/metadata_thread_signal meta thread wakeup
[2005-10-09 21:31:36] DBUG metadata/metadata_thread_signal reading metadata from "/sea4/home/lanjoe9/sitiopersonal/sallyradio/metadata"
[2005-10-09 21:31:36] INFO metadata/metadata_thread_signal tag 1 is artist=Angelic Layer
[2005-10-09 21:31:36] INFO metadata/metadata_thread_signal tag 2 is title=Be My Only Angel / SallyRadio
[2005-10-09 21:31:36] INFO metadata/metadata_thread_signal Updating metadata
---- IceS2 Config
%cat ices.xml
<?xml version="1.0"?>
<ices>
<background>1</background>
<logpath>/var/log/ices</logpath>
<logfile>ices.log</logfile>
<logsize>2048</logsize>
<loglevel>4</loglevel>
<consolelog>0</consolelog>
<pidfile>/var/run/ices.pid</pidfile>
<stream>
<metadata>
<name>Anime y más</name>
<genre>l33t</genre>
<description>Audio de varias series de anime, videojuegos y uno que otro colado</description>
<url>http://sally.mexinetica.com:8000/</url>
</metadata>
<input>
<module>oss</module>
<param name="rate">44100</param>
<param name="channels">2</param>
<param name="device">/dev/dsp</param>
<param name="metadata">1</param>
<param name="metadatafilename">/sea4/home/lanjoe9/sitiopersonal/sallyradio/metadata</param>
</input>
<instance>
<hostname>127.0.0.1</hostname>
<port>8001</port>
<password>sally009</password>
<mount>/anime-internet.ogg</mount>
<reconnectdelay>2</reconnectdelay>
<reconnectattempts>10</reconnectattempts>
<encode>
<nominal-bitrate>64000</nominal-bitrate>
<samplerate>44100</samplerate>
<channels>2</channels>
</encode>
</instance>
<instance>
<hostname>127.0.0.1</hostname>
<port>8001</port>
<password>sally009</password>
<mount>/anime-LAN.ogg</mount>
<reconnectdelay>5</reconnectdelay>
<reconnectattempts>10</reconnectattempts>
<encode>
<nominal-bitrate>180000</nominal-bitrate>
<samplerate>44100</samplerate>
<channels>2</channels>
<hidden>1</hidden>
</encode>
</instance>
</stream>
</ices>

---- Sndstat
cat /dev/sndstat
FreeBSD Audio Driver (newpcm)
Installed devices:
pcm0: <Crystal Semiconductor CS4281> at memory 0xdc000000 irq 10 kld snd_cs4281 (1p/1r/2v channels duplex default)


I'll try to get some info about the rate used by the soundcard then...
Back to top
lanjoe9
Guest





PostPosted: Mon Oct 10, 2005 3:02 am    Post subject: doh Reply with quote

So far I've tried 44100 and 48000, but IceS keeps getting fatter and fatter Sad
VChans do not seem to be an issue, I've disabled them an it's still the same...
Back to top
Lanjoe9
Guest





PostPosted: Mon Oct 10, 2005 3:06 am    Post subject: sndstat Reply with quote

Managed to extract more details from sndstat:
Quote:

sally# cat /dev/sndstat
FreeBSD Audio Driver (newpcm)
Installed devices:
pcm0: <Crystal Semiconductor CS4281> at memory 0xdc000000 irq 10 kld snd_cs4281 (1p/1r/0v channels duplex default)
[pcm0:play:0]: spd 44100, fmt 0x10000010, flags 0x00003030, 0x00000000, pid 41624
interrupts 5918, underruns 2, ready 131072
{userland} -> feeder_root(0x10000010) -> {hardware}
[pcm0:record:0]: spd 44100, fmt 0x10000010, flags 0x00000000, 0x00000000
interrupts 0, overruns 0, hfree 8192, sfree 131072
{hardware} -> feeder_root(0x10000010) -> {userland}
Back to top
MikeS
Code Warrior
Code Warrior


Joined: 29 Jun 2005
Posts: 73
Location: Barcelona, Spain

PostPosted: Mon Oct 10, 2005 9:16 am    Post subject: Re: Icecast2 + Ices2 on FreeBSD: stream falls behind by sev Reply with quote

lanjoe9 wrote:
Hello, I'm using Icecast2 and Ices2 on FreeBSD, from ports, and I noticed when I use the Open Sound input module, the music received by the clients is several minutes behind. At times even two medium songs behind (I use xmms on the ices2 server and set the mixer to record from "vol").

I don't want that to because it loses synchronization with the metadata.

What can I do about it?

Thanks in advance :)


Most of this latency is probably in icecast (if you have burst-on-connect enabled), and in your listening client, rather than in ices2 itself. IceS2 will cause some increase in latency, but it will be small compared to the others.

Note that metadata will stay in perfect synchronisation regardless, since it's sent from ices2 with the data, so you don't need to worry about that part.

Mike
Back to top
View user's profile Send private message Send e-mail
lanjoe9
Guest





PostPosted: Tue Oct 11, 2005 12:48 am    Post subject: doh Reply with quote

Hi. Thank you for your help, however I've noticed several things:

1) Metadata doesn't stay in sync at all...
2) An 8 minute delay (after half an hour or so of streaming) is not normal at all. It's not an Icecast problem, because when I stream using IceS2 in playlist mode, I see no problems at all (no huge RAM usage -- stays between , decent delay of ~10 seconds).
3) I've set up XMMS to use a 10 kB cache. The problem definitely resides in IceS, and when capturing from OSS (/dev/dsp).

I've just read a post from another person who seems to have the same problem (at least in RAM usage), so I think we definitely have hit a bug...
Back to top
lanjoe9
Guest





PostPosted: Tue Oct 11, 2005 12:50 am    Post subject: Re: doh Reply with quote

lanjoe9 wrote:
... (no huge RAM usage -- stays between , decent delay of ~10 seconds)....


I meant to say, IceS stays between 7 and 9 MB when using playlists, while when capturing from /dev/dsp, IceS after about an hour has used up 120+ MB easily.
Back to top
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Tue Oct 11, 2005 2:09 am    Post subject: Reply with quote

nothing seems incorrect from the xml or log file, but the nature of the problem would tend to indicate that either the input is running too fast or the backend threads are not emptying quick enough. First thing to check is that there is no resource starvation like the CPU being max'd out, the TCP should be ok as it's localhost

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Anonymous
Guest





PostPosted: Tue Oct 11, 2005 6:02 am    Post subject: Starvation.. Reply with quote

Ok, that seems to be the case.

I noticed the computer was completely busy all the time, so I recompiled libvorbis, libshoutcast2 and ices2 with -O2 and march=pentium3 (supposedly faster), put XMMS on the most basic X session I could set up.

Now it always has 15% or more in "idle", tipically 22%, and IceS does seem to behave (After all, the computer is only a pentium 3 @ 800 MHz).

Thanks a lot, I definitely wasn't considering the implications of doing 2 encodings at the same time...

I'll leave it running the whole night and I'll see what's up in the morning..
Back to top
Anonymous
Guest





PostPosted: Wed Oct 12, 2005 2:31 am    Post subject: Problem solved Reply with quote

Yep, that definitely was it.
I left it running "all night" (5 hours) and when I woke up to go to school I checked back.

Memory was still between 7 and 9 MB, so that's it, I need a faster machine for IceS or leave the computer exclusively dedicated to IceS2/Icecast...

Ok, I've decided. I want to have a go at SMP!
P3 800 MHz processors shouldn't be too expensive nowadays....
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
subRebel style by ktauber