SDL ALSA on arm (with uclibc)

Hi,
I have build SDL with uclibc and alsa enables on an arm device (pxa270).
SDL video is working great . However when I try to run the loopwav
sample I get a seg fault (attached strace log).
Aplay works just fine so I imagine the problems is not with alsa.
Any ideas?
Thanks
Aviv

-------------- next part --------------
A non-text attachment was scrubbed…
Name: loopwav.log
Type: application/octet-stream
Size: 19903 bytes
Desc: loopwav.log
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20070731/df55df3e/attachment.obj

Hi,
I have build SDL with uclibc and alsa enables on an arm device (pxa270).
SDL video is working great . However when I try to run the loopwav
sample I get a seg fault (attached strace log).

Any chance of a stack trace? Or failing that, you can sprinkle print
statements in SDL audio code until you figure out where it’s crashing…

See ya!
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment

More info
Alsa is 1.0.14a
In SDL_alsa_audio.c
static unsigned int (*SDL_NAME(snd_pcm_hw_params_set_rate_near))(snd_pcm_t
*pcm, snd_pcm_hw_params_t *params, unsigned int val, int *dir);
static snd_pcm_uframes_t
(*SDL_NAME(snd_pcm_hw_params_set_period_size_near))(snd_pcm_t *pcm,
snd_pcm_hw_params_t *params, snd_pcm_uframes_t val, int *dir);
static unsigned int
(*SDL_NAME(snd_pcm_hw_params_set_periods_near))(snd_pcm_t *pcm,
snd_pcm_hw_params_t *params, unsigned int val, int *dir);
The val param should be by reference &val.
After I fixed it there are no more crashes. However I still can not play any
music, there are problems in both hw and sw parameter setup.
I’ll try to look into it however I very new to alsa programming.
Aviv> ----- Original Message -----

From: sdl-bounces@lists.libsdl.org [mailto:sdl-bounces at lists.libsdl.org] On
Behalf Of Sam Lantinga
Sent: Tuesday, 31 July, 2007 19:15
To: A list for developers using the SDL library. (includes SDL-announce)
Subject: Re: [SDL] SDL ALSA on arm (with uclibc)

Hi,
I have build SDL with uclibc and alsa enables on an arm device (pxa270).
SDL video is working great . However when I try to run the loopwav
sample I get a seg fault (attached strace log).

Any chance of a stack trace? Or failing that, you can sprinkle print
statements in SDL audio code until you figure out where it’s crashing…

See ya!
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

More info
frames = SDL_NAME(snd_pcm_hw_params_set_period_size_near)(pcm_handle,
hwparams, frames, NULL);
should be changed into status =
SDL_NAME(snd_pcm_hw_params_set_period_size_near)(pcm_handle, hwparams,
frames, NULL);
Now there is a seg fault at SDL_OpenAudio
/* See if we need to do any conversion */
if ( obtained != NULL ) {
SDL_memcpy(obtained, &audio->spec, sizeof(audio->spec));
}
Aviv> ----- Original Message -----

From: sdl-bounces@lists.libsdl.org [mailto:sdl-bounces at lists.libsdl.org] On
Behalf Of Aviv Laufer
Sent: Wednesday, 01 August, 2007 15:38
To: 'A list for developers using the SDL library. (includes SDL-announce)'
Subject: Re: [SDL] SDL ALSA on arm (with uclibc)

More info
Alsa is 1.0.14a
In SDL_alsa_audio.c
static unsigned int (*SDL_NAME(snd_pcm_hw_params_set_rate_near))(snd_pcm_t
*pcm, snd_pcm_hw_params_t *params, unsigned int val, int *dir); static
snd_pcm_uframes_t
(*SDL_NAME(snd_pcm_hw_params_set_period_size_near))(snd_pcm_t *pcm,
snd_pcm_hw_params_t *params, snd_pcm_uframes_t val, int *dir); static
unsigned int (*SDL_NAME(snd_pcm_hw_params_set_periods_near))(snd_pcm_t *pcm,
snd_pcm_hw_params_t *params, unsigned int val, int *dir); The val param
should be by reference &val.
After I fixed it there are no more crashes. However I still can not play any
music, there are problems in both hw and sw parameter setup.
I’ll try to look into it however I very new to alsa programming.
Aviv

-----Original Message-----
From: sdl-bounces@lists.libsdl.org [mailto:sdl-bounces at lists.libsdl.org] On
Behalf Of Sam Lantinga
Sent: Tuesday, 31 July, 2007 19:15
To: A list for developers using the SDL library. (includes SDL-announce)
Subject: Re: [SDL] SDL ALSA on arm (with uclibc)

Hi,
I have build SDL with uclibc and alsa enables on an arm device (pxa270).
SDL video is working great . However when I try to run the loopwav
sample I get a seg fault (attached strace log).

Any chance of a stack trace? Or failing that, you can sprinkle print
statements in SDL audio code until you figure out where it’s crashing…

See ya!
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

frames = SDL_NAME(snd_pcm_hw_params_set_period_size_near)(pcm_handle,
hwparams, frames, NULL);
should be changed into status =
SDL_NAME(snd_pcm_hw_params_set_period_size_near)(pcm_handle, hwparams,
frames, NULL);

That’s because we’re targeting the 0.9 ALSA API, which works on Linux
because the library is built with versioned symbols and glibc has dlvsym().

We should probably just move to the newer API at this point, though.

–ryan.