Cantabile Development Blog

Follow the development of music software Cantabile

Articles | Full Index | RSS Feed


Audio player much smoother

Slowly ironing out the audio file player:

  • Fixed all memory leaks and corruptions.
  • The read-ahead buffers are now being cleared out on stop.
  • The read-ahead buffers are now being filled by a worker thread pool.

So it now runs alot smoother. Although I've always known that the audio thread should never do disk I/O, it's been interesting over the last few days to see in practice why.

Doing disk I/O on the audio thread caused Cantabile's load meter to jump very erratically between about 15% and 40% as the audio engine was stalled while the disk was read.

Moving that code onto the worker threads completely resolved that, with CPU load now sitting at a very steady 3-5% while playing an mp3 file - and that's in a debug build.

Testing sample rate conversion is next...

Posted on May 9, 2008

Share This

Leave A Comment

All comments will be reviewed for spam before being displayed.