Skip to contentSkip to conversation

problems with ALSA and SDL

DISCUSSION Francesco Abbate 3 participants 3 messages Jan 27, 2004 – Jan 31, 2004

lore
Share & tools
lore
#0 lore raw

Hello everyone,

I've recently switched to the 2.6.x kernel and I've decided to switch to ALSA too.

I've enabled ALSA into the kernel *without* OSS emulation and I've began to manage to get things works.

Now I can say that everything works with the exception of sfxload (the program that load the soundfont for the AWE32/64) which still require OSS (emulated or not). But this is not the problem I want to discuss here.

One of the major problem I've encountered with ALSA is that it *seems* to be very CPU intensive.
In fact I've compiled the SDL library with ALSA and I've discovered that my CPU is not fast enough to run the game when the sound is anabled. The CPU get a very heavy load and the sound is badly scattered (buffer underrun I suppose).
The strange thing is that I've tried quite simple game that previously works very well with OSS. My CPU is also not so bad because it is an AMD K6 MMX 200 MHz.
I've given a glance to the ALSA code of SDL and it seems to be plain PCM playback code without any sofistication.
At beginning I was thinking that the problem was the use of "plughw" instead of "hw" but I've tried with "hw" and the situation is still the same.

So the question is :
is ALSA much more CPU intensive then OSS or there is some technical problem which cause this effect ?
why there is such difference with OSS ?

I hope I've not to switch back to OSS simply because I cannot run some *simple* games.

Signature · 10 lines
Francesco Abbate
-- 
Francesco Abbate


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
#1 lore raw
Quoted 7 lines · Francesco Abbate

One of the major problem I've encountered with ALSA is that it *seems* to be very CPU intensive.
In fact I've compiled the SDL library with ALSA and I've discovered that my CPU is not fast enough to run the game when the sound is anabled. The CPU get a very heavy load and the sound is badly scattered (buffer underrun I suppose).

This is an SDL 1.2.6 problem which has been fixed in CVS, see
http://www.libsdl.org/pipermail/sdl/2003-December/058752.html and
http://www.libsdl.org/pipermail/sdl/2004-January/058861.html .

Signature · 10 lines
Earthling Michel Dänzer      |     Debian (powerpc), X and DRI developer
Libre software enthusiast    |   http://svcs.affero.net/rm.php?r=daenzer



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
#2 lore raw
In reply to Francesco Abbate
Quoted 3 lines · Francesco Abbate

So the question is :
is ALSA much more CPU intensive then OSS or there is some technical problem which cause this effect ?

I suspect that there might be some trouble with SDL code. Can you try our tools (aplay/arecord) to verify it?

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn