Hi Owen, I think you mentioned you're using an RT kernel, which is important because we recently found out that Linux has an insane thread priority policy unless you're running as root on a regular kernel, or have special privileges setup. Maybe RJ can elaborate a bit more here, but the short version is that Mixxx is unable to lower the priority of it's own threads on Linux without doing some tweaking of system config files.
More below: On Sun, Feb 7, 2010 at 10:10 AM, Owen Williams <[email protected]> wrote: > I made a little progress. I found that if I use the asoundrc from this > bug (https://bugs.launchpad.net/mixxx/+bug/259566), I can use the ALSA > driver with a latency of 5ms. It doesn't crash, and I don't get any > dropouts. I'm guessing the overhead of having Mixxx talk through > Portaudio which then talks to JACK is just a little too much to get > latency down that far. > > I suspect if I want to get really low latencies with jack turned on, I'd > have to write a native JACK backend for mixxx that avoids portaudio. > The reason I prefer JACK is I can pipe Mixxx's output to a whole bunch > of jack-racks with custom effects I've created. I highly doubt the JACK-PortAudio code interface is the reason why you can't get lower latencies. Do some profiling with gprof and you'll see we spend most of our CPU time in the EQ code and elsewhere. If you want to improve your latency in Mixxx, optimize those codepaths. But whatever you do, don't write a single line of code in the name of improving latency without having good profiling data on Mixxx's performance beforehand. > > Has anybody thought about coding a native JACK backend before, or is > there a reason I shouldn't bother? Otherwise I'll take a crack at it. > Mixxx used to have backends for JACK, ALSA, OSS, MME, DirectSound, ASIO, CoreAudio, PortAudio, and RTAudio before. Do you see the problem? Having native backends was completely unmaintainable for us, and this became obvious once I had to modify Mixxx to support both soundcard input and support for multiple soundcards. The more codepaths you have, the harder it becomes to provide quality assurance and trace bugs in your code, and this is why we ditched all these native backends. We reduced the amount of code by at least a factor of 6, and significantly increased functionality when we switched to solely using PortAudio. One of our long term goals from a code maintainability point of view is to reduce the amount of platform-specific code inside Mixxx, so for this reason, we're not interested in reintroducing a native JACK backend into Mixxx. However, if you want to just give it a shot as a learning exercise, I'd be happy to mentor you on the project. The general outline of what you'd need to implement is just a SoundDeviceJACK class which subclasses SoundDevice. You'd also need to make some minor modifications to SoundManager so that it actually creates these SoundDeviceJACK objects instead of SoundDevicePortAudio objects. Thanks, Albert ------------------------------------------------------------------------------ The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com _______________________________________________ Mixxx-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mixxx-devel
