[pulseaudio-discuss] new pulseaudio client program clicks on buffer underrun and re-fill

Kirk Wolff kirk at wolffelectronicdesign.com
Sun Mar 13 20:03:15 PDT 2011


Hello list,

I've written a sound-centric application where tones are generated and
played back to the user interactively.  This is not a good candidate for
'system sounds' as the tones settings may change throughout the
interaction.  I've chosen to use the pulseaudio libraries directly to
play back the sounds, but I'm questioning whether that was a wise
decision as its not compatible with systems without pulseaudio (though
I'm willing to live with this decision, and add support for other
systems in the future by detecting which one is available).  

My application is using pulseaudio's asynchronous callbacks.  The main
technical problem I'm having is when the generated tones start and stop
playing.  I want to send tone bursts, have them complete playing, then
stop sending data to the stream.  The problem is, there are low-audio
'clicks' at the beginning and end of playback.  Whenever the buffer
underruns, there's a quiet click.  Whenever the under-run buffer is
re-filled and the stream is resumed, there's another click.  I would
like to get rid of these clicks as most people using this program will
likely be wearing headphones and it is distracting.

The code associated with sound in my app is at the link below.  Does
anyone have any suggestions?

http://morse-coach.svn.sourceforge.net/viewvc/morse-coach/trunk/morse-coach/src/morse_sound.c?view=markup

Also, does anyone have a suggestion to a 'fall-back' sound API that
would work well with my application (provides asynchronous callbacks)
and will make the app more compatible with non-pulseaudio systems (e.g.
KDE and MS Windows)?
-- 
Kirk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20110313/c4ec08ae/attachment.pgp>


More information about the pulseaudio-discuss mailing list