Re: [AD] Alsa driver hogs CPU

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On January 8, 2004 05:40 am, Garth wrote:
> Thomas Fjellstrom wrote:
> > Ok, I'm not promissing anything, but there are several ways in which to
> > interface with the alsa library.. Polled, shm, the pcm_write functions,
> > and seemingly combinations there of... I'll might try and see what will
> > fits best with allegro's model... And if nothing comes out of that, I'll
> > just try and fix the current driver, or vice-versa.
>
> Hi,
>
>
> I've just noticed that SDL has just had a simalar fix listed on the SDL
> Page.
>
> http://www.libsdl.org/cvs.php
>
>  From reading it it looks like the issue is due to the continue statment
> after (ret == -EAGAIN) which means it busy loops until it can write. The
> solution they list is to nanosleep.
>
> But if we're going to loop until we can write why not use blocking
> writes? Or use select with non-blocking?
>
> http://www.libsdl.org/pipermail/sdl/2003-December/058752.html
>
> Anyway just a suggestion if it's any help, from a allegro-dev lurker

I have a potential fix already.. infact I gave a patch to Elias to test just 
before christmas, which reduced CPU usage on my machine to 0ish, but only 
helped it on Elias's (IIRC)...

So I probably still have some twiddling to do.

> Laters
>
> Garth
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Perforce Software.
> Perforce is the Fast Software Configuration Management System offering
> advanced branching capabilities and atomic changes on 50+ platforms.
> Free Eval! http://www.perforce.com/perforce/loadprog.html

-- 
Thomas Fjellstrom
tfjellstrom@xxxxxxxxxx
http://strangesoft.net





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/