alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* Random process lockup on ARM board:   alsa-lib-1.0.25, FUTEX_WAIT_PRIVATE
@ 2012-02-16 12:01 Jonathan Andrews
  2012-02-17 21:04 ` Jonathan Andrews
  0 siblings, 1 reply; 18+ messages in thread
From: Jonathan Andrews @ 2012-02-16 12:01 UTC (permalink / raw)
  To: alsa-devel

Sorry all me again.

I've written a program that picks up UDP broadcast packets containing
audio from a number of sources, mixes it together and presents it to
alsa for playback.

I'm experiencing random freezes.  I cant reproduce then running the
process under strace as the process on the ARM board slows down to the
point it underruns with ALSA all the time and the symptom doesn't show.

If I attach strace after the process has frozen I get this and nothing
else:

# strace -p 443
Process 443 attached - interrupt to quit
futex(0x4030e144, FUTEX_WAIT_PRIVATE, 2, NULL


This stop happens at random at any point typically after minutes but run
time can be over an hour.

I need to work around this as I need the board for a demo.

Im using, alsa-lib-1.0.25
kernel 2.6.36.4
BusyBox v1.19.2

I also compiled strace for arm, but this and a busybox shell is the only
environment I have on the board.

The problem showed when I starting using this function to poll alsa:

The same code on my PC dual core AMD does not seem to suffer the
problem  : alsa-lib-1.0.23, Linux jonspc 2.6.32.26-175.fc12.i686 #1 SMP

Before anyone points it out I want to poll as alsa is not the only sound
output supported by the code.

int sound_system_needs_data_now()
{
        int framesleft;
        snd_pcm_status_t *status;
        snd_pcm_status_alloca( &status );

        // If the alsa playback has stalled then it definately needs data
        snd_pcm_status(playback_handle,status);
        if( snd_pcm_status_get_state( status ) != SND_PCM_STATE_RUNNING )
                return(TRUE);

        framesleft=snd_pcm_avail (playback_handle);
	//printf("FL=%d\n",framesleft); fflush(stdout);

        if (framesleft>1000)
                return(TRUE);
        else
                return(FALSE);
}


Stuck process

# cat /proc/443/status 
Name:   udp-many-way-au
State:  S (sleeping)
Tgid:   443
Pid:    443
PPid:   392
TracerPid:      0
Uid:    0       0       0       0
Gid:    0       0       0       0
FDSize: 32
Groups: 
VmPeak:     4356 kB
VmSize:     4292 kB
VmLck:       132 kB
VmHWM:      1788 kB
VmRSS:      1788 kB
VmData:      396 kB
VmStk:       136 kB
VmExe:        28 kB
VmLib:      3348 kB
VmPTE:        12 kB
VmSwap:        0 kB
Threads:        1
SigQ:   0/471
SigPnd: 0000000000000000
ShdPnd: 0000000000000000
SigBlk: 0000000000002000
SigIgn: 0000000000000006
SigCgt: 0000000180002000
CapInh: 0000000000000000
CapPrm: ffffffffffffffff
CapEff: ffffffffffffffff
CapBnd: ffffffffffffffff
Cpus_allowed:   1
Cpus_allowed_list:      0
Mems_allowed:   1
Mems_allowed_list:      0
voluntary_ctxt_switches:        5908
nonvoluntary_ctxt_switches:     1766


Any useful suggestions welcome.

Thanks,
Jon

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2012-03-14 13:18 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-16 12:01 Random process lockup on ARM board: alsa-lib-1.0.25, FUTEX_WAIT_PRIVATE Jonathan Andrews
2012-02-17 21:04 ` Jonathan Andrews
2012-02-18 13:02   ` Jonathan Andrews
2012-02-18 20:36     ` Clemens Ladisch
     [not found]       ` <1329603022.1089.57.camel@jonspc>
2012-02-20  7:54         ` Clemens Ladisch
     [not found]           ` <1329926198.22918.10.camel@jonspc>
2012-02-22 16:23             ` Clemens Ladisch
     [not found]               ` <1329933773.24266.44.camel@jonspc>
2012-03-08  8:53                 ` Clemens Ladisch
     [not found]                   ` <1331199625.22455.7.camel@jonspc>
     [not found]                     ` <4F588213.2030600@ladisch.de>
     [not found]                       ` <1331203724.22455.44.camel@jonspc>
2012-03-08 11:43                         ` Clemens Ladisch
2012-03-08 13:04                           ` Jonathan Andrews
2012-03-08 13:47                           ` Jonathan Andrews
2012-03-08 14:35                             ` Clemens Ladisch
2012-03-08 15:14                               ` Jonathan Andrews
2012-03-08 15:34                                 ` Takashi Iwai
2012-03-08 16:42                                   ` Jonathan Andrews
2012-03-08 19:05                                   ` Jonathan Andrews
2012-03-08 20:40                                     ` Clemens Ladisch
2012-03-08 21:42                                       ` Jonathan Andrews
2012-03-14 13:18                                       ` Jonathan Andrews

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).