# Problems with SDL and ALSA in Linux kernel 2.6.0-test1

**URL:** <https://discourse.libsdl.org/t/problems-with-sdl-and-alsa-in-linux-kernel-2-6-0-test1/9098>\
**Category:** SDL Development\
**Created:** [July 28, 2003, 6:21am UTC](https://discourse.libsdl.org/t/problems-with-sdl-and-alsa-in-linux-kernel-2-6-0-test1/9098 "2003-07-28T06:21:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stephen\_Anthony](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/stephen_anthony/32/2866_2.png) [@Stephen\_Anthony](https://discourse.libsdl.org/u/Stephen_Anthony)\
**Post date:** [July 28, 2003, 6:21am UTC](https://discourse.libsdl.org/t/problems-with-sdl-and-alsa-in-linux-kernel-2-6-0-test1/9098/1 "2003-07-28T06:21:01Z")

</div>

I know this is an unstable kernel, but I just wanted to let people know of  
my experiences with SDL and ALSA in the latest test kernel.

If I use SDL\_AUDIODRIVER=alsa, then games (both compiled and binary) and  
other applications become very choppy, and the framerate becomes choppy  
as well.

At first I thought it was because of the new scheduler changes, and that  
the application was hogging the CPU and causing the scheduler to swap out  
the app every now and then. But when I tried SDL\_AUDIODRIVER=dma, then  
it worked fine.

I just happened to have an application that could test various sound  
backends, which is the Atari emulator Stella that I’m working on. The  
emulator can use 3 different sound backends and 2 modes of time  
synchronization.

Specifically, if I use busy-waits (98% CPU used) and audio is OSS or ALSA  
directly, there is some occasional popping, but no choppiness. If I use  
non-busy-waits (1% CPU used) with OSS or ALSA, there is no popping at  
all.

Now, if I use the SDL audio with the ALSA backend, whether busy-wait or  
not, the sound and video is very choppy and skips a lot. But when the  
SDL audio uses DMA, everything is fine again.

I don’t know exactly what the problem is, and I’m actively researching it.  
But it seems odd that it only happens when _SDL_ uses ALSA, and not when  
a program uses the ALSA API directly.

FYI, when DMA is used, it uses the OSS emulation in ALSA, so ALSA is still  
being used, just with a different API.

I will be trying different versions of SDL, ALSA, and test kernels, and  
I’ll let you know what I find out.

Steve
