Question - scratchy audio
Hi,
Having (at the moment) failed to get the ALSA realtime/abs queueing working, I've resorted to having my app spit out direct events, and things are working reasonably well.
However, I've got a problem, where I'm getting intermittent 'scratch'/'pop' noises (sounds a bit like a dodgy jack or lead).
Any ideas what could be causing this?
Signature · 10 lines
Kind regards David ------------------------------------------------------- This SF.Net email is sponsored by Sleepycat Software Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver higher performing products faster, at low TCO. http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
Quoted 3 lines · David McNab
However, I've got a problem, where I'm getting intermittent 'scratch'/'pop' noises (sounds a bit like a dodgy jack or lead).
Any ideas what could be causing this?
For the benefit of others who may be new to alsa seq api, I'll post what I found out.
It seems that if a client process is spiking the CPU, even for short bursts, it will impact one or more other audio progs. Not sure whether the scratchiness is caused by ALSA, fluidsynth, or something else getting momentarily cpu-starved.
Solution - I optimised my (python) client app, psyco'ed the scheduler loop, and shimmed to C functions which create and dispatch the events.
It turned out that my python code was doing a lot of unnecessary object creation and dict manipulation, which was causing CPU spikes. Seems that even a spike of a couple of ms can impact the audio.
Result - instead of scratchy audio, with jerky off-time notes sounding like a garage band with a 3-day hangover, the music is now coming through clear and rhythmically tight.
Seems I won't need to bother battling with alsa queues and scheduling any more :))
Cheers
David
-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3