Re: just calling ALutInit(0,0) costs 20% of CPU
>It actually does pause. The snd_pcm_writei function will block until all the
>given audio data is written to the card, which can only happen at a defined
>speed (the playback frequency/sample rate).
as I see, it doesn't seem to block...
so I went to add a sleep when the state isn't AL_PLAYING
the sample rate is always 48000
>Yes, that behavior's normal. Even if no sources are playing, something still
>needs to be written to the sound card (usually silence).
>However it taking up 20% CPU, while not doing anything, isn't normal. What
>kind of CPU do you have? Also, what sound card, and are you using pulseaudio?
>Are you doing anything else in the app that could be taking up that much?
my CPU is a dual Core 2,4 Ghz (a DELL XPS1330) so I just don't understand,
graphic card is a 8400 NVIDIA, card sound is integrated
and yes I'm using PulseAudio, even if I don't know much about it...
but PulseAudio uses 40 % of my CPU when my app is using 20% for the sound...
I deeply checked that the 20% CPU comes from this thread going on without any blocking...