William K. Volkman
2005-Nov-13 00:28 UTC
[Icecast] 100 percent CPU utilization while sourcing a Speex stream
I mentioned in a previous post about being fooled that something was wrong because using ezstream (or any other libshout2 client) to stream a Speex file completed really quickly. Well I think the problem is that for some reason icecast 2.3.0 is not handling things well, at least not compared to the other stream formats. I see now that it is using 100% of the CPU when being sourced a Speex stream. If I source Vorbis, Theora, or MP3 streams the icecast server remains with a fairly innocuous utilization. Maybe related, most likely not, looking in libshout I'm suspicious of this code: void shout_sync(shout_t *self) { int64_t sleep; if (!self) return; if (self->senttime == 0) return; sleep = self->senttime / 1000 - (timing_get_time() - self->starttime); if (sleep > 0) timing_sleep((uint64_t)sleep); } Why is senttime being scaled by 1000, is it in different units than starttime? Suggestions welcome. William.