Comment 6 for bug 883374

Revision history for this message
RJ Skerry-Ryan (rryan) wrote : Re: [Bug 883374] Re: Shoutcast calls sleep()

I'm not talking about a busy loop. EngineShoutcast is asked to do work
every .. 65k samples or so. Whatever the size of the sidechain buffers are.
Simply set a state variable that says it's waiting until libshout is ready
for it. Each time through, via process() switch on the state variable. If
it's in the wait state, check if the appropriate duration has elapsed. If
so, go from wait to ready and process the buffer.

The sidechain thread is not exclusive to shoutcast. You can't just sleep it
because that blocks all other sidechain features.

On Fri, Jan 6, 2012 at 8:18 PM, Phillip Whelan <email address hidden>wrote:

> How exactly should we go into a 'wait state'? The sleep(2) system call
> is supposed to do that. Switching to some other work until the delay is
> up is a much better solution, as long as we can guarantee we will
> continue to transmit before the delay is up. Going into a busyloop in
> userspace is, IMO, the worst idea; it can pin a CPU completely and it
> will definitely cause problems for the scheduler (which is already being
> overloaded with our 16+ threads).
>
> --
> You received this bug notification because you are a member of Mixxx
> Development Team, which is subscribed to Mixxx.
> https://bugs.launchpad.net/bugs/883374
>
> Title:
> Shoutcast calls sleep()
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/mixxx/+bug/883374/+subscriptions
>