Re: ALSA processor usage is too high

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Adam Rosenberg wrote:
> On Fri, Nov 5, 2010 at 10:31 AM, Clemens Ladisch <clemens@xxxxxxxxxx> wrote:
> > How much CPU does "aplay -D hw -t raw -f dat /dev/zero" use?
> 
> I do not know how to calculate CPU usage for a given process.

The time utility (if you have it) measures both elapsed and actually
used CPU time.

> For the audio playback I am polling the streams using
> snd_pcm_avail_update() and then writing the number of frames available
> using snd_pcm_writei().

And what does your program do when avail_update returns 0 frames?

> I am able to add aplay for testing so I used your command to open the
> 8 streams, removed the audio processing from my application, and ran
> the test again.  The result was 4 minutes and 35 seconds, which is
> basically the same as the result from the test within my application
> and much too slow.

You cannot write data faster than it's playing; the audio ring buffer
has a finite size.

You would have a problem if the processing and/or the driver would
make everything so slow that you wouldn't be able to write new data
to the device fast enough, which would result in an buffer underrun.
Does this actually happen?


Regards,
Clemens
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel


[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux